Talking Performance

It’s not like me to not discuss performance really at all yet.  I’ve mentioned some optimizations for loading time, but the real performance questions are during real-time operations.  For a game that will be heavily based on AI agents, and lots of active objects, I need to make sure the code is highly optimized.

I’ll start with another screenshot:

ScreenShot 2

So what’s actually going on here?  Not a whole lot.  These days, who really worries about 2D graphics performance?  Most video cards have enough hardware acceleration horsepower to draw 10s of thousands of sprites every frame without any trouble at all.  Sure you have to try to avoid texture switches by using spritesheets, but they aren’t really that hard to set up.

Also in the screenshot you can see that I’m not really doing any collision detection for the wandering zombies.  I’ll be adding that later as it’s only visually important at this point, and the zombie density won’t nearly be this high in any one area (other than performance tests, or possible endgame scenarios) since it’s much more of a survival simulation and less about shooting things.

So back to performance.  The screenshot above is from a performance test of 25000 individual AI agents (25000 individual zombies) in a world of size 1000×1000 tiles.  There is no distance attenuation for any of the agent updates, which is important.  I want all agents to update correctly in real time, since it’s all going to be AI driven in the first place.  The game is still able to run at 60fps under these conditions, with no control delays.  I’m happy with this performance, it’s in-line with what I was expecting and there’s still some room for performance enhancements (not all objects are correctly using pooling right now).

I’m also planning on dynamically spawning / despawning zombies, as they aren’t as important as other external actors (which will continue to be shrouded in mystery…) which will save some reserve processing time, even though I don’t need it currently.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>