Skip to content
/ carball Public
forked from SaltieRL/carball

📈 A Rocket League replay decompiling and analysis library

License

Notifications You must be signed in to change notification settings

jawnv6/carball

 
 

Repository files navigation

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:

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:

import carball

_json = carball.decompile_replay('9EB5E5814D73F55B51A1BD9664D4CBF3.replay', 
                                output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json', 
                                overwrite=True)

Analyze a JSON game object:

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

pipeline is in Parserformat.png

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

Where you add a new stat

If you want to see the output format of the stats created you can look here

Compile the proto files by running in this directory setup.bat (Windows) or setup.sh (Linux/mac)

Build Status codecov

Tips

Linux set python3.6 as python:

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"

About

📈 A Rocket League replay decompiling and analysis library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.1%
  • Other 0.9%