RBF binary XML to XML: sixng rbf command and viewer preview #152

Manually merged
github merged 1 commit from gh-pr/152/head into gh-pr/152/base 2026-11-26 20:13:40 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 13:15 UTC · original
holdmysocks:claude/rbf-xml → master · +529 −1 · 5 files · 1 commits · merged 2026-11-24 13:28 UTC

Decodes RBF (RBF0) binary XML files to XML text (Linear SIX-97).

Format (worked out from the files)

  • RBF0, then an optional version token FFFB u16 (version 1 = 8-byte integers and floats; without it, 4-byte).
  • Token stream, depth first: FFFF closes the open element, FFFD u32 len bytes is text content (len includes a final NUL), anything else is an element whose low 12 bits are a name id and top 4 bits a type.
  • Names are stored as text on first use (id equal to the table size, then u16 len, bytes), so every tag and attribute name is real text.
  • Type 0 = element with content (u32 always 0, u16 attribute count, attributes). Types 1 int, 2 false, 3 true, 4 float, 5 three-f32 vector, 6 string are self-closing value elements; attributes use the same type codes.
  • Elements with content="vec2v_array" hold binary text: 16 bytes per point (f32 x, f32 y, 8 zero bytes). They are written as one x, y line per point.

Changes

  • sixng-core::rbf: decoder with per-file stats and typed errors (reason + offset), plus unit tests.
  • sixng rbf [archive] --out <dir>: writes <out>/rbf/<archive>/<offset>.xml and index.jsonl (stats, or the reason a file did not decode), and prints failure counts by reason.
  • Viewer: the Archives preview shows RBF entries as XML.
  • README status row and example updated.

Results

  • data.rpf: 1,263 of 1,263 decode, 0 errors. All outputs parse as well-formed XML.
  • common.rpf: has no RBF files.
  • Also decode: 9 in levels.rpf, 1 in anim.rpf, 1 in packs.rpf.
**@⁠holdmysocks** on GitHub · 2026-11-24 13:15 UTC · [original](https://github.com/holdmysocks/SixNG/pull/152) `holdmysocks:claude/rbf-xml` → `master` · +529 −1 · 5 files · 1 commits · merged 2026-11-24 13:28 UTC Decodes RBF (`RBF0`) binary XML files to XML text (Linear SIX-97). ## Format (worked out from the files) - `RBF0`, then an optional version token `FFFB u16` (version 1 = 8-byte integers and floats; without it, 4-byte). - Token stream, depth first: `FFFF` closes the open element, `FFFD u32 len bytes` is text content (len includes a final NUL), anything else is an element whose low 12 bits are a name id and top 4 bits a type. - Names are stored as text on first use (id equal to the table size, then `u16 len, bytes`), so every tag and attribute name is real text. - Type 0 = element with content (`u32` always 0, `u16` attribute count, attributes). Types 1 int, 2 false, 3 true, 4 float, 5 three-f32 vector, 6 string are self-closing value elements; attributes use the same type codes. - Elements with `content="vec2v_array"` hold binary text: 16 bytes per point (f32 x, f32 y, 8 zero bytes). They are written as one `x, y` line per point. ## Changes - `sixng-core::rbf`: decoder with per-file stats and typed errors (reason + offset), plus unit tests. - `sixng rbf [archive] --out <dir>`: writes `<out>/rbf/<archive>/<offset>.xml` and `index.jsonl` (stats, or the reason a file did not decode), and prints failure counts by reason. - Viewer: the Archives preview shows RBF entries as XML. - README status row and example updated. ## Results - `data.rpf`: 1,263 of 1,263 decode, 0 errors. All outputs parse as well-formed XML. - `common.rpf`: has no RBF files. - Also decode: 9 in `levels.rpf`, 1 in `anim.rpf`, 1 in `packs.rpf`.
Decodes RBF0 files (token stream: names stored as text on first use,
typed value elements and attributes, text content, optional version
token that selects 8-byte numbers). Writes <out>/rbf/<archive>/<offset>.xml
plus index.jsonl with per-file stats or the reason a file did not decode.
All 1,263 RBF files in data.rpf decode; the Archives preview shows them
as XML.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:13:39 +00:00
github manually merged commit 007621822e into gh-pr/152/base 2026-11-26 20:13:40 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.