Replay file format

Replay file format

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Replay file format

Post by Maelstrom »

How are replay files made? Ive opened them up in notepad, and seen that the start is just the start script, but what about the rest of the file? How is that layed out? And the first five characters, how are they made? Of the few replays that ive looked at, those first characters look quite random, and pointless.

So, basically, what do the first few characters mean, and is there any way to extract data from the stuff below, like a chatlog, or who won the game?

Thanks
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

The first 4 bytes is the length of the startscript, then comes the startscript. After that it's just network traffic, so there isn't a lot you can do with it before having to parse the entire traffic. The network data itself is pretty useless too: It's just a bunch of user/ai commands sent, you need the spring code to make something useful out of it.
User avatar
Android_X
Posts: 84
Joined: 24 Dec 2005, 06:13

Post by Android_X »

I thought byte 2-5 was the length of the startscript, I have no idea what the first byte is.
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Post by Maelstrom »

By the looks of it, its byte 2-4. Atleast that worked for me. Ill see if it works for other replay files as well.
Post Reply

Return to “Engine”