World of Tanks Battle Results Parser
DOCS Work in Progress
This project aims to parse World of Tanks battle results from two sources:
.datfiles from World of Tanks cache folder (Currently outdated).wotreplayfiles from the game directory
Currently I am making major changes to this repo and is therefore a work in progress
Wot Replay Parser
A .wotreplay file contains two sections:
- JSON section: contains the information used when showing battle results
- Binary section: contains the information used when playing the replay with Wot client
This project can parse both sections. However, most of the code if focused on trying to extract useful information from the Binary section.
Supported Versions of World of Tanks
Datfile Parser
1.15.0-1.17.0
Backwards compatibility is not guaranteed for the Datfile parser. This is not very important anyway since these files don't persist indefintely like .wotreplay files do.
Replay Parser
0.9.13-1.18.1
One of the big goals of this project is to parse as many replay versions as possible. However, as this project is still a work in progress, the kind of information that you can get from each replay differs based on the replay version.
For example, the Position information of each tank have barely changed over
the years and therefore will probably work with all replays from 0.9.13 to today whereas something like OnStaticCollision (a tank colliding with a fence for ex.) has changed quite frequently and require more inspection. While this is not easy to do,
the great thing is that there is a mechanism in place (see here) that let's us quickly make the necessary changes to support more versions.
Example Usage
Replay Parser
Currently this project is only available as Rust library. Perhaps in the future, we can provide Python bindings. To use it, add the following to the [dependencies] section of Cargo.toml
wot_replay_parser = "0.2.1"
Example 1: Print out JSON portion of the replay
use ReplayParser;
Example 2: Print out the binary section of the replay in the form of packets
The binary section of the replay can be separated into "packets". Each packet has some metadata information and then the payload. This is useful if you are developing another projects that needs the packet abstraction.
I used this to create https://dacite.github.io/wot-packet-analyzer. This is a GUI for analyzing packets and finding out what they mean. Useful as a development tool.
use ReplayParser;
Example 3: Print out the events of the replay
This is where most of the work is left to do. Events is an abstraction over packets. i.e it shows the actual
data that is present in a packet. Some events such as Position,AvatarCreate works really well as of today.
See BattleEvent to see what kind
of events are supported. Not that this doesn't mean it will work in all replays
use ;
See the docs.rs link for more thorough documentation: https://docs.rs/wot_replay_parser/latest/wot_replay_parser
Projects that use this library:
- Wot Packet Analyzer: https://dacite.github.io/wot-packet-analyzer
- An analyzer for packets in a
.wotreplayfiles. Useful for development - Uses
wot_replay_parserlibrary
- An analyzer for packets in a
Backwards Compatibility
Datfile parser
Backwards compatibility is not guaranteed for the Datfile parser. This is not very important anyway since these files don't persist indefintely like .wotreplay files do.
Credits
- https://github.com/Monstrofil/replays_unpack
- Everything on
.deffiles comes from here
- Everything on
- https://github.com/lkolbly/wows-replays
- https://github.com/StranikS-Scan/WorldOfTanks-Decompiled
- Makes it really easy to track changes in updates!
- https://github.com/Phalynx/WoT-Replay-To-JSON
- https://github.com/evido/wotreplay-parser
- Contributors to vbAddict Wiki
- http://forum.worldoftanks.eu/index.php?/topic/185348-11011-wot-replay-analyzer-wip-1-08112020/