Benji Flaming

A Day at the Pool

(Click or tap to enlarge)

This week’s update contains an important performance optimization. Until now, most in-game objects were created on-demand as they were needed. In many cases, this worked just fine. On less powerful computers, however, it sometimes created a bit of jitter when, for example, all the flying saucers fired together on a beat, or a large number of crystals were shattered within a short space of time.

The standard solution for this type of problem, which I’ve now implemented, is to maintain a pool of pre-spawned objects which are ready-to-go but invisible, and simply activate one of them when needed. Objects which are no longer needed are deactivated and returned to the pool. This process of activation and deactivation is far less computationally expensive than fully creating and destroying objects.

I also fixed the issue which was affecting the firing of cannons under Windows. The delay between each cannon shot was originally based on real-world time (i.e. a certain number of milliseconds between each shot). I had since changed the firing of the cannons to be based on musical-time, but some vestiges of the old millisecond-based code were still present, and were interacting in strange ways with the new code. Everything is now music-based. :)

Other tweaks in this demo include a slight amount of engine noise when using your forward booster, and an increase of speed (and reduction of duration) for the emergency escape sequence.

Download link is available from the Ko-Fi post.

(Archived gamedev post from 2025-10-18)

Where to next?

View the next gamedev post
View the previous gamedev post
Browse all gamedev posts
View a random gamedev post
Try my video game demo
Follow and support my work
Visit the homepage

Copyright © 1998-2025 Benjamin Flaming
All rights reserved.
This website does not use cookies.
Some 3rd-party music or video players
used here may set their own cookies.