Giter Club home page Giter Club logo

awpy's Introduction

Hey there! ๐Ÿ‘‹

Peter Xenopoulos Website Peter Xenopoulos Twitter Peter Xenopoulos LinkedIn Peter Xenopoulos Google Scholar

I'm Peter Xenopoulos. I'm a research scientist at NVIDIA, focusing on developing machine learning and visual analytics solutions for esports & sports. Previously, I led quantitative research for a sports betting exchange, worked with a professional baseball team (Phillies), analyzed companies for a top seed-stage venture capital fund (Tuesday VC), created data and modeling pipelines for an athlete investment fund (Big League Advance), and worked on the AI data science team at Facebook. I maintain the following projects:

  • ๐Ÿ‘ฉโ€๐Ÿ’ป awpy, a library to parse, analyze and visualize Counter-Strike demofiles. The project has spawned published papers in IEEE Big Data, ACM's WWW conference, and IJCAI.
  • ๐Ÿ’พ ESTA, a large esports dataset, which contains 8.6m player actions, 7.9m game frames and 417k player trajectories from 1.5k professional CSGO matches.
  • ๐Ÿ“ˆ PyCalibrate, a visual analytics tool to analyze model calibration. This work was accepted to IEEE VIS 2022.
  • ๐Ÿ’ก GALE, a technique to measure the similarity between sets of local explanations developed in collaboration with Capital One. Accepted for a spotlight talk at the TAGML workshop at ICML 2022.

awpy's People

Contributors

adisujithkumar avatar arjun-22 avatar bahtman avatar dependabot[bot] avatar emteka avatar fmestre96 avatar guidopetri avatar hojlund123 avatar janericnitschke avatar pnxenopoulos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awpy's Issues

de_ancient analysis

One highlight project could be a quantitative analysis of de_ancient. First, I need to assemble a dataset of performances on the map, which we can also host somewhere. Then, we will parse each demo and create a large CSV (or collection of CSVs) and report things like best/worst performances, heatmaps of kills, flashes and grenades, weapon fires, analysis of post-plant scenarios.

Add map data

Add map data like scale, startX, startY, z cutoff, etc.

Parsing fails if the game gets surrendered after 5 rounds

It looks like parsing fails if the match gets surrendered after five rounds. I've seen only 5-0 and 4-1 score lines, so maybe it's specific to only these scores. Error is an out of range error at parse_demo.go, L1759.
I added four of these demos here again.

Error:

panic: runtime error: index out of range [4] with length 4

goroutine 1 [running]:
main.main()
/home/csgo/parser/parse_demo.go:1759 +0x4030
exit status 2

Add map info

Can/should add a dataframe/json containing info on the parsed nav files. Shouldn't be too big and can enable easier analysis and visualization.

Error converting json to df when round has no Flashes

