Posted by speckx 3 days ago
A system is only correct relative to the transition system you wrote down. If the real system admits extra transitions that you care about (pause, crash, re-entry, partial commits), and you didn't model them, then you proved correctness of the wrong system.
Like, you're still just churning away at the main game loop while literally nothing else is happening except for you waiting for me to unpause it?
Because THAT would be an actual achievement. Hell, I can suspend any process from the Unixy side of things by sending a SIGSTOP signal, for a far more perfect "pause".
If I was a game dev, I would not settle for "looks like paused, but still burning down the environment and heating up my home as a side effect"
In the article, there is a case where the game takes a screenshot and disable costly rendering, presumably to deal with this problem. But the thing is that most games are designed to to be actively played, not paused for extended periods of time and having an active pause for a couple of minutes isn't going to destroy the environment.
For backgrounding, is is common for games to run at a much slower framerate to save resources.
I hate when games are into multiplayer modes even when played in single-player campaign (e.g.: Generation Zero) and thus cannot be paused.
Another thing that I hate in this regard are unpausable cutscenes. I remember when I was playing The Witcher 3, that at last there was some cutscene advancing some plot point, and right into the middle of it The Wife™ would barge in telling me something important that would require my attention... but I cannot pause that scene so I had to miss it while I listened to her. Why, oh why, devs hate pausing cutscenes so much??
Unity has introduced the idea of coroutines (which were essentially yield based generators), and people started using them, and immediately encountered problems with pausing/saves.
Internally these coroutines compile down to state machines with opaque internals which are not necessarily consistent across compilers/code changes, and its very difficult to accomodate needs like pausing when using them.
From what I've seen, the usual answer is that people go back to hand-written state machines, and go through the pain of essentially goto programming to fix these issues.
Some more info here (and in general about pausing in Unity): https://gamedevbeginner.com/the-right-way-to-pause-the-game-...
Modern games can have the same issue. Even taking a capture of the exact graphics commands and repeating them, you'll sometimes see animated physics effects like smoke and raindrops. They're doing the work on the GPU where it's not necessarily tied to any traditional physics timestep.
But like most things in game development there is no solution that fits every use case.
I really need to start blogging my notebook