Originally this was made on Dragon's request for IFL, but also releasing it here since it took me a good while to copypaste the packet parser from Zandronum.
While not being as fancy and user-oriented as A3's one, this script is intended to be used by someone who runs a tournament, not just random players.
The script works by reading the .cld file and pulling the required info either directly from game events or from announcer messages (lol).
It potentially supports multiple different versions at the same time, so even though currently only 2.1.2 is supported, once 3.0 comes out it probably will be supported as well.
GitHub link: https://github.com/jewalky/demostats
Download link: https://github.com/jewalky/demostats/archive/master.zip
Note that to run the script, PYTHON 3 is required.
Afterwards, you run the script by following command line (assuming you got Python in your PATH during installation):
Code: Select all
python demostats.py <demo file.cld>
- --verbose: Display connect/disconnect/team switch/spectate messages, as well as ingame chat and flag related events (drop, pickup, etc) and player frags.
- --verboseflags: Display only the flag relevant info (flag taken, flag dropped, flag returned, flag picked up, flag returned automatically). This can be used to debug incorrect stats.
- --ordering=column1,column2,column3,...: Specify which stat columns to display. For example --ordering=TEAM,CAP,FRG will only display team, captures and frags.
Once it works, it should output something similar to this after each map switch:
(full output, also the asterisk before a player signifies console player, i.e. the one who recorded the demo)
Currently supported stats:
- TEAM: Player's team obviously
- CAP: Captures (total, including pickup captures)
- TCH: Initial touches (including those that end with captures, excluding pickups)
- PCAP: Pickup captures only
- PKP: Pickup touches
- FRG: Frags (total, including suicides)
- DTH: Deaths (total, including suicides)
- AST: Assists (including self-assists)
- DEF: Defenses (killing enemy runner with your flag)
- RET: Returns
P.S. yea I'm very bad at CTF the stats prove that. Also edd should return the flag more.
P.P.S. the script itself is also modular, which means someone who's familiar with Python can use demo.py as generic library for demo parsing (as it reads CLD and outputs parsed packets to user-specified callback). Just saying.