This is my first issue report on github, please excuse mistakes that I make in the reporting style.
Describe the bug
The DemoParser.parse() with return_type='df' throughs a TypeError: 'NoneType' object is not iterable.
This seems to happen when there are no flash events in a round.
To Reproduce
The problem occurs e.g. with the following demo: https://www.hltv.org/download/demo/61730, in particular the second map. But I think it occurs more generally with any demo that does contain any rounds where no Flashes are used.
Steps to reproduce the behavior:

  1. Download the demofile (https://www.hltv.org/download/demo/61730) from hltv.
  2. initialize DemoParser
  3. Run parse(return_type='df') on the demoparser
  4. See error

Expected behavior
Produce the regular DataFrame for flashes.

Desktop (please complete the following information):

  • OS: macOS 10.15.7
  • Browser: Brave
  • Version: 1.18.70

Additional context
I think the issue is simply that there is no condition for rounds without flashes. Should be possible to fix by adding in a condition for when r['Flashes'] is not None like there already is one for BombEvents.

Negative Seconds

Describe the bug
A clear and concise description of what the bug is.

Frame with negative seconds
https://www.hltv.org/matches/2349707/ldlc-vs-complexity-iem-cologne-2021-play-in
RoundNum: 0
Frame Second: -2581.6771653543306

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

No negative seconds? Certainly no -2000 seconds

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Missing frames from _parse_player_frames

I noticed that in the demo I parsed that after calling _parse_player_frames there are rounds with only player frames from one team, missing the other team completely.
Rounds 1-18 are fine and have both teams, round 19 only got the first few frames for both teams and missing the whole CT side after that.
All other rounds after that until the game ends (rounds 20-22) are missing the whole CT side frames as well.

I can provide the demo if needed. As return_type I used "list" and parsed with parse_rate=1.
I checked the json file and it looks like the information is correctly parsed there.

de_mocha demos fail to parse

It looks like Mocha demos are still failing to parse. Same error like #26 at parse_demo.go, L1735.
So maybe something went wrong when adding the nav file for Mocha, because it worked for Cache, Ancient and Grind - these demos are getting parsed fine now.
This is not the same error as #27, Mocha is a normal 5v5 defusal map.
I added three de_mocha demos here (the .bz2 zipped demos).

Error:

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.main()
/home/csgo/parser/parse_demo.go:1735 +0x4085
exit status 2

Grenade throw team name is null at end of games

Team name can be null at the end of games. Seen in grenades, might occur in other actions, like kills.

One possibility is to loop through kills and grenades and so on and see if the team info is missing. If it is, we can use the data from that round's frames to determine a player's team.

Unable to parse demos

I cloned the latest version of the repo and ran the install. I then tried to open a jupyter notebook file and parse a demo but whenever I do so I get this error.

Command I am running:

from csgo.parser import DemoParser

# Create parser object
# Set log=True above if you want to produce a logfile for the parser
demo_parser = DemoParser(demofile = "og-vs-natus-vincere-m1-dust2.dem", demo_id = "OG-NaVi-BLAST2020", parse_rate=128)


# Parse the demofile, output results to dictionary
data = demo_parser.parse()
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-1-7eb1ec812df7> in <module>
      7 
      8 # Parse the demofile, output results to dictionary
----> 9 data = demo_parser.parse()

~\desk\CS_DEMOS\parser\csgo\csgo\parser\demoparser.py in parse(self, return_type)
    146             A dictionary of output
    147         """
--> 148         self._parse_demo()
    149         self._read_json()
    150         if self.json:

~\desk\CS_DEMOS\parser\csgo\csgo\parser\demoparser.py in _parse_demo(self)
    115         stdout = proc.stdout.read().splitlines()
    116         output = [event.decode("utf-8") for event in stdout]
--> 117         self.output_file = output[0]
    118         if os.path.isfile(self.output_file):
    119             self.logger.info("Wrote demo parse output to " + self.output_file)

IndexError: list index out of range

I know this is a similar issue to what another person raised but in his case the log files at least listed something. These are my logs with the last message indicator being that it is looking for a demo file.

Go version>=1.14.0
18:56:00 [INFO] Go version>=1.14.0
Initialized CSGODemoParser with demofile C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem
18:56:00 [INFO] Initialized CSGODemoParser with demofile C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem
Setting demo id to OG-NaVi-BLAST2020
18:56:00 [INFO] Setting demo id to OG-NaVi-BLAST2020
Setting parse rate to 128
18:56:00 [INFO] Setting parse rate to 128
Running Golang parser from C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\csgo\parser\
18:56:00 [INFO] Running Golang parser from C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\csgo\parser\
Looking for file at C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem
18:56:00 [INFO] Looking for file at C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem
Go version>=1.14.0
18:58:07 [INFO] Go version>=1.14.0
Initialized CSGODemoParser with demofile C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\natus-vincere-vs-astralis-m1-dust2.dem
18:58:07 [INFO] Initialized CSGODemoParser with demofile C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\natus-vincere-vs-astralis-m1-dust2.dem
Setting demo id to na-vi-astralis
18:58:07 [INFO] Setting demo id to na-vi-astralis
Setting parse rate to 64
18:58:07 [INFO] Setting parse rate to 64
Running Golang parser from C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\csgo\parser\
18:58:07 [INFO] Running Golang parser from C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\csgo\parser\
Looking for file at C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\natus-vincere-vs-astralis-m1-dust2.dem
18:58:07 [INFO] Looking for file at C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\natus-vincere-vs-astralis-m1-dust2.dem
Go version>=1.14.0
18:58:08 [INFO] Go version>=1.14.0
Initialized CSGODemoParser with demofile C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem
18:58:08 [INFO] Initialized CSGODemoParser with demofile C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem
Setting demo id to OG-NaVi-BLAST2020
18:58:08 [INFO] Setting demo id to OG-NaVi-BLAST2020
Setting parse rate to 128
18:58:08 [INFO] Setting parse rate to 128
Running Golang parser from C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\csgo\parser\
18:58:08 [INFO] Running Golang parser from C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\csgo\parser\
Looking for file at C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem
18:58:08 [INFO] Looking for file at C:\Users\nikhi\desk\CS_DEMOS\parser\csgo\og-vs-natus-vincere-m1-dust2.dem

Go + Python version:
go version go1.16.2 windows/386
Python 3.8.4

The environment I'm working in is local jupyter notebooks. I have even tried running the example notebooks you ship with the repo along with the specific demo that you test with and I am getting the same error. Any ideas?

Old Demos not parseable

Describe the bug
Old Demos are not parseable

To Reproduce
Steps to reproduce the behavior:
Download HLTV demo: https://www.hltv.org/matches/2343604/big-vs-ago-esl-pro-league-season-12-europe
Run the following python script

    from csgo.parser import DemoParser
    f = "big-vs-ago-m2-dust2.dem"
    output_file = f.replace("-","_").replace(".dem","_01")
    print(output_file)
    demo_parser = DemoParser(demofile=f, demo_id=output_file, parse_rate=128)
    data = demo_parser.parse()

Expected behavior
A clear and concise description of what you expected to happen.

Parsed Demo

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Trying to backfill old demos under the v1 parser

2D web-based playback

This could be an interesting feature to include either in the library, or even as a standalone project. There are plenty of 2D players out there, but this could be open-source and free. I imagine a user could upload a demo and it be parsed by the csgo library.

JSON pretty print after using clean_rounds method

Is your feature request related to a problem? Please describe.
Not at all. With the new method clean_rounds the json is not pretty print, there are no indentation anymore.

Describe the solution you'd like
Fix json.dump(self.json, fp) in demoparser.py's write_json method to something like json.dumps(simplejson.loads(output), indent=4)

Describe alternatives you've considered
Format with manual (and pretty easy) action

Additional context
N/A

Accuracy of cleaning the rounds?

Hello, great work so far (Output is nice and clean!), just a quick question regarding the "post-processing" of the rounds. How accurate is the cleaning and then re-ordering of the rounds? I've been working with the go parser and was actually thinking about implementing something similar but was going to use the ScoreUpdated event as one of the central events. Have you run across any demos that when you clean them they spit out incorrect round order/kills etc? This question is mainly focused around demos from HLTV. Thanks.

Add support for maps without 2 bombsites

First identified in #26. Parsing fails on maps that don't have two bombsites (i.e., standard competitive maps). Could be useful for parsing MM demos from mocha, grind, office, etc.

Add player demo summary statistics

We should add player summary statistics, like total kills, deaths, assists, etc., maybe even broken down by side. Basically the tab scoreboard. We can either do this in Golang or Python.

Parse item purchases per round?

Is your feature request related to a problem? Please describe.
Not really, this is just something that I think would be really helpful.

Describe the solution you'd like
The default output the parse in JSON format is really great, but one big thing I think would be really useful is identify all of the weapons and equipment purchased by person, per round. I like seeing how much money a team starts with, how much they spend, and what the "buy type" situation is, but it would be really nice to specifically know what setup each player has so any analysis can control for that.

Describe alternatives you've considered
I could certainly build out an algorithm to infer weapons (using money spent, buy type, and the weapons used to accrue kills), but it's going to be inherently imperfect. If the player never gets a kill, we don't know what weapon they used, and what happens if the player picks up a weapon off of the ground?

Boosting lobbies break the parser

It looks like boosting lobby demos break the parsing process:

03:35:17 [INFO] Go version>=1.14.0
03:35:17 [INFO] Initialized CSGODemoParser with demofile /home/demos/003489108305295442237_1068538509.dem
03:35:17 [INFO] Setting demo id to 003489108305295442237_1068538509
03:35:17 [WARNING] A parse rate of 1 will parse EVERY tick. This process will be very slow.
03:35:17 [INFO] Setting parse rate to 1
03:35:17 [INFO] Running Golang parser from /home_remote/docker_home/python/lib/python3.9/site-packages/csgo-0.1-py3.9.egg/csgo/parser/
03:35:17 [INFO] Looking for file at /home/demos/003489108305295442237_1068538509.dem
03:35:19 [ERROR] No file produced, error in calling Golang
03:35:19 [ERROR] []
03:35:19 [INFO] Reading in JSON from 003489108305295442237_1068538509.json

FileNotFoundError: [Errno 2] No such file or directory: '/home/003489108305295442237_1068538509.json'

The demo is available for another 4 days here:

http://replay182.valve.net/730/003489108305295442237_1068538509.dem.bz2

Expand stats tests

Need to rewrite stats tests. To use the default.dem demo file used in the parsing tests. First step would be to watch the demo, then see what the stats return.

Around 12-13% of demos fail to parse

Out of the 582 matchmaking demos I tried to parse, 74 failed to produce a json file.
There might be a few demos that fail because of #24, but the majority are just normal demo files. When checking out the failing demos sporadically, I noticed a lot of draws, but also other results.

I added four demo files which fail to parse here. Could provide more.

Log=True doesn't help much, it just says "No file produced, error in calling Golang"

Allow parse_rate=0

It should be possible to parse every single tick in a demo file. Useful for analysis of aiming behavior etc

Expand visualization capabilities

We should add basic static visualization capabilities, including:

  • Heatmap of events on a map (for example, grenades, deaths, damage events, positions).

  • heatmap by discrete location. Similar to the ones by Leetify, like: image

  • function to show one specific frame of a game. Can/should include information like player direction (using a little tick mark), jumping/standing (size of circle or border around it), weapon/inv (icons?), hp/armor (maybe how filled a circle is, border around for armor)

  • radar chart for common match metrics (ADR/KDR/KAST%/Accuracy%/Utility)

  • Some sort of line-based/trajectory chart to plot nades, death-kill combos. A lot of data in CSGO has a start/end location. Plotting the trajectory in some way, statically, for multiple events would be useful.

  • gif generator for trajectories

Python 3.7 needed for installation

When installing the library, I needed to upgrade Python from 3.6.9 to 3.7 or higher, contrary to the specifications in the README.md

The module that needed 3.7 was matplotlib if I remember correctly.

OS: Ubuntu 18.04

Expand test cases and create extensible testing framework

One of the main problems is that code development has gone on for too long without tests. Whenever we make an update, it takes many steps to debug problems. Going forward, it would be good to have a demo/a few demofiles we know deeply to test the parsing capabilities. Even just tests that check for basic things like making sure things don't have counts of 0, aren't all one value, and so on, can help greatly.

I run the current tests through Google Cloud Build. Right now, I have it set up so that when the build compiles, the tests download a few demofiles to parse and check the results. We should be testing the values of the following:

Round:

  • Total Rounds
  • Round end sequence

Player:

  • Kills, Assists, Deaths
  • KAST%
  • ADR
  • Accuracy%

Other:

  • First kills
  • Trades

We can consider things like total counts first and foremost.

We can try to run the tests with Github Actions.

Frameparser does not work with files in different directory

Running FrameParser.parse() on a file that is in a different directory than the one that the python interpreter is in makes it fail. I believe it's due to this line:

https://github.com/pnxenopoulos/csgo/blob/6097857e9bbbbc10a0f680bc9827a71d9984f609/csgo/parser/frameparser.py#L79

e.g. if demofile is /home/user/Desktop/my_demo_file.dem and the python interpreter is in /home/user/Git/csgo-stuff it will actually try to read from /home/user/Git/csgo-stuff//home/user/Desktop/my_demo_file.dem.

The specific error I get is:

Traceback (most recent call last):

  File "/home/user/.local/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-2-f238148dad71>", line 1, in <module>
    parser.parse()

  File "/home/user/.local/lib/python3.6/site-packages/csgo-0.1-py3.6.egg/csgo/parser/frameparser.py", line 120, in parse
    self._clean_xml()

  File "/home/user/.local/lib/python3.6/site-packages/csgo-0.1-py3.6.egg/csgo/parser/frameparser.py", line 96, in _clean_xml
    tree = ET.parse(self.match_id + ".xml")

  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1196, in parse
    tree.parse(source, parser)

  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 597, in parse
    self._root = parser._parse_whole(source)

  File "<string>", line unknown
ParseError: syntax error: line 1, column 0

Error when parsing some demos

An error occurs when parsing the demo from https://www.hltv.org/matches/2346594/secret-club-vs-triumph-esea-winter-cash-cup-5-north-america. The error occurs only for secret-club-vs-triumph-m2-inferno.dem demo.

Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1477, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Volumes/GREY/code/csgo/parse_csgo.py", line 19, in <module>
    main()
  File "/Volumes/GREY/code/csgo/parse_csgo.py", line 14, in main
    data = demo_parser._parse_demo()
  File "/Volumes/GREY/code/csgo/csgo/parser/demoparser.py", line 117, in _parse_demo
    self.output_file = output[0]
IndexError: list index out of range

The parser log contains the following entries:

INFO: 2021/02/24 11:52:36 parse_demo.go:631: Started demoparser
INFO: 2021/02/24 11:52:36 parse_demo.go:655: Parsed arguments, reading in /Volumes/GREY/code/csgo/data/secret-club-vs-triumph-m2-inferno.dem and a parse rate of 8 
INFO: 2021/02/24 11:52:36 parse_demo.go:677: Parsed demo header and mesh for map de_inferno 
INFO: 2021/02/24 11:52:36 parse_demo.go:710: Demo is of type GOTV Demo with tickrate 128 
INFO: 2021/02/24 11:52:36 parse_demo.go:711: Demo name is secret-club-vs-triumph-m2-inferno from /Volumes/GREY/code/csgo/data/secret-club-vs-triumph-m2-inferno.dem
INFO: 2021/02/24 11:52:36 parse_demo.go:712: Registering event handlers, parsing demo
ERROR: 2021/02/24 11:52:43 parse_demo.go:1700: DEMO STREAM ERROR
WARNING: 2021/02/24 11:52:43 parse_demo.go:1701: Demo stream errors can still write output, check for JSON file
ERROR: 2021/02/24 11:52:43 parse_demo.go:1702: runtime error: index out of range [-1]
stacktrace:
goroutine 6 [running]:
runtime/debug.Stack(0x203000, 0x203000, 0x1f149f0)
	/usr/local/Cellar/go/1.15.8/libexec/src/runtime/debug/stack.go:24 +0x9f
github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs.NewParserWithConfig.func1(0x14be200, 0xc0028073e0)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/[email protected]/pkg/demoinfocs/parser.go:316 +0x2f
github.com/markus-wa/godispatch.(*Dispatcher).dispatchWithRecover.func1(0xc00005e2a0)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:190 +0x6b
panic(0x14be200, 0xc0028073e0)
	/usr/local/Cellar/go/1.15.8/libexec/src/runtime/panic.go:969 +0x1b9
github.com/markus-wa/godispatch.callConsumerCode.func1()
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:120 +0x88
panic(0x14be200, 0xc0028073d0)
	/usr/local/Cellar/go/1.15.8/libexec/src/runtime/panic.go:969 +0x1b9
github.com/markus-wa/godispatch.callConsumerCode.func1()
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:120 +0x88
panic(0x14d4ea0, 0xc003ec6a80)
	/usr/local/Cellar/go/1.15.8/libexec/src/runtime/panic.go:969 +0x1b9
main.main.func13()
	/Volumes/GREY/code/csgo/csgo/parser/parse_demo.go:1592 +0x168e
reflect.Value.call(0x147b440, 0xc00008c060, 0x13, 0x151a4a6, 0x4, 0xc0005e5ae0, 0x1, 0x1, 0x14bcb80, 0xc003c6efd0, ...)
	/usr/local/Cellar/go/1.15.8/libexec/src/reflect/value.go:476 +0x8c7
reflect.Value.Call(0x147b440, 0xc00008c060, 0x13, 0xc0005e5ae0, 0x1, 0x1, 0xc001efe948, 0x70decf1d78da4601, 0x70000000013fcf25)
	/usr/local/Cellar/go/1.15.8/libexec/src/reflect/value.go:337 +0xb9
github.com/markus-wa/godispatch.callConsumerCode(0x147b440, 0xc00008c060, 0x13, 0xc0005e5ae0, 0x1, 0x1)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:123 +0x8c
github.com/markus-wa/godispatch.(*Dispatcher).Dispatch(0xc00005e300, 0x149ab00, 0x18d5bd0)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:109 +0x252
github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs.(*parser).handleFrameParsed(0xc000001200, 0x18d5bd0)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/demoinfocs-golang/[email protected]/pkg/demoinfocs/parsing.go:374 +0xa5
reflect.Value.call(0x147adc0, 0xc000052660, 0x13, 0x151a4a6, 0x4, 0xc0005e5f28, 0x1, 0x1, 0xc0005e5e30, 0x0, ...)
	/usr/local/Cellar/go/1.15.8/libexec/src/reflect/value.go:476 +0x8c7
reflect.Value.Call(0x147adc0, 0xc000052660, 0x13, 0xc0005e5f28, 0x1, 0x1, 0xc0000211e8, 0x836af79e65938001, 0x830000000105f940)
	/usr/local/Cellar/go/1.15.8/libexec/src/reflect/value.go:337 +0xb9
github.com/markus-wa/godispatch.callConsumerCode(0x147adc0, 0xc000052660, 0x13, 0xc0005e5f28, 0x1, 0x1)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:123 +0x8c
github.com/markus-wa/godispatch.(*Dispatcher).Dispatch(0xc00005e2a0, 0x1469460, 0x18d5bd0)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:109 +0x252
github.com/markus-wa/godispatch.(*Dispatcher).dispatchWithRecover(0xc00005e2a0, 0x1469460, 0x18d5bd0)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:195 +0x66
github.com/markus-wa/godispatch.(*Dispatcher).dispatchQueue(0xc00005e2a0, 0xc00005e360)
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:171 +0xf4
created by github.com/markus-wa/godispatch.(*Dispatcher).AddQueues
	/Users/ask/.local/go/pkg/mod/github.com/markus-wa/[email protected]/dispatch.go:157 +0x148

INFO: 2021/02/24 11:52:43 parse_demo.go:1610: Parsed %s /Volumes/GREY/code/csgo/data/secret-club-vs-triumph-m2-inferno.dem

The bug appears on macOS 11.2.1, Python 3.9.1, Go 1.15.8.

Parse half the demo

Describe the bug
I tried to parse a demo from HLTV, but it only parses half the match. (until 6-6 score) I also checked the demo on the CSGO but could not find anything odd.
Also, it seems to work fine on other demo files, and there are no errors in the log file.

To Reproduce
The match page on HLTV if you want to reproduce.
https://www.hltv.org/matches/2347482/dignitas-vs-mad-lions-nordic-masters-spring-2021-blast-premier-qualifier

I checked another match demo from the same event: https://www.hltv.org/matches/2347483/singularity-vs-ence-nordic-masters-spring-2021-blast-premier-qualifier
It is not complete as well; the code does not parse the last round. (Maybe something wrong with the way that the event is recording the demos?)

Desktop (please complete the following information):

  • OS: MacOS 11.2
  • Python 3 / jupyter

Create parser flowchart

The Golang code is quite long, it would be helpful to have a large, navigable flowchart describing the parser.

Create sample public data set

A publicly hosted data set would be useful to the greater sports analytics community. In addition to the dataset, a contribution like the paper here would be useful.

UPDATE: Will target Scientific Data journal for this...probably will work on it more over Christmas time.
UPDATE 2: Neurips also has a data paper track. Worth considering.

Nonempty round with no stats of interest

Describe the bug
A clear and concise description of what the bug is.

A non-warmup round that has no interesting events. Looks like a round after the match officially ended.

demo: https://www.hltv.org/matches/2346574/gambit-vs-g2-iem-katowice-2021
RoundNum: 29
demo: https://www.hltv.org/matches/2346518/mousesports-vs-complexity-iem-katowice-2021-play-in
RoundNum: 38

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Changing parse_demofile.go

Hi,

Describe the bug
I tried to change the \csgo\csgo\parser\parse_demofile.go file to extract more information during events.
I initialized a new variable, which caused an error during parsing.
The variable is not used, it is only an initialization as shown in the code below.

To Reproduce / what I did

  1. Go to \csgo\csgo\parser\parse_demofile.go
  2. Initialize a new Variable (I named it "justatest") in EventHandler "Kill" - nothing else, variable is not in use
p.RegisterEventHandler(func(e events.Kill) {
        /* Parse player kill events */
	warmup := p.GameState().IsWarmupPeriod()

	// Only parse non-warmup kill events
	if warmup == false {
		// First block (game state)
		gameTick := p.GameState().IngameTick()
		var mapName string = header.MapName

		// Second block (victim location)
		var justatest uint32 = 0
		var victimX float64 = 0.0
		var victimY float64 = 0.0
                ...
  1. run "python setup.py install" to build the new source
  2. run code on a demofile
from csgo.parser import DemoParser

# Create parser object
# Set log=True above if you want to produce a logfile for the parser
demo_parser = DemoParser(demofile = "aaa.dem", match_id = "aaa.dem")

# Parse the demofile, output results to dictionary with df name as key
data = demo_parser.parse()
  1. Error message
23:40:03 [INFO] Initialized CSGODemoParser with demofile aaa.dem
23:40:03 [INFO] Go version>=1.14.0
23:40:03 [INFO] Starting CSGO Golang demofile parser, reading in C:\Users\Pati\Documents\CSGODemoAnalyzer\CSGODemo/aaa.dem
23:40:03 [INFO] Running Golang parser from C:\Users\Pati\anaconda3\envs\csgodemo\lib\site-packages\csgo-0.1-py3.6.egg\csgo\parser\

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-1-4248514c21f5> in <module>
      6 
      7 # Parse the demofile, output results to dictionary with df name as key
----> 8 data = demo_parser.parse()

~\anaconda3\envs\csgodemo\lib\site-packages\csgo-0.1-py3.6.egg\csgo\parser\demoparser.py in parse(self)
    644         """ Parse wrapper function, called by user, and returns dictionary of data frames. Takes no arguments.
    645         """
--> 646         self._parse_demofile()
    647         if not self.demo_error:
    648             self._parse_match()

~\anaconda3\envs\csgodemo\lib\site-packages\csgo-0.1-py3.6.egg\csgo\parser\demoparser.py in _parse_demofile(self)
    262         self.parsed_text = [event.decode("utf-8") for event in self.parsed_text]
    263         self.parsed_text = [event[:-1] for event in self.parsed_text]
--> 264         if "[ERROR]" in self.parsed_text[0]:
    265             self.demo_error = True
    266         self.logger.info("Demofile parsing complete")

IndexError: list index out of range

Expected behavior
I tried to extract more information during an event an print it out with "fmt.Printf("[KILL] ...")".

Additional context
What is the right way to change the context of the events?
For example I want to get the information about the health of the killer (e.Killer.Health()).
How can I adjust the code?

Thanks in advance!

Competitive Rank

I would like to add the ranks of each player when i get the parsed json file. I asked the author of the demoinfocs-golang if this is implemented and he said that it is already there. Code

Describe the solution you'd like
Maybe at the end of the array the relevant rank information for each player

Add cleaning functions

Since the update to parse all demos, then handle cleaning locally, we need to build cleaning functions. These can be a few things to consider:

  • warmup rounds
  • knife rounds
  • too short or too long rounds
  • rounds with non-standard end reasons
  • rounds with no score changes
  • rounds outside of the bounds of the major events
  • none or empty frames

These functions should likely be built into the DemoParser class.

Nav Mesh Area/Tile Plotting

Is your feature request related to a problem? Please describe.
No not really a problem; just a cool feature I think that could be useful

Describe the solution you'd like
Built-in functionality to plot by nav tile. For example if one wanted to plot all the nav tiles the CT team is occupying, this hypothetical function could help out (user wouldn't have to manually plot the pixels in the tile).

Describe alternatives you've considered
Plotting rectangles with matplotlib

Add newer kill feed indicators to parsed kills

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
Add a column to the kills data indicating if a kill was a blind kill, no-scope and/or through a smoke. I am making the assumption that since it's a part of the kill feed then it is determined by the game engine and would be easy to parse.

Describe alternatives you've considered
Blind kills could be determined looking at the times players were flashed, but no-scope and through smoke kills are impossible to determine.

Additional context
Update that implemented this feature into the game is in this blog post.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.