Live data from Hacker News

Game devs explain the tricks involved with letting you pause a game

kotaku.com

41–50 of 273 posts

Re: Game devs explain the tricks involved with letting you pause a game

#42
post #26

Earlier quoted context omitted.

You don't need to tun the whole game at a fixed framerate, only the physics. That's actually common practice. The bigger problem is that floating point math isn't deterministic. So replays need to save key frames to avoid drift. Quake used fixed point math.

Quake needs a FPU; if that was true it would run on a 486 SX.

You're right, I must have gotten that mixed up. Sorry.

I guess floats are still mostly deterministic if you use the exact same machine code on every PC.

Re: Game devs explain the tricks involved with letting you pause a game

#43
post #19

Earlier quoted context omitted.

Checking in as a random indie developer who still prioritises determinism in my engine. I don't understand why so many games/engines sacrifice it when it has so much utility.

Determinism isn't essential to achieve record/playback experiences. You could just record the transform of the player at some fixed interval and then replay it with interpolation. This is arguably more "deterministic" in a strategic sense of shipping a viable product.

The player is just one entity, you'd need to do the same to any other non-trivial entity. And you couldn't use fixed intervals and naive interpolation, otherwise you'd have entities clipping the ground when bouncing etc.

Re: Game devs explain the tricks involved with letting you pause a game

#44

One of the things that impressed me in Quake (the first one) was the demo recording system. The system was deterministic enough that it could record your inputs/the game state and just play them back to get a gameplay video. Especially given that Quake had state of the art graphics at the time, and video playback on computers otherwise was a low-res, resource intensive affair at the time, it was way cool. It always s…

I worked on this for a pretty big game. We recorded the network traffic and played it back and simulated the game - so same problem with patches. It also has the awkward side effect of exposing a metric crap ton of “join in progress” style bugs because our game didn’t support JiP.

Re: Game devs explain the tricks involved with letting you pause a game

#45
Early versions of Unreal Engine had these animated procedural textures that would produce sparks, fire effects, etc. The odd part is that when you paused the game, the animated textures would still animate. Presumably, the game would pause its physics engine or set the timestep to 0, but the texture updater didn't pause. I suspect it was part of the core render loop and each new iteration of the texture was some sort of filtered version of the previous frame's texture. Arguably a very early version of GPU physics.

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.

Re: Game devs explain the tricks involved with letting you pause a game

#46
post #10

I quite like when games keep playing some visual-only animations when paused. Like torch flames and trees swaying in the wind.

Torch flames and trees swaying in the wind do not affect gameplay at all - they're most likely done in a shader and I think it's easier to keep updating a time uniform than to add extra conditions everywhere :D

Re: Game devs explain the tricks involved with letting you pause a game

#47
> when it was time to ship, we’d read the [Technical Requirements Checklists] and have to go back and add a special pause for when you unplug the controller

article confirms my early theory I formed when reading the title about why would pause be complicated

Re: Game devs explain the tricks involved with letting you pause a game

#48
post #29

One of the things that impressed me in Quake (the first one) was the demo recording system. The system was deterministic enough that it could record your inputs/the game state and just play them back to get a gameplay video. Especially given that Quake had state of the art graphics at the time, and video playback on computers otherwise was a low-res, resource intensive affair at the time, it was way cool. It always s…

Rocket League is a relatively recent game that allows match recording. It’s nice.

also trackmania, and it's a common way they use to catch cheaters as pb on leaderboard have inputs

Re: Game devs explain the tricks involved with letting you pause a game

#49
post #10

I quite like when games keep playing some visual-only animations when paused. Like torch flames and trees swaying in the wind.

That's usually because the system that runs those things is independent of the timing of the main game loop. And then when someone finally gets around to implementing the pause screen, they still run even with the main game time stopped. And you look at it and think "eh, you know what - looks cool - we'll leave it".

Re: Game devs explain the tricks involved with letting you pause a game

#50

The strangest pause bug I know is in Mario Sunshine: pausing will misalign the collision logic (which runs 4 times per frame) and the main game loop. So certain specific physics interactions will behave differently depending on how many times the game has been paused modulo 4.

really? is one state the one where you fall through bridges? I can't play Sunshine because of that.
Post reply on HN