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.0-alpha.5"
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 make changes to frames.json or modify 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:
- peppi.json
- metadata.json
- start.json
- start.raw
- end.json
- end.raw
- frames.arrow
The last of these, frames.arrow, is 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.