Package: hiddenfigures
hiddenfiguresHiddenFigures is an open-source project that combines multiple tools for decompiling Rocket League replays and then analysing them.RequirementsPython 3.6.7+ (3.7 and 3.8 included)Windows, Mac or LinuxInstallInstall from pip:pip install hiddenfiguresClone for developmentWindowsgit clone https://github.com/SaltieRL/hiddenfigures
cd hiddenfigures/
python init.pyLinuxgit clone https://github.com/SaltieRL/hiddenfigures
cd hiddenfigures/
./_travis/install-protoc.sh
python init.pyMacIn MacOS Catalina, zsh replaced bash as the default shell, which may cause permission issues when trying to runinstall-protoc.shin the above fashion. Simply invoking bash should resolve this issue, like so:git clone https://github.com/SaltieRL/hiddenfigures
cd hiddenfigures/
bash ./_travis/install-protoc.sh
python init.pyApple's decision to replace bash as the default shell may foreshadow the removal of bash in a future version of MacOS. In such a case, Homebrew users caninstall protocby replacingbash ./travis/install-protoc.shwithbrew install protobuf.Examples / UsageOne of the main data structures used in hiddenfigures is the pandas.DataFrame, to learn more, seeits wiki page.Decompile and analyze a replay:importhiddenfiguresanalysis_manager=hiddenfigures.analyze_replay_file('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',overwrite=True)proto_game=analysis_manager.get_protobuf_data()# you can see more example of using the analysis manager belowJust decompile a replay to a JSON object:importhiddenfigures_json=hiddenfigures.decompile_replay('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',overwrite=True)Analyze a JSON game object:importhiddenfiguresimportgzipfromhiddenfigures.json_parser.gameimportGamefromhiddenfigures.analysis.analysis_managerimportAnalysisManager# _json is a JSON game object (from decompile_replay)game=Game()game.initialize(loaded_json=_json)analysis_manager=AnalysisManager(game)analysis_manager.create_analysis()# return the proto object in pythonproto_object=analysis_manager.get_protobuf_data()# return the proto object as a json objectjson_oject=analysis_manager.get_json_data()# return the pandas data frame in pythondataframe=analysis_manager.get_data_frame()You may want to save hiddenfigures analysis results for later use:# write proto out to a file# read api/*.proto for info on the object propertieswithopen('output.pts','wb')asfo:analysis_manager.write_proto_out_to_file(fo)# write pandas dataframe out as a gzipped numpy arraywithgzip.open('output.gzip','wb')asfo:analysis_manager.write_pandas_out_to_file(fo)Read the saved analysis files:importgzipfromhiddenfigures.analysis.utils.pandas_managerimportPandasManagerfromhiddenfigures.analysis.utils.proto_managerimportProtobufManager# read proto from filewithopen('output.pts','rb')asf:proto_object=ProtobufManager.read_proto_out_from_file(f)# read pandas dataframe from gzipped numpy array filewithgzip.open('output.gzip','rb')asf:dataframe=PandasManager.read_numpy_from_memory(f)Command LineHiddenFigures comes with a command line tool to analyze replays. To use hiddenfigures from the command line:hiddenfigures-i9EB5E5814D73F55B51A1BD9664D4CBF3.replay--jsonanalysis.jsonTo get the analysis in both json and protobuf and also the compressed replay frame data frame:hiddenfigures-i9EB5E5814D73F55B51A1BD9664D4CBF3.replay--jsonanalysis.json--protoanalysis.pts--gzipframes.gzipCommand Line Argumentsusage: hiddenfigures [-h] -i INPUT [--proto PROTO] [--json JSON] [--gzip GZIP] [-sd]
               [-v] [-s]

Rocket League replay parsing and analysis.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Path to replay file that will be analyzed. HiddenFigures
                        expects a raw replay file unless --skip-decompile is
                        provided.
  --proto PROTO         The result of the analysis will be saved to this file
                        in protocol buffers format.
  --json JSON           The result of the analysis will be saved to this file
                        in json file format.
  --gzip GZIP           The pandas dataframe will be saved to this file in a
                        compressed gzip format.
  -v, --verbose         Set the logging level to INFO. To set the logging
                        level to DEBUG use -vv.
  -s, --silent          Disable logging altogether.PipelineIf 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 classesWhere you add a new statIf you want to see the output format of the stats created you can lookhereCompile the proto files by running in this directorysetup.bat(Windows) orsetup.sh(Linux/mac)TipsLinux setpython3.6aspython:sudoupdate-alternatives--install/usr/bin/pythonpython/usr/bin/python3.61This assumes you already have 3.6 installed.DevelopingEveryone is welcome to join the hiddenfigures (and calculated.gg) project! Even if you are a beginner, this can be used as an opportunity to learn more - you just need to be willing to learn and contribute.Usage of GitHubAll contributions end up on the hiddenfigures repository.  If you are new to the project you are required to use your own fork for first changes. If you do not have any previous git / github experience that is completely fine - we can help with it.
If we believe that you are comitted to working on the project and have experience in git we may give you write access so that you no longer have to use a fork. Nonetheless, please wait until your contrubtion is ready for a review to make the pull request because that will save resources for our tests and reduce spam.
For testing you should use your own fork, but take note that some hiddenfigures tests may fail on a forkLearning about hiddenfiguresCurrently, there is active creation of the hiddenfigures wiki on GitHub - it aims to provide all relevant information about hiddenfigures and development, so if you are a beginner, definitely have a look there. If you can't find information that you were looking for, your next option is the calculated.gg Discord server, where you may send a message to the #help channel.The hiddenfigures code is also documented, although sparsely. However, you still may find information there, too.TestingThe main requirement is to run PyTest. If you are using an IDE that supports integrated testing (e.g. PyCharm), you should enable PyTest there. The secondary requirement (to compile the proto files) is to run the appropriatesetupfile (setup.bat for Windows, setup.sh for Linux/Mac).If you've never tested your code before, it is a good idea to learn that skill with PyTest! Have a look at their official documentation, or any other tutorials.hiddenfigures PerformanceHiddenFigures powers calculated.gg, which analyses tens of thousands of replays per day. Therefore, performance is very important, and it is monitored and controlled using PyTest-Benchmarking, which is implemented via GitHub Actions. However, you may see your contribution's performance locally - look into PyTest-Benchmarking documentation. If your contribution is very inefficient - it will fail automatically.If you wish to see the current hiddenfigures analysis performance, it is split into 5 replay categories, and can be accessed below:Short SampleA very short soccar replay - for fast benchmarking.Short DropshotA very short dropshot replay - to test dropshot performance.RumbleA full game of rumble - to test rumble performance.RLCSA full soccar RLCS game.RLCS (Intensive)A full soccar RLCS game, but run with the intense analysis flag.