logoalt Hacker News

vintermannyesterday at 7:39 AM29 repliesview on HN

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 surprised me how few games had that feature - though a few important ones, like StarCraft, did - and it only became rarer over the years.


Replies

purple-leafytoday at 12:58 AM

Hey I am actually working on a browser game that is fully-deterministic (except for player inputs) and so I can basically replay games entirely. Think like a chess engine game.

I’ve been obsessing over this determinism and replayability for months, to the point where any game played is fully replay-able to the exact same events as the original game. So you can play, then watch a recording and spectate your played games from different actors perspective (enemy perspective etc).

My rendering and game logic are fully decoupled.

I wrote the “engine” for the game from scratch. I think I only use one third party library currently.

Cool to see this discussion

ndepoelyesterday at 8:58 AM

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.

show 9 replies
klodolphyesterday at 12:41 PM

> The system was deterministic enough that it could record your inputs/the game state and just play them back to get a gameplay video.

NOT how demos work in Quake. It’s more like Quake uses a client/server architecture, and the demo is a capture of the messages.

https://www.gamers.org/dEngine/quake/Qdem/dem-1.0.2.html

etermyesterday at 8:11 AM

Related to that is the ability to watch games using the game-client too.

This used to be a promoted feature in CS, with "HLTV/GOTV", but sadly disappeared when they moved to CS2.

Spectating in-client is such as powerful way to learn what people are doing that you can't always see even from a recording from their perspective.

show 3 replies
greazyyesterday at 8:27 AM

Interesting you mention StarCraft. The replay feature could diverge off due to the non deterministic nature of the game.

https://news.ycombinator.com/item?id=21920508

show 4 replies
applfanboysbgonyesterday at 7:45 AM

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.

show 4 replies
jval43yesterday at 8:05 AM

Bungies Marathon series (1994) had the same recording system, as other commenters mentioned due to networking multiplayer.

What's totally insane is that the modern engine rewrite Aleph One can also play back such old recordings, for M2 Durandal (1995) and Infinity (1996) at least.

GaelFGyesterday at 7:55 AM

I'm pretty sure it's because it's in fact 'just' a cool side effect to a common network architecture optimisation from the time where you could'nt send the 'state' of the entire game even with only delta modifiers and so you make the game detertministic to only synchronize inputs :) an exemple article I remember : https://www.gamedeveloper.com/programming/1500-archers-on-a-...

The main downside which probably caused the diseapearance is that any patch to the game will make the replay file unusable. Also at the time (not sure for quake) there was often fixed framerate, today the upsides of using delta time based frame calculation AND multithreading/multi platform target probably make it harded to stay deterministic (specialy for game where you want to optimize input latency)

show 3 replies
pornelyesterday at 10:36 PM

It wasn't deterministic. It didn't record the inputs. It recorded the basic state of the objects you could see.

Deterministic game sync is a completely different approach more often used in RTS games. Quake had non-deterministic authoritative central server + clients getting an incomplete view of the world.

zaptheimpaleryesterday at 2:33 PM

Age of Empires 4 also does this. It's very cool and saves a lot of space, but it does have some significant downsides at least the way its implemented there - you can't rewind replays, and they become unwatchable when the game updates significantly.

show 1 reply
limaoscarjulietyesterday at 10:28 AM

In some games - most famously Doom - entire multiplayer is based on exchanging just the inputs and the games on all connected computers are deterministic enough to provide same outcome on all of them.

I am one of the authors of Fire Fight game (1996-ish) and we pulled the same stunt. It was actually easy, we just had to build our own "random number generator" and fix all bugs with uninitialized memory :-)

show 1 reply
awakeasleepyesterday at 1:43 PM

The alternate to this was the first WORMS game, where, if I remember it properly, there were nondeterministic replays and the next turn picked up from the replay not the initial action

nickjjyesterday at 12:59 PM

Demos were really useful for helping validate competitive play too. While certain anti-cheat programs were available such as PunkBuster (Quake 3), having gaming ladders request everyone records a demo and upload it from their POV was a very low friction way to deter cheating. The idea being, no one looked at them unless there was suspicion so it wasn't even a time sink for administrators.

No fancy kernel level anti-cheats. Just ensure matches were played on legitimate servers and demos were recorded.

Also, back then live streaming while playing was usually too much of a computational and network burden (56k modems), but casting was just coming around as being a thing and certain Quake 3 mods had spectator modes that let someone streaming spectate you from the first person live which also helped deter cheating. There was even split screen spectating modes so you can follow the action (useful for 4v4 games, etc.).

Carmack and team really made something special back then. The ideas they had and what they did with their tech on relatively low end hardware was remarkable.

7373737373yesterday at 8:42 AM

Supreme Commander 2 savefiles appear to be a list of timestamped user interface inputs and unit commands

show 1 reply
silisiliyesterday at 7:58 AM

Quake1 was my first love. From the old DOS version to the GLQuake to grappling hooks on Trinicom. I was amazed not only by said demo system but by QuakeC, and how heavily it was used, especially in college communities. I remember MIT and UWisc both being unreasonably productive modders in said language.

As a kid, I couldn't wait to see what came next. Sadly, Q1 was rather one of a kind, and it was many years until anything else like it showed up.

joelanmanyesterday at 1:00 PM

