Day 4

Deep Dive: Implementing Variable Game Speed

Spent most of the day doing game speed stuff. Absolutely everything needs to tie in to this game speed, so I’ve got a scriptable object that contains a game speed float. That float is set with a slider, and every single speed and time variable in the game gets multiplied or divid

27 May 2023 Polyfury development log

Spent most of the day doing game speed stuff. Absolutely everything needs to tie in to this game speed, so I’ve got a scriptable object that contains a game speed float. That float is set with a slider, and every single speed and time variable in the game gets multiplied or divided by that, respectively. E.g. bullet speed is multiplied (a speed of 10 would become a speed of 5 when the game speed is 0.5, for example), the time it takes a boss to move is divided (if it takes 0.5 seconds for the boss to move from the centre to the edge, it becomes 0.75 seconds with a game speed of 0.5).

This is great, but I’m yet to figure out a nice, consistent way of doing it. I’ve got a game speed scriptable object that I can use everywhere I need to, but that still requires me remembering to multiply everything by it! Setting Time.timeScale doesn’t work, since there are a few things that need to run independently of timescale - and it makes hitstop a LOT more complicated.

For now I’ll just carry on doing it this way, maybe I just write some validation somewhere that checks against me being stupid. Because lets face it, I really can be 🥲

If you’ve got any suggestions, I’d love to hear them - post a comment down below!

What’s next?

The UI stuff is broadly there now, I need a break from it so I’ll move on to making balance tweaks for the Hexagon in preparation for the next round of testing. There are a few things that are too difficult, and one thing is completely broken - maybe I’ll do a deep dive on collision detection for fast-rotating objects tomorrow?


Making your own games? Check out Artificer Pro - released this month!