Hi everyone! Got an exciting update for you!
This update started off as a small attempt to upgrade performance but before I knew it I was digging deep into the systems and giving it quite an overhaul but after a few weeks I bring to you the Performance Update!
After digging deep into the C++ behind the AI I have found that the most CPU intensive part was where every unit would check it's immediate area for surrounding units (an important part of the game as you can imagine.) This was especially true for cops as they doing a LOT of target seeking that was slowing the game down.
So let's dig into what has changed!
Previously the maximum a unit could see is 3 squares. I used a lot of other tricks to help get past this issue but it did end up being rather limiting. There was also no real line of sight. People could see through other people and around corners. In this refactor there is now a line of sight of 5 tiles. Every cop, every zombie, every civilian. I want to add something into the game so you can see what a unit's line of sight is when they are selected or being controlled but this will be for a future patch.
A lot of planning had to go into the systems for this:
After this update the metrics appear much better:
Both the before and after tests were 25,000 cops walking around. The metrics after the update is now showing things to be about 7 times faster than it used to be. That plus a new line of sight range growth from 3 to 5 tiles is a pretty good performance update in my book!
If you are a player of DeadOS who has been noticing performance drops or having a hard time running larger simulations, I really want to know how your experience has changed with this latest update! I'm especially interested in how the game runs on low spec machines.
Thanks everyone and I hope you enjoy the update!
Changed files in this update