You could play back multiplayer Halo 3 matches in 3D, with a free camera. Was really interesting to see how matches played out, how you got killed and so on, and for taking cool screenshots.

jmorenoamoryesterday at 10:49 AM

Factorio follows that method also, given its complexity it's quite an achievement

ErneXyesterday at 8:20 AM

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

show 3 replies
abejfehryesterday at 10:38 AM

You might find this talk interesting: https://youtu.be/W20t1zCZv8M

It’s one of my favourites

diathyesterday at 9:39 AM

If memory serves well, that worked by replaying network packets, which is what some other games do as well, the problem with that approach is that for live service games unlike old games that were often "set in stone", the protocol always changes, so it's a huge maintenance burden. You either need to add conversion tools, keep maintaining backwards compatibility with older protocol versions, or you accept that replays quickly become outdated.

show 2 replies
maccardyesterday at 8:48 AM

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.

stephbookyesterday at 9:46 AM

The best replay feature was in "Heroes of Newerth." (DotA 1.5 in 2009)

Warcraft 3 replays couldn't jump in time, just forward very fast. HoN could do that. It was amazing.

For a few months they even made ALL replays searchable on a website. Every game of HoN played globally.

Lercyesterday at 7:53 AM

I had a puzzle game were all of the solutions it would show were playbacks of my keypresses as I solved it myself. As the puzzles got more difficult it got harder and harder to record a solution without having pauses to think about what to do next.

show 1 reply
nagaiaidayesterday at 7:57 AM

saving rocket league replays to watch yourself play from your opponent's perspective was super helpful in 1v1

pull_my_fingeryesterday at 4:24 PM

I always wondered how NES games, which were notoriously low memory, could have game simulation on the start screens. Think Super Mario Bros, but there are many others. If no input is received at the start menu, the game starts playing a demo run. You always see videos and posts about how developers were dissecting sprites and swapping color pallets to work around the small memory, so how in the heck did they manage having the gameplay demos?

show 1 reply
dSebastienyesterday at 7:40 AM

I wish I kept my demo files!

TacticalCoderyesterday at 12:45 PM

> The system was deterministic enough ...

I wrote about it here many times over the years but in 1991 I wrote a little DOS game (and I had a publisher and a deal but it never came out and yet it's how my career started but that's another story) and at some point I had an "impossible to find" bug because it was so hard to reproduce.

So I modified my game engine to be entirely deterministic: I'd record "random seed + player input + frame at which user(s) [two players but non-networked] input was happening". With that I could make tiny save files and replay (and I did find my "impossible to find" bug thanks to that).

First time I remember someone talking about it was a Gamasutra article by an Age of Empire dev (article which another poster already mentioned here in this thread): they had a 100% deterministic engine. FWIW I wrote an email to the author of that article back then and we discussed deterministic game engines.

Warcraft 3 definitely had a deterministic game engine: save files, even for 8 players (networked) games were tiny. But then you had another issue: when units, over different patches, would be "nerfed" to balance the game (or any other engine change really), your replay files wouldn't play correctly anymore. The game wouldn't bother shipping with older engines: no backward compatibility for replay files.

I had a fully deterministic game engine in 1991 and, funnily enough, a few days ago with the help of Claude Code CLI / Sonnet 4.6 I compiled that old game of mine again (I may put it on a public repo one day): I still had the source files and assets after all those years, but not the tooling anymore (no more MASM / no more linker) so I had to "fight" a bit (for example I had not one but two macros who now clashed with macros/functions used by the assembler: "incbin" and another one I forgot) to be able to compile it again (now using UASM, to compile for DOS but from Linux).

Another fun sidenote... A very good friends of mine wrote "World Rally Fever" (published by Team 17) and I was a beta tester of the game. Endless discussion with my friend because I was pissed off for his engine was so "non-deterministic" than hitting the Turbo button on my 486 (I think it was a 486) while I was playing the game would change the behavior of the (computer) opponents.

https://youtu.be/NhRQWNqbvTk

To me a deterministic game engine, unless you're a massively networked multi-player game, just makes sense.

Blizzard could do it for Warcraft 3 in 2002 for up to 8 players and hundreds of units. Several games had it already in the nineties.

It simplifies everything and I'd guesstimate something like 99% of all the game out there that don't do it could actually do it.

But it touches to something much more profound: state and how programmers think about state and reproducibility. Hint: most don't think about that at all.

Some do though: I was watching a Clojure conf vid the other day and they often keep hammering that "view is a function of state". And it is. That's how things are. It was true in 1991 when I wrote my DOS game, it was true for Age of Empire, Warcraft 3 and many other games. And it is still true today.

But we're in 2026 and there are still many devs insisting that "functional programming sucks" and that we should bow to the mutability gods for that is the only way and they'll fight you to death if you dare to say that "view <- fn(state)".

This explains that.

show 1 reply
saagarjhayesterday at 10:09 AM

Super Smash Bros Brawl does this too for replays. I remember being a child and just learning about how computers worked and being very confused at how such a long video (which I knew to be "big") could possibly fit in such a small number of "blocks" on the Wii while screenshots were larger. I think the newer games do this too but they have issues because the game can be updated and then the replays no longer work.

sikozuyesterday at 9:41 AM

[dead]