Animated Dwarf example for lots of characters

Apr 21, 2008 at 9:15 AM
Hey,

For our game we have a city full of civilians, about 1000. I have gotten the animated dwarf example to work for one civilian. However, I want to get it to work for all of them without having to add a component for each civilian. What I had in mind was to have only one animatedModel object. In draw(), go through the array of civilains, get the animatedModel's position based on the currently selected civilian, draw it, then repeat for the next civilian.

To do this, I had to make the animatedModel a normal class, not a component so I could call the draw() when I needed to. However, using this method, it doesn't seem to dipose of the previous state. So when the model moves, it draw it at it's new position, but also at it's old position. Meaning the number of models been drawn will have doubled within milliseconds.

Any ideas now to fix this, any help is much appreciated.

Thanks.