Jogi: is there some qwd/mvd stream specification somewhere or did you reverse engineer this stuff? What about making a documentation for about the file format? :-)
Hehe funny, jogi and documentation, that's a good one
No need to reverse engineer the format when you can just look at a client to see how the demo/network parsing is done. He cut out all the irrelevant stuff and just read things such as entity positions and what not.
There are no official specs for MVDs, no... which is pretty sad
I wish it had been been more of a strict format to start with, and allowed to be extendable without breaking old clients (which would've been pretty easy to do).
I am by no means an expert on any of these formats, but here's a quick summary of the different formats (feel free to correct any mistakes):
Dem (NQ demo):
The network packets are just written to file. When playing back just pass read messages from the demo instead of the network.
QWD:
- Pretty much all network messages are saved.
- Each demo packet has a time stamp saved as a float. The number of seconds since the demo started (actually it's not 0 at start always).
- After the time stamp there's a byte containing the type of command the packet contains. For QWDs these can be:
* dem_cmd = A movement command containing viewangles and movement vectors.
* dem_read = Contains a net message that is passed on to the network layer.
* dem_set = Sets sequence numbers for the net channel at demo startup.
MVD:
- The demo is only uses 30 fps and is then interpolated on playback.
- The timestamp is saved as a byte containing the number of miliseconds since the last demo packet.
- MVDs do not contain any dem_cmd commands.
- MVDs contains their own specific command types:
* dem_multiple = Send a packet to more than one player. A 32-bit bit mask is sent with this, 32-bits indicating which of the 32 players that should receive it.
* dem_stats = Stats for a player has changed.
* dem_single = Send a message to a specific player. Both this and dem_stats contains an integer specifying which player should get the packet.
* dem_all = Send the packet to all players.
- The messages above are only used to specify who should get a message, after that you read the actual message like in the dem_read case.