( search forums )
How the demo recording is done...
Soldat Forums - Soldat Talk - Developers Corner
Dragon88
January 24, 2004, 2:30 am
DISCLAIMER:

The content of this post is purely supposition. I have never seen the source and have no idea how it is really done. I can only guess based on what I have seen. I make no warrantee that this information is accurate. I also am not responsible for any cheating that results from this information. PLZ don't ban me.




The demo recorder is implemented as a client to the game. It gets sent the packets (probably over the local loopback [127.0.0.1] for single player games) of the game and puts their contents in a file. This is why the recorder takes up a slot in the player list. When the demo is played back the game extracts the packets from the file, (perhaps it processes them from there, or maybe it sends it through the loopback), and it is just like joining a real game. I don't think the packets are put in raw, but they may be. If they were then that could potentially give away a lot about how the packets are formatted if someone could crack the data in the file (you would have to do this in order to make your own demo player). Just figured some would find this interesting.

Your programming buddy, Dragon88

Michal Marcinkowski
January 24, 2004, 1:16 pm
Well you're completely right.
But if someone cracks the packets it would be no use since the most important packets are encrypted. The packets you would discover are only server packets and they have no use for cheating unless you want to do a cheating server.

Aquarius
January 24, 2004, 1:48 pm
PLEAAAASEE, Michal, make a small program to cut and mix demos! Maybe it wouldn't be difficult to make such program. I want to be a director! Please please pleaaaaaaaaase!

ThaD
January 24, 2004, 2:51 pm
just covert your demos to avi

Aquarius
January 24, 2004, 4:43 pm
Yes, but I want to keep the file size relatively small. I don't want to make 40 MB video, who will download it? And compressed video won't have the demo's quality....

Dragon88
January 25, 2004, 2:58 am
quote:Originally posted by Michal Marcinkowski
Well you're completely right.
But if someone cracks the packets it would be no use since the most important packets are encrypted. The packets you would discover are only server packets and they have no use for cheating unless you want to do a cheating server.


That's a relief. Does the recorder take up a player slot on the server or the client? It seems like it must be on the client, or else the player limit would become meaningless... I guess this is a pretty stupid question... Here's a better one:

Do the packets actually get sent throught the loopback in single player games? If they are it seems like you could optimize further and just spit it out raw to the file.