Performance & flamethrowers

February 27, 2020

Performance & flamethrowers

Because what game doesn’t need a flamethrower? Today we talk about a whole bunch of work done to ensure Dead Spread runs smoothly on slower devices, and some fun new additions!

Since the last devlog, we put out a major new alpha release, version 0.8.0, which means one more major release until the open beta! This meant another round of testing and some more great feedback from our alpha testers. There was, however, one bit of feedback that stuck out. Something that we had heard a few times but mostly indirectly. The “game speed” was slowing down drastically at times making it very difficult to play. This was a game breaker, and had to be addressed!

The number of Frames Per Second (FPS) a game runs out can make a huge difference to how it feels. How many FPS your device can manage depends a lot on the hardware, but well written code can make a huge difference. Generally for Dead Spread, we would want a minimum of 60 FPS. The devices we were testing on easily managed this number. However, what a couple of our testers found is that their devices would drop well below that number. This results in the game feeling sluggish, making it very difficult to play.

Since we can not do much about hardware and will be getting a wide range of phones playing this game, it was into the code we went. Thanks to the observation of one of our testers, we realised that the zombie controlling logic was an obvious place to start!

Each zombie used path-finding algorithms to find a path between them and the nearest human which they then follow along. Using tools that show proportionally how much time per second each part of the code took up, we were able to limit it down to a few key areas for improvement. On top of these optimisations, there was also a change made so zombies can now detect if they have line of sight to the nearest human. If they do, instead of using this complicated path-finding algorithm, they just move directly towards the human. These relatively small changes have made the game run 2-3 times faster! These changes have also made the zombies movement feel a bit more natural. Overall a great result!

The new flamethrower in action.

There were some new additions though! A new flamethrower is being worked on, which adds a very distinctive new weapon to the game. As well as being available in the upcoming Survival mode, this weapon will show up in later levels to add a new challenge. There are also new levels being worked on bringing completely new maps. These will appear towards the end of our current campaign.

I know last time I said we’d have some information on Survival mode by now, but with these performance changes, this has been pushed back. Work has started however, and next time there will be something to share, promise!