Live data from Hacker News

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

kotaku.com

161–170 of 273 posts

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

#161
post #128

Earlier quoted context omitted.

I used to be a professional sailor, and love finding nautical terminology in programming. At sea dead reckoning is navigating using the speed and direction of the ship, and adding tide and wind to calculate a fix based on the last known position. The term dates back to the 1600s. It is fun to point at a chart and confidently state “We’re here! I reckon...”

There's a book I read a while back named "Longitude" that maps the storied quest in science to improve upon dead reckoning by devising greater and greater accuracy in time pieces used on ships. Iirc it was a fun read if anyone else finds that sort of thing interesting (as I do.)

What other books do you like?

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

#162
post #128

Earlier quoted context omitted.

Look into dead reckoning vs lock step for networking. Lockstep requires determinism at the simulation layer, dead reckoning can be much more tolerant of differences and latency. Quake and most action games tend to be dead reckoning (with more modern ones including time rewind and some other neat tricks). Very common that replay/demo uses the network stack of it's present in a game.

I used to be a professional sailor, and love finding nautical terminology in programming. At sea dead reckoning is navigating using the speed and direction of the ship, and adding tide and wind to calculate a fix based on the last known position. The term dates back to the 1600s. It is fun to point at a chart and confidently state “We’re here! I reckon...”

I think the introduction of the term in networking simulations and games came with SIMNET https://en.wikipedia.org/wiki/SIMNET and continued more widely in the DIS https://en.wikipedia.org/wiki/Distributed_Interactive_Simula...

I first learned of it in some writing about a 1997 multiplayer game called, heh, Dead Reckoning.

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

#163
post #128

Earlier quoted context omitted.

I used to be a professional sailor, and love finding nautical terminology in programming. At sea dead reckoning is navigating using the speed and direction of the ship, and adding tide and wind to calculate a fix based on the last known position. The term dates back to the 1600s. It is fun to point at a chart and confidently state “We’re here! I reckon...”

There's a book I read a while back named "Longitude" that maps the storied quest in science to improve upon dead reckoning by devising greater and greater accuracy in time pieces used on ships. Iirc it was a fun read if anyone else finds that sort of thing interesting (as I do.)

It's a great read! A story of how the scientific elite stalled progress because the right answer wasn't the one they hoped it would be, and didn't come from the sort of person they thought it should.

If you get the chance, you can see some of Harrison's chronometers at the Royal Observatory in London, though I don't know if they're always on display.

I'll add a recommendation for Sextant by David Barrie.

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

#164

This reminds me of the Action Replay device you could get for the Amiga 500 in the ‘90s. You could use a knob to slow down any game to a stop. You could also press a button to go to a console that let you change memory. It would even figure out which bit of memory kept the number of lives of you deliberately lost a life and it could see what decremented.

There was some cheat software that did the same back in the windows 9x/XP days. Dont remember the name but there were many I am sure.

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

#165

Earlier quoted context omitted.

An interesting thing about the a lockstep solution which only considers inputs is that any RNG required in the game must be generated from the input history somehow. This could lead to players being able to manipulate their luck with extremely precise inputs.

> a lockstep solution which only considers inputs Nothing stops you from adding a PRNG seed parameter to initialize your deterministic game engine.

Typical deterministic game engines will do this, send it to every machine as part of the initial game state, and also check the seed across machines on every simulation frame (or periodically) to detect desyncs.

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

#166
post #118

Like a lot of issues in gamedev, pausing the game is a surprisingly difficult problem to solve. It's especially difficult to provide a one size fits all solution which would obviously be desirable for the popular modern engines that try to be a general solution. I see a lot of comments here saying something along the lines of "isn't it just a state in the state machine?" which isn't wrong, but is an extremely simplis…

I read your comment and the article and I’m still not really clear on why this isn’t as simple as saving the current state or pausing the render or time loop.

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

#167
post #151
post #51

Earlier quoted context omitted.

It wasn't really that much to do with determinism. Quake uses a client-server network model all the time, even when you're only playing a local single-player game. What the demo recording system does is capture all of the network packets that are being sent from the server to the client. When playing back a demo, all the game has to do is run a client and replay the packets that it originally received from the server…

"All you have the game has to do is run the client and replay the packets" --- Sure after you build a sophisticated the system that supports that, then you "just" do as you described. EASY!

It sounds like it would be complicated but it's really not! The server should already be sending a snapshot of the world when you connect and then stream deltas after that. If you capture all of the packets the server sends you can mock the connection to the server and it should just work because the client renders everything based on that data. You'll only need to do a bit of work to disable client input etc.

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

#168
post #51

Earlier quoted context omitted.

It wasn't really that much to do with determinism. Quake uses a client-server network model all the time, even when you're only playing a local single-player game. What the demo recording system does is capture all of the network packets that are being sent from the server to the client. When playing back a demo, all the game has to do is run a client and replay the packets that it originally received from the server…

I'm not sure that's the reason since Doom and Wolfenstein 3d before it also had such demo systems but they didn't use a client/server model.

Doom and Wolf3d and many other multiplayer games of the 90s (including some I worked on) were deterministic/lockstep and machines only needed to exchange inputs (in a deterministic manner ofc).

Quake was completely different. The client/server term was aimed at describing that the game state is computed on the server, updated based on client inputs send to the server, and then the game state is sent from server to the clients for display. Various optimizations apply.

Deterministic/lockstep games more often used host/guest terminology to indicate that a machine was acting as coordinator/owner of the game, but none of them were serving state to others. This terminology is not strict and anyone could use those terms however they wanted, but it is a good ballpark.

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

#169
post #102
post #80

I would expect pausing to bring a game’s CPU/GPU usage down to near-zero, which won’t happen if the game keeps redundantly rendering the exact same frame. A game engine can optimize this by special casing time scale zero to simply render a single textured quad under the pause menu (which is probably what one of the commenters in TFA referred to).

You would expect it to do that, and I'd say that's a desirable behaviour, but it's not really that simple and you certainly don't get that for free. Typically any of the common modern engines with a "time scale" variable like that are not at all optimising anything in that way. It's likely that the physics engine won't be stepped with a zero delta time, which will reduce the time spent on physics, but that's more of…

Speaking of "capturing the scene and display it under the pause menu"....

acerola on YouTube has an excellent 23 minute frame rendering analysis video about what goes into drawing just the "pause menu" in Persona 3 Reload:

https://youtu.be/dVWkPADNdJ4?t=19m10s

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

#170

This reminds me of the Action Replay device you could get for the Amiga 500 in the ‘90s. You could use a knob to slow down any game to a stop. You could also press a button to go to a console that let you change memory. It would even figure out which bit of memory kept the number of lives of you deliberately lost a life and it could see what decremented.

There was some cheat software that did the same back in the windows 9x/XP days. Dont remember the name but there were many I am sure.

Cheat Engine

https://github.com/cheat-engine/cheat-engine

Post reply on HN