Peppi
Peppi is a Rust parser for .slp game replay files for Super Smash Brothers Melee for the Nintendo GameCube. These replays are generated by Jas Laferriere's Slippi recording code, which runs on a Wii or the Dolphin emulator.
⚠️ The slp tool has moved to the peppi-slp crate.
Installation
In your Cargo.toml:
[]
= "2.0"
Usage
One-shot .slp parsing with slippi::read (use peppi::read instead for .slpp):
use ;
use read;
use ;
use read;
use Rollbacks;
// `ssbm-data` provides enums for characters, stages, action states, etc.
// You can just hard-code constants instead, if you prefer.
use ;
/// Print the frames on which each player died.
use fs;
use BufReader;
use ReadBytesExt;
use de;
Development
The Rust source files in src/frame are generated using Clojure from frames.json, which describes all the per-frame fields present in each version of the spec. If you modify frames.json or the generator code in gen/src, run gen/scripts/frames to regenerate those Rust files.
If you're adding support for a new version of the spec, you'll also need to bump peppi::io::slippi::MAX_SUPPORTED_VERSION.
Goals
- Performance: Peppi aims to be the fastest parser for
.slpfiles. - Ergonomics: It should be easy and natural to work with parsed data.
- Lenience: accept-and-warn on malformed data, when feasible.
- Cross-language support: other languages should be able to interact with Peppi easily and efficiently.
- Round-tripping: Peppi can parse a replay and then write it back, bit-for-bit identically.
- Alternative format: Peppi provides an alternative format that is more compressible and easier to work with than
.slp.
Peppi Format
The Peppi format (.slpp) is a GNU tar archive containing the following files, in order:
peppi.json: Peppi-specific info.metadata.json: Slippi's metadata block.start.json: JSON representation of the Game Start event.start.raw: Raw binary Game Start event.end.json: JSON representation of the Game End event.end.raw: Raw binary Game End event.frames.arrow: Frame data in Arrow format (see below).
The bulk of this data is in frames.arrow, an Arrow IPC file containing all of the game's frame data. This is a columnar format, which makes .slpp about twice as compressible as .slp.
To convert between formats, use the slp CLI tool.