CTF stats script for tournaments

Plan tournaments and matches, and initiate challenges here. Prove your inner internet tough guy.
Post Reply
User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

CTF stats script for tournaments

#1

Post by ZZYZX » Thu Feb 25, 2016 7:39 pm

subj.


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>
Currently some additional command-line arguments are supported as well:
  • --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:
Image
(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.
Last edited by ZZYZX on Fri Mar 18, 2016 1:36 pm, edited 5 times in total.

User avatar
Kara Kurt
Frequent Poster Miles card holder
Posts: 887
Joined: Sat Oct 12, 2013 6:58 pm
Location: Strasbourg, France
Contact:

RE: CTF stats script for tournaments

#2

Post by Kara Kurt » Thu Feb 25, 2016 8:06 pm

You should've released it years ago already.

User avatar
Ivan
Addicted to Zandronum
Posts: 2219
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: CTF stats script for tournaments

#3

Post by Ivan » Thu Feb 25, 2016 11:24 pm

GG Meanwhile mobius still records stats in excel XD
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Mobius
Banned
Posts: 815
Joined: Wed Jun 13, 2012 3:43 am
Location: The center of the A3's controversial and machiavellian conspiracy
Clan: Cube
Clan Tag: Aᵌ
Contact:
Banned: Permanently

RE: CTF stats script for tournaments

#4

Post by Mobius » Thu Feb 25, 2016 11:26 pm

Ivan wrote: GG Meanwhile mobius still records stats in excel XD
Retard alert. The stats are recorded using powershell and then documented into excel, but the output file from the console is in a text file first. I'm still waiting for that MYSQL stat recorder from you that you so said was going to happen.
dewsome: i can do this all day
dewsome: do you think you're somehow special? i spent years arguing with nostar, jenova, mobius
<+Thomas13> Mobius u r inferior, go outside and get beaten up
Alfonzo ~ "I wonder who will hear him trash talk when the dirt closes over him?"

User avatar
Ivan
Addicted to Zandronum
Posts: 2219
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: CTF stats script for tournaments

#5

Post by Ivan » Fri Feb 26, 2016 7:53 am

Mobius wrote:
Ivan wrote: GG Meanwhile mobius still records stats in excel XD
Retard alert. The stats are recorded using powershell and then documented into excel, but the output file from the console is in a text file first. I'm still waiting for that MYSQL stat recorder from you that you so said was going to happen.
And you shall get it. When did I ever disappoint?

PS: My mom says I'm really smart, so you might want to back off on that retard statement.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Shane
Forum Regular
Posts: 411
Joined: Mon Jun 25, 2012 8:37 pm
Location: Filthy Euro
Clan: Renegades
Clan Tag: [R]

RE: CTF stats script for tournaments

#6

Post by Shane » Fri Feb 26, 2016 9:55 am

thank god I needed more numbers in order to brag
Image

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

Re: CTF stats script for tournaments

#7

Post by ZZYZX » Fri Mar 18, 2016 1:34 pm

Updated the script, people quitting during intermission were handled incorrectly (yes Ide, talking about you, shitty ragequitter!)
Also added some command line args to control output. Details are in the first post.

User avatar
IdeIdoom
Zandrone
Posts: 1112
Joined: Mon Jun 04, 2012 6:19 am
Location: Meldola, Italy
Contact:

Re: CTF stats script for tournaments

#8

Post by IdeIdoom » Fri Mar 18, 2016 6:18 pm

ZZYZX wrote:Updated the script, people quitting during intermission were handled incorrectly (yes Ide, talking about you, shitty ragequitter!)
I love how you blame it on me when anyone could have done it before me. Only when I did it, you bitch about it.
THE ROMANIAN POWERImage

Code: Select all

<+Dastan>	edd
<+Dastan>	boxxy skin when
<+Shift>	dastan you really want to fap at it this much and now you are going crazy and shredding your hair into a million tiny pieces for this boxxy skin to come out that way you can cum out
<+Dastan>	Shift, yes
--------------------------------------------------------------------
21:53:26  <@Estar>	well, if i'd be a girl, i would say ideidoom has ok looks

Post Reply