Rocket League replay parsing and analysis.
Project description
# carball
Various tools for decompiling / analyzing Rocket League replays.
## Requirements
- Python 3.6+
- Windows, Mac or Linux
## Install
`pip install carball`
`python init.py`
## Examples / Usage
Decompile and analyze a replay:
```Python
import carball
manager = carball.analyze_replay_file('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',
output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',
overwrite=True)
proto_game = manager.get_protobuf_data()
```
Just decompile a replay to a JSON object:
```Python
import carball
_json = carball.decompile_replay('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',
output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',
overwrite=True)
```
Analyze a JSON game object:
```Python
import carball
import os
import gzip
from carball.json_parser.game import Game
from carball.analysis.analysis_manager import AnalysisManager
# _json is a JSON game object (from decompile_replay)
game = Game()
game.initialize(loaded_json=_json)
analysis = AnalysisManager(game)
analysis.create_analysis()
# write proto out to a file
# read api/*.proto for info on the object properties
with open(os.path.join('output.pts'), 'wb') as fo:
analysis.write_proto_out_to_file(fo)
# write pandas dataframe out as a gzipped numpy array
with gzip.open(os.path.join('output.gzip'), 'wb') as fo:
analysis.write_pandas_out_to_file(fo)
```
## Pipeline

If you want to add a new stat it is best to do it in the advanced stats section of the pipeline.
You should look at:
[Stat base classes](carball/analysis/stats/stats.py)
[Where you add a new stat](carball/analysis/stats/stats_list.py)
If you want to see the output format of the stats created you can look [here](api)
Compile the proto files by running in this directory
`setup.bat` (Windows) or `setup.sh` (Linux/mac)
[](https://travis-ci.org/SaltieRL/carball)
[](https://codecov.io/gh/SaltieRL/carball)
## Tips
Linux set `python3.6` as `python`:
```Python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
```
This assumes you already have 3.6 installed.
Linux Error (Potential):
`PermissionError: [Errno 13] Permission denied: 'carball/rattletrap/rattletrap-6.2.2-linux'`
Fix:
`chmod +x "carball/rattletrap/rattletrap-6.2.2-linux"`
Various tools for decompiling / analyzing Rocket League replays.
## Requirements
- Python 3.6+
- Windows, Mac or Linux
## Install
`pip install carball`
`python init.py`
## Examples / Usage
Decompile and analyze a replay:
```Python
import carball
manager = carball.analyze_replay_file('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',
output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',
overwrite=True)
proto_game = manager.get_protobuf_data()
```
Just decompile a replay to a JSON object:
```Python
import carball
_json = carball.decompile_replay('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',
output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',
overwrite=True)
```
Analyze a JSON game object:
```Python
import carball
import os
import gzip
from carball.json_parser.game import Game
from carball.analysis.analysis_manager import AnalysisManager
# _json is a JSON game object (from decompile_replay)
game = Game()
game.initialize(loaded_json=_json)
analysis = AnalysisManager(game)
analysis.create_analysis()
# write proto out to a file
# read api/*.proto for info on the object properties
with open(os.path.join('output.pts'), 'wb') as fo:
analysis.write_proto_out_to_file(fo)
# write pandas dataframe out as a gzipped numpy array
with gzip.open(os.path.join('output.gzip'), 'wb') as fo:
analysis.write_pandas_out_to_file(fo)
```
## Pipeline

If you want to add a new stat it is best to do it in the advanced stats section of the pipeline.
You should look at:
[Stat base classes](carball/analysis/stats/stats.py)
[Where you add a new stat](carball/analysis/stats/stats_list.py)
If you want to see the output format of the stats created you can look [here](api)
Compile the proto files by running in this directory
`setup.bat` (Windows) or `setup.sh` (Linux/mac)
[](https://travis-ci.org/SaltieRL/carball)
[](https://codecov.io/gh/SaltieRL/carball)
## Tips
Linux set `python3.6` as `python`:
```Python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
```
This assumes you already have 3.6 installed.
Linux Error (Potential):
`PermissionError: [Errno 13] Permission denied: 'carball/rattletrap/rattletrap-6.2.2-linux'`
Fix:
`chmod +x "carball/rattletrap/rattletrap-6.2.2-linux"`
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
carball-0.6.15.tar.gz
(4.7 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file carball-0.6.15.tar.gz.
File metadata
- Download URL: carball-0.6.15.tar.gz
- Upload date:
- Size: 4.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82c856d8fbdea51e125f8cf03fafd39a5c6520f41c65a52ac0f60cb933c80a42
|
|
| MD5 |
96e6c5c3edbd6c0b516ae9ff21586279
|
|
| BLAKE2b-256 |
bb9c5f060ae8a4f11881d171fcee89a5ec046bcd0243567300d22406b597f6a8
|
File details
Details for the file carball-0.6.15-py3-none-any.whl.
File metadata
- Download URL: carball-0.6.15-py3-none-any.whl
- Upload date:
- Size: 4.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc5e5d1a8f908f07ff45f3fb0ebb947a979d91c4dc6c4e7740002eefc60f9b98
|
|
| MD5 |
fe899152308caf1dac4fe754c5c974c0
|
|
| BLAKE2b-256 |
3aa879159ac0ba827e1788730b61121bd3bcb14d6287d9e582d7bfe0054335f5
|