Read-only copy of github.com/Ahmet-Dedeler/rage9-re · Decoder for RAGE9 script.rpf and anim.rpf (PSO script data, crAnimation channels) with glTF 2.0 export. Rust + Python.
  • Rust 72.2%
  • Python 27.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-24 06:07:23 +03:00
docs feat: clean-room RAGE9 script.rpf and anim.rpf decoder, specs, and glTF 2.0 exporter 2026-11-21 20:27:46 +03:00
python/rage9_re Fix parser bounds, glTF 2.0 export, CLI, and Python parity bugs 2026-11-23 04:25:46 +03:00
src Fix parser bounds, glTF 2.0 export, CLI, and Python parity bugs 2026-11-23 04:25:46 +03:00
tests Fix parser bounds, glTF 2.0 export, CLI, and Python parity bugs 2026-11-23 04:25:46 +03:00
.gitignore feat: clean-room RAGE9 script.rpf and anim.rpf decoder, specs, and glTF 2.0 exporter 2026-11-21 20:27:46 +03:00
AGENTS.md chore: add credit headers, AGENTS.md and CITATION.cff 2026-11-22 15:11:52 +03:00
Cargo.lock feat: clean-room RAGE9 script.rpf and anim.rpf decoder, specs, and glTF 2.0 exporter 2026-11-21 20:27:46 +03:00
Cargo.toml chore: set crate description and repository 2026-11-21 21:12:58 +03:00
CITATION.cff chore: add credit headers, AGENTS.md and CITATION.cff 2026-11-22 15:11:52 +03:00
LICENSE-APACHE feat: clean-room RAGE9 script.rpf and anim.rpf decoder, specs, and glTF 2.0 exporter 2026-11-21 20:27:46 +03:00
LICENSE-MIT feat: clean-room RAGE9 script.rpf and anim.rpf decoder, specs, and glTF 2.0 exporter 2026-11-21 20:27:46 +03:00
README.md README: new Discord invite 2026-11-24 06:07:23 +03:00

rage9-re

Rust and Python tools for two RAGE9 archive types: script.rpf (script data) and anim.rpf (animations), with a glTF 2.0 exporter for decoded clips. Written from scratch from observed file structure; no game code or data is included.

Join the Discord
Questions, previews, bug reports and format research. Come say hi.

License: MIT OR Apache-2.0. You need your own copy of the game files to run the inspectors.

What works

script.rpf

  • Scans the nested RPF9 (9FPR) containers and carves and stitches the 16-byte-aligned zlib streams (1,057 of 1,057 streams inflate).
  • Parses PSIN (PSO v122) containers: PSIN -> LSCH -> LENM -> LSNS -> LGID -> LRSC -> CHKS. All 1,012 files parse.
  • Rebuilds the compiled binary-XML script-data DOM (root struct 0xde396fe2) and writes it out as XML or JSON.
  • Walks the serialised object graph in the first sub-archive (30,683 records, 483 root trees) and resolves its 0x71717171-tagged pointers.

anim.rpf

  • Parses crClipDictionary -> crClip -> crAnimation -> crAnimSequence.
  • Decodes the channel classes seen in the archive: static quaternion / vector / float (0, 1, 2), per-frame quantized float (4), indexed quantized float (5), quaternion component reconstruction (7), quaternion normalization (8), and the 64-frame superblock 2nd-order zigzag delta curves (10).
  • Exports a clip as .glb for viewing in Blender or any glTF viewer.

How it was checked: all 21,084 class-10 curves in the sampled windows land exactly on their superblock bit offsets and anchors. A sample exported clip moves smoothly, with a median rotation change of 0.85° per frame at 30 Hz.

Known gaps

  • The glTF exporter only maps a handful of named bones (skel_root, skel_pelvis, spine, hands, feet, ik_*, ph_*). The full skeleton hierarchy is not reconstructed yet.
  • A small fraction of frames show large jumps (1% of steps over 20°), so some channel or quantization edge case is likely still wrong.
  • anim.rpf is read in windows. Not every clip dictionary in the 4.4 GB archive has been decoded and checked.
  • Field names in the DOM come from hashes; most are not resolved to readable names.

Usage

cargo build --release
./target/release/rage9-re inspect-script /path/to/script.rpf --dump-xml 0 --dump-objgraph 0
./target/release/rage9-re inspect-anim /path/to/anim.rpf --export-glb out.glb

Python package: python/rage9_re.

Tests

cargo test
python3 -m unittest discover -s tests -v

The tests use synthetic data built in the test files.

Format notes

Questions, previews and format research: join the Discord.