Library to quickly view grenade trajectories and weapon heatmaps for all players by parsing CSGO demo files.
In order to parse the .dem files, you will need to install the CS:GO Python package available here.
After installing the CS:GO library on your environment and downloading the required demo(s):
- Clone this repo by running
git clone https://github.com/lakshyaag/CSGO-Visualization. - Change the working directory to the newly cloned directory
- Create a new folder called
demosand move all download.demfiles to be parsed - read Directory Strucutre for more - Run
parse.py, specifying the folder name containing the.demfiles and thematch_id - The parser will take care of appending all maps in a match and will provide
.csv/.xlsxfiles for multiple metrics such as Kills, Damages, Grenades, Rounds, etc. in a folder namedparsed_demo_files - Upload the
grenades.csv/weapons.csvfile of the respective match to the Shiny app!
.
├── CSGO-Visualization
│ ├── demos # Parent folder containing all match folders
| | ├── match_1 # .dem files for Match #1
| | | ├── demo_1_1 # .dem file for Map #1 Match #1
| | | ├── demo_1_2 # .dem file for Map #2 Match #1
| | | ├── demo_1_3 # .dem file for Map #3 Match #1
| | ├── match_2 # .dem files for Match #2
| | | ├── demo_2_1 # .dem file for Map #1 Match #2
| | | ├── demo_2_2 # .dem file for Map #2 Match #2
| | ├── match_3 # .dem files for Match #3
| | | ├── demo_3_1 # .dem file for Map #1 Match #3
├── maps # Contains map images
Using this parser is simple. For example, if you wanted to check the grenade trajectories for this match, you would:
-
Download the
.zipfile from HLTV and unzip the contents into/CSGO-Visualization/demos/PGL-Major-Stockholm-2021-copenhagen-flames-vs-nip-bo3 -
Open a terminal/shell and navigate to
/CSGO-Visualization/demos/ -
Run the following line
python ../parse.py "./PGL-Major-Stockholm-2021-copenhagen-flames-vs-nip-bo3/" "cph-vs-nip-bo3-pgl-major-2021" -j
Here, the first argument specifies the folder containing the
.demfiles, the second argument provides thematch_idto use. Finally,-jtells the parser to remove the interim.jsonoutput to save disk space. -
Once the parser has completed processing, the files will be stored in
/CSGO-Visualization/demos/parsed_demo_files/cph-vs-nip-bo3-pgl-major-2021/ -
From here, simply upload the
g2-vs-nip-bo3-pgl-major-2021_grenades_overall.xlsxto the Shiny application
That's easy to do. Simply put all of the .dem files that you wish to parse in the same folder and pass that folder as an argument to the parser.
For example, if you wish to the grenade trajectories for all matches played on de_overpass (with the ability to filter by player), you can move all the de_overpass .dem files in a folder /demos/ovp_demos and pass ovp_demos to the parser.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please feel free to reach out to me on Twitter
Huge thanks to the Python csgo package for efficient parsing, to SimpleRadar for the cleanest radar images available and to HLTV for being the go-to source of Counter-Strike.
python .\parse.py -h
usage: parse.py [-h] [-j] path/to/demo match_id
Parse .dem files in folder provided
positional arguments:
path/to/demo Path to folder containing .dem file(s)
match_id Match ID to use for filenames
optional arguments:
-h, --help show this help message and exit
-j, --json_remove Flag to remove .json generated by parser