This program aims to decode replay files and convert them into more accessible formats such as an image or json files. Which may be uses in other programs. The alternative project wotreplay-viewer implements a small HTML5 viewer for the JSON data.
When using the json output option, the replay is decoded into a list of packets, in the same way it is described in the replay file. The following information can be extracted from from the replay.
- Position
- Health
- Tanks being tracked
- Tanks getting shot or killed
- Hull Orientation
- Messages
Displays a summary of the battle on a map, green lines are your own team, red lines the enemy team, and blue is the recording player.
Displays a heatmap of the positions of the tanks in the battle (for both teams combined)
Displays a heatmap of the positions of the tanks in the battle (colored by team)
Displays a heatmap of the positions of the tanks in the battle (colored by team), with some smoothing applied.
Displays a heatmap of the positions following user defined classes.
- OpenSSL
- Boost (Complete)
- LibPNG
- LibXML2
- libjson-cpp (included in the source, from http://jsoncpp.sourceforge.net/)
- Intel Threading Building Blocks (Optional)
- GCC (>= 4.7)
- CLANG
git clone https://github.com/evido/wotreplay-parser.git
cmake .
make
You may need to specify the include directory for LibXML2 using the CMAKE variable INCLUDE_DIRECTORIES. This can be done as following.
cmake -DINCLUDE_DIRECTORIES="/usr/include/libxml2" .
To use this software you need some data extracted from World of Tanks, this data contains some elements to draw the mini map, the actual minimaps and the arena definitions. I have prepared an archive which is available here. This should be available in the root
folder (see next paragraph).
The program can be used to convert wotreplay files to images or json files.
wotreplay-parser --parse --root <working directory> --type <output type> --input <input file> --output <output file>
output type
can be png, json, team-heatmap, heatmap and class-heatmap it is possible to specify multiple types (e.g. png,json), when using multiple types the output file specification will be appended with a suffix (.png, .json and _heatmap.png)output
is optional, the program will then write to stdoutinput
andoutput
are relative to rootroot
should contain a folder maps with the images to maps and the arena definitions
The program can be used to create heatmaps for a directory of replays
wotreplay-parser --parse --root <working directory> --type heatmap --input <input directory> --output <output directory>
input directory
is the directory containing all the replays (relative to root, only first level will be scanned)output directory
images will be written to this directory, for each map / game mode an output file will be generated (relative to root)root
should contain a folder maps with the images to maps and the arena definitionssize
specifies the output dimensions of the generated image (for image output types)rules
specify drawing rules to be used for output type class-heatmap (surround the argument with quotes to avoid the program interpreting it as seperate arguments)
The program can also be used to create all the minimaps for usage in wotreplay-viewer.
wotreplay-parser --create-minimaps --root <working directory> --output <output directory>
root
the working directory containing the necessary dataoutput
the output directory relative to the root directory
The syntax of drawing rules is as follows (EBNF syntax)
rules = rule *(';' rule)
rule = color ':=' expression
expression = operation *(logical_operator operation)
operation = operand comparison operand
operand = symbol | value
logical_operator = 'and' | 'or'
comparison = '=' | '!=' | '>' | '<' | '>=' | '<='
color = '#' hex{6}
symbol = 'player' | 'clock' | 'team' | 'tank_name' | 'tank_country' | 'tank_tier' | 'tank_icon' | 'tank_class'
value = ''' +(digit | alpha | '_' | '-' ) '''
Each packet is evaluated using the defined rules and assigned a class (first match), which will be used in the resulting heatmap.
This packet is related to the spotting of tanks, it will occurr together with packet type 0x05 when the tank appears for the user (each time).
type
: the type of the packetclock
: the timestamp of the packet
See packet type 0x03
This packet seems to be a health update which is sent relatively frequently, it only contains the following properties.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the health updatesub_type
: the sub-type of the packethealth
: the health of the referenced player
This packet seems to be sent when a player's tracks are repaired, it also indicates which track is still destroyed.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the track statussub_type
: the sub-type of the packetdestroyed_track_id
: the id of the track that is still destroyed, possible values here are 0x00 (tank is not tracked), 0x1D (left track) and 0x1E (right track)
This packet indicates a player doing damage to another player and will most likely be accompanied by another packet indicating the type of damage such as Sub Type 0x05
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the track statussub_type
: the sub-type of the packetsource
: player causing the damagehealth
: new health of the player
This packet indicates that a player was shot by another player. When this is not accompanied by a damage packet, the player bounced the shell.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the track statussub_type
: the sub-type of the packetsource
: source of the shell
Most likely the indicator of a module being damaged.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: nonsense?sub_type
: the sub-type of the packetsource
: player dealing damage to the modueltarget
: player receiving the damage
Indicator that a shot was fired by a player.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the track statussub_type
: the sub-type of the packet
Unclear.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the track statussub_type
: the sub-type of the packettarget
: player receiving the damage
This is the most frequent type of packet, it tells the player about the positions of any other player.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the track statusposition
: the sub-type of the packethull_orientation
: the sub-type of the packet
This packet contains a message sent to the battlelog during the game. The owner information is encoded inside the message.
<font color='#DA0400'>SmurfingBird[RDDTX] (VK 36.01 H) : </font><font color='#FFFFFF'>so far so good</font>
type
: the type of the packetclock
: the timestamp of the packetmessage
: a html encoded message
This packet indicates that a player's tank was tracked.
type
: the type of the packetclock
: the timestamp of the packetplayer_id
: the subject of the track statussub_type
: the sub-type of the packetalt_track_state
: indicates if the tank is tracked using values 0xF0 (not tracked) or 0xF6 (tracked)destroyed_track_id
: the id of the track that was destroyed destroyed, possible values are 0x1D (left track is destroyed) and 0x1E (right track is destroyed).
All code is licensed under the permissive BSD license.