# [Rattletrap][] [![Version badge][]][version] [![Windows build badge][]][windows build] [![Build badge][]][build] Rattletrap parses and generates [Rocket League][] replays. ## Install Get Rattletrap by downloading and unpacking [the latest release][] for your platform. To build Rattletrap from source, install [Stack][]. Then run `stack --resolver nightly install rattletrap`. ## Replays Rocket League saves your replays in a folder that depends on your operating system. - Windows: `%UserProfile%\Documents\My Games\Rocket League\TAGame\Demos` - macOS: `$HOME/Library/Application Support/Rocket League/TAGame/Demos` - Linux: `$HOME/.local/share/Rocket League/TAGame/Demos` ## Parse Rattletrap can parse (decode) Rocket League replays and output them as JSON. ``` sh > rattletrap decode input.replay output.json # or > rattletrap decode input.replay > output.json # or > rattletrap.decode < input.replay > output.json ``` The resulting JSON is minified, but extremely large. The output can be up to 50 times larger than the input. ## Generate Rattletrap can also generate (encode) Rocket League replays from JSON files. ``` sh > rattletrap encode input.json output.replay # or > rattletrap encode input.json > output.replay # or > rattletrap.encode < input.json > output.replay ``` If the JSON was generated by Rattletrap, the resulting replay should be identical to the original. ## Modify By inserting another program between parsing and generating, Rattletrap can be used to modify replays. ``` sh > rattletrap decode < original.replay | modify-replay-json | rattletrap encode > modified.replay ``` [Rattletrap]: https://github.com/tfausak/rattletrap [Version badge]: https://www.stackage.org/package/rattletrap/badge/nightly?label=version [version]: https://www.stackage.org/nightly/package/rattletrap [Windows build badge]: https://ci.appveyor.com/api/projects/status/github/tfausak/rattletrap?branch=master&svg=true [windows build]: https://ci.appveyor.com/project/TaylorFausak/rattletrap [Build badge]: https://travis-ci.org/tfausak/rattletrap.svg?branch=master [build]: https://travis-ci.org/tfausak/rattletrap [Rocket League]: https://www.rocketleaguegame.com [the latest release]: https://github.com/tfausak/rattletrap/releases/latest [Stack]: https://docs.haskellstack.org/en/stable/README/