Daniel and I sat down this afternoon to try and kill that AI performance bug I mentioned in our last post - and I'm glad to report we fixed it. The game should run smoothly on a variety of hardware now.

You see, we have pretty powerful AI that was taxing on the performance of the game - it was dropping our frames down by like a factor of ten on MY computer (which is unacceptable!) so we had to sit down and work on it. We set up a control variable of 500 Artificial Intelligence's in one room, and ran the game.

Here is the initial data. As you can see, it takes almost 7 milliseconds to update the entities (which are all of the living creatures in the game), which is pretty bad considering our "budget" is around 2 milliseconds. The total update time was 8 milliseconds.

We dropped it by more than half with some quick work - and now it's pretty acceptable. We did this by decreasing the amount of raycasting the AI was doing, and also optimizing their sensory systems and the physics engine to accommodate their large sensory radii (how far they can see and hear)

However, this still was no acceptable. We were still going over our 2 millisecond budget. So we decided to set precedence over certain thought processes of the AI's brain. For instancing, they should only consider sensory stimuli every tenth of a second, instead of 512 times per second.