How does SC2 save an entire replay with so little information?

I noticed the size of replays are remarkably small.

There is one continuous variable (camera position) for a minimum of two players. I would imagine that alone would take up several megabtyes, yet these replays are often in the KB range.

Truly amazing (we’re not even taking into account commands issued!)

Anyone know exactly how Blizzard so efficiently codes their replays?

1 Like

They don’t record the screen but probably the replays just saves the unit movements values or something which can lower the file size to extreme low values. It was used in SC1 aswell however in SC1 there was a bug for use map setting (custom games) with civilians in it. Their movement wasn’t tracked and literally all of the use map setting replays including this unit was broken. They didn’t moved at all so it was like you was watching totally different game than you played. Most of the RTS games with replay option in it probably use this technique because their replay files are extremely small. C&C Generals had similiar problems with unit tracking however it was bugged only when playing against hard AI. Literally you could win VS hard AI however when you watched the replay at some point of the game your units literally stopped moving and enemy was constant attacking you until you lose. It was like watching totally different game.

3 Likes

Game is deterministic which comes with certain advantages. Same parameters and input results in same output. Replays consist mostly out of just actions, yes those actions that make up your apm, and the rest is metadata, but it also tracks some other stuff which it uses to check whether it’s in sync with the result from replaying the game. Replays can be opened with mpq editor if you’re curious.

yeah the way the replays are set up are both genius and very stupid

I’m no expert, but from what I’ve seen said around here, replays are meta data and the list of commands made during the match. As for camara position, I suspect it’s just coordinate system which is probably not much larger than a click or key command.