logoalt Hacker News

ndepoeltoday at 8:58 AM8 repliesview on HN

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. It's a very elegant system that naturally flows out of the rather forward-looking decision to build the entire engine around a robust networking model.


Replies

anonymous_sorrytoday at 9:44 AM

I don't see why it makes a difference for this purpose that you're replaying network packets or controller inputs or any other interface to the game engine. The important thing is that there is some well-defined interface. I guess designing for networked multiplayer does probably necessitate that, but if the engine isn't deterministic it still isn't going to work.

There was a twitter thread years ago (which appears to be long gone) about how the SNES Pilot Wings pre-game demo was just a recording of controller inputs. For cartridges manufactured later in the game's life, a plane in the demo crashes rather than landing gracefully, due to a revised version of a chip in the cartridge. The inputs for the demo were never re-recorded, so the behaviour was off.

show 3 replies
_jackdk_today at 11:22 AM

Carmack wrote a really interesting .plan about this. It seems to be written between Q2 and Q3A, and cites the Windows message queue as a big inspiration:

https://github.com/ESWAT/john-carmack-plan-archive/blob/mast...

trashfacetoday at 4:04 PM

The engine needs to save the RNG seed too and various other details, the goal is definitely to make it as deterministic as possible (and yes saving the packets is part of that).

Narishmatoday at 3:03 PM

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.

show 2 replies
syspectoday at 3:00 PM

"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!

show 1 reply
alfgtoday at 2:19 PM

It's just capturing inputs and replaying them.

show 1 reply
kahrltoday at 1:29 PM

[flagged]

kahrltoday at 1:25 PM

[flagged]

show 1 reply