When you decrypt and unpack a replay file's extra data (all the stuff past the first blocks), you will be able to parse this as a data stream. The data stream contains what appears to be a direct copy of the data sent to your game client from the WoT server when you are in a match, and can be used to reconstruct the battle result, as well as dumping out the data in a format that can be used to create, say, battle simulators.
These terms are used throughout this documentation.
- Packet: A single packet of data
- Payload: A packets' optional payload of data
- Clock: This is a timer value indicating the number of milliseconds (or even higher resolution) since the match was started; this does not add up to an even 15 or 10 minutes but includes such time as the 30 second countdown as well as any extra waiting-for-players time.
- long: My oldfashioned way of saying "uint32"
- uint32: An unsigned 32 bit integer (4 bytes long)
- short: My oldfashioned way of saying "uint16"
- uint16: An unsigned 16 bit integer (2 bytes long)
- byte: My oldfashioned way of saying "uint8"
- uint8: An unsigned 8 bit integer (1 byte long)
- float: A floating point number (4 bytes long)
Most data packets can contain structured data, most obvious in this case is that a lot of packets contain Python pickled data. You'll have to look for an appropriate unpickler for your favorite language to get the most out of this.
Strings are encoded in Pascal (or Java) format; a leading length indicator followed by the string itself. The length is usually a long, but can sometimes be a short or even a byte, depending on the packet in question.
Generic Packet Layout
Every packet is laid out as follows:
+--------+--------+-------+--------------+ | uint32 | uint32 | float | variable ... | +---------------------------------------+ | | | | | | | `-- optional payload | | `-- clock | `-- packet type `-- payload size
The payload size can be 0, which means there is no additional payload. The minimum packet size therefore is 12 bytes.
The payload varies significantly between packets, but the following have been found to be in predictable positions:
- player/vehicle id: offset 0, type uint32
- subtype: offset 4, type uint32
- data length: offset 8, type uint32
Depending on the packet type, the subtype may contain an additional indication what it's used for. The data length will be the number of bytes starting at offset 12 that should be treated as the included data. This data can either be a packed format, or a Python pickle.
- 0x00 - Battle level setup
- 0x03 - Tank appeared
- 0x05 - Tank appeared
- 0x07 - Various tank related updates
- 0x08 - Various game state updates
- 0x0A - Vehicle position and rotation updates
- 0x12 - Game status
- 0x16 - Recticle informations (position and ?)
- 0x18 - The first packet you will see, and only see once
- 0x19 - Possibly player camera angle (y)
- 0x1B - Possibly player camera angle (z)
- 0x1E - Main player id
- 0x1F - Chat message
- 0x21 - Minimap click
- 0x22 - Main player specific data
- 0x26 - Main player specific data
- 0xffffffff - The last packet you will see, indicates the end of stream