pnxenopoulos / awpy

Python library to parse, analyze and visualize Counter-Strike 2 data
http://www.awpycs.com
MIT License
361 stars 56 forks source link

Player box scores #315

Open pnxenopoulos opened 4 months ago

pnxenopoulos commented 4 months ago

It would be nice to have a function to create a player's "box score". I think this would look something like

name | steam_id | kills | assists | flash_assists | deaths | headshots | total_damage | triple_kills | quad_kills | aces

we could also include side and rounds_played that could be nice. The box score could then be used to calculate ADR, etc. later on

hojlund123 commented 3 months ago

parser = DemoParser("heroic-vs-imperial-mirage.dem")
max_tick = parser.parse_event("round_end")["tick"].max()

wanted_fields = ["kills_total", "deaths_total", "mvps", "headshot_kills_total", "ace_rounds_total", "4k_rounds_total", "3k_rounds_total"]
df = parser.parse_ticks(wanted_fields, ticks=[max_tick])
print(df)

   kills_total  deaths_total  headshot_kills_total  ace_rounds_total  \
0           24            19                    17                 0   
1           30            21                    12                 0   
2           21            20                     9                 0   
3           16            22                     7                 0   
4           10            19                     4                 0   
5           20            17                     2                 0   
6           22            20                    12                 0   
7           19            22                     7                 0   
8           19            20                    12                 0   
9           15            16                     8                 0   

   4k_rounds_total  3k_rounds_total  mvps    tick            steamid      name  
0                1                1     4  261772  76561198053126645     NertZ  
1                1                2     4  261772  76561198307171910   decenty  
2                0                2     2  261772  76561197983031494     felps  
3                0                0     2  261772  76561198800209567     noway  
4                0                2     2  261772  76561197996370184      VINI  
5                0                0     4  261772  76561198018027263      HEN1  
6                0                0     4  261772  76561198160709585    sjuush  
7                0                0     2  261772  76561198073117127  nicoodoz  
8                1                0     2  261772  76561197996678278     TeSeS  
9                0                1     4  261772  76561198057282432    kyxsan
`
pnxenopoulos commented 3 months ago

@hojlund123 I think it's a good start. Could also craft our own tabulating by side (t, ct, total). I'm leaning for the latter, since that is how HLTV seems to delineate (plus we can add ADR, KAST, Rating). What do you think?

researchersec commented 3 months ago

@hojlund123 I think it's a good start. Could also craft our own tabulating by side (t, ct, total). I'm leaning for the latter, since that is how HLTV seems to delineate (plus we can add ADR, KAST, Rating). What do you think?

Love this idea! Didnt see your work in analytics/adr Looks awesome!