Commit Graph

27 Commits

Author SHA1 Message Date
4763e0f7fc anim_rigs: read the four RIG dictionaries in anim.rpf and resolve the RBF0 rig entries (ASSET-20)
The rig dictionaries share the clip dictionary root; each map value points at +0x20 to a RIG block of
{kind, size, count, word} tables. Their names are the RBF0 sources, and all 6,677 rig-set entries resolve
to a key there. docs/animation.md gets the layout, the counts and the clip-to-skeleton measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:59:03 +01:00
7a5be8a87e Merge pull request #1645 from Kam471
# Conflicts:
#	docs/animation.md
#	docs/models.md
2026-11-22 08:08:25 -05:00
97289391da docs: sync the remaining 917e9b9 model-count citations 2026-11-22 12:52:31 +00:00
76e5e8ef8b docs: correct the 917e9b9 baseline for story000_restofworld (3 models, not 0) 2026-11-22 12:24:13 +00:00
17f39ac44f anim_clips: read .motion child times and one-axis parameter nodes
.motion +0x70 holds one 0x28-byte item per child: the child's duration, its
duration in the blend and a (child time, blend time) curve. On anim.rpf the
first float is bit-for-bit the named .clip's duration for all 111,948 children
that name a .clip there; 158,991 of 159,584 curves are the identity and 402 are
monotonic time warps.

The parameter node is at +0x138 (+0x58 = 1) or at +0x18 of the block +0x120
points at (+0x58 = 2). Type 3 (10,171 of 17,247) is one sampled axis: a name
hash, (sample index, value) items sorted by value, min and max. 10 of the 88
axis name hashes resolve to joaat32 names such as yawangle and speed.

Also documents that the unlisted-last-page recovery needs the page map in a
listed stream (whattheflop's review on #1174): no anim.rpf root and no
story000 clip dictionary has its page map in such a tail. A synthetic test
keeps that layout unresolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:08:55 +00:00
eb739d2b0d docs: Windows paths in the story000 command, as in the rest of the page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:53:59 +00:00
69111ebe5e docs: anim_clips on story000.rpf (9,190 clip dictionaries, all animations decode)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:53:48 +00:00
590225ad0d anim_clips: join the 36 unresolved dictionaries and resolve .motion children
The 36 roots whose second system page is not the next listed stream have it
right after the first stream: a zlib stream inflating to 16-48 bytes, which
anim_index.py does not list (it keeps streams of 64 bytes or more), or a
16-byte raw page. group() now tries that page and joins it only when the
pages parse as a clip dictionary. All 36 join; 191,042 animations decode.

.motion clips list their children as {u64 0; u32 clip hash; u32 dictionary
hash} at +0x60, and the root's hash-only +0x70 references are dictionary
hashes. scan() joins both across the archive: 111,948 of the 114,925
children whose dictionary is in anim.rpf name a .clip of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:45:31 +00:00
09d3841df8 anim_clips: decode the clip dictionaries in anim.rpf to keyframes
tools/anim_clips.py groups the stream walk of anim_index.py into RAGE
resources via the page map at the +0x08 pointer, finds the clip
dictionaries (system-only, 1 or 2 pages) and decodes dictionary -> clips
-> packs -> animations -> sequences -> channels. Channel types 0-5, 7, 8
and the GTA VI type 10 (second-order delta coding) are decoded. Output is
counts and per-dictionary rows only; --decode prints one dictionary's
values to stdout for local use.

docs/animation.md gets a "Keyframe decoding" section with the layouts and
the measured full-archive counts, and the statements it makes stale are
updated: 0x98e1750c is joaat32("bonerotation"), the 2/3 packed streams
are second system pages of 0DRP resources, and keyframes are decoded for
the clip dictionaries. tests/test_anim_clips.py builds synthetic
resources, including a type-10 encoder for a round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:17:56 +00:00
b27b92a101 Count stored rig-name hashes in animation index reports
(cherry picked from commit 9940b3f05717a8291c25efd04780b4a8ae60a489)
2026-11-22 00:33:51 -05:00
050ea3dcfa Docs: re-count the model-bearing archives at rpf9-explorer 917e9b9 (ASSET-49)
Fresh scan/recover at the new pin, no cache, across every model-bearing archive. The new pin recovers 350,248 models (159,483 drawable-dictionary children) against 190,792 at c3708fb.

Per archive: levels.rpf 314,000 (130,225 children), story000 7,460 (4,156), packs 24,034 (23,720), data 2,581 (268), shared_minigame000 1,288 (317), core_restofworld 885 (797). The standalone total is 190,765, 27 below the c3708fb recovery (duplicates merged). levels.rpf is the sum of ten parallel recovery shards over 206,981 candidates; the last shard rejects 1,009 incomplete/duplicate tail pages. Triangle totals and the C# TTPF texture counts were not re-run.
2026-11-22 02:30:07 +00:00
0786a08395 Docs: measure the character skeleton and clip sidecars
Add a character-skeleton page: 597-name #ft table, the following 597-record parent/reference-TRS table, the model bone-hash mapping, and the character material texture-parameter split. Update animation.md with the partial clip decode (two named clips, 0x48-byte track arrays, 63/38 and 12/38 masks) and the 46-byte MoVE header correction. Link the new page from models.md and design.md. No game data.
2026-11-22 00:44:04 +00:00
fe8cd6bc72 Tools: reject out-of-range --start/--limit in RPF index tools
Adds the #283 argparse validators to anim_index, rbf0_index, restofworld_index and rpf9_carve: --start >= 0, --limit >= 1 (decimal or 0x hex), and --max-inflate >= 1 in restofworld_index. Bad ranges now exit 2 before any scan or output instead of silently scanning everything, less, or nothing. Synthetic CLI tests in all four test files; docs notes for each tool.

New item claimed in #156. AI-assisted (OpenCode).
2026-11-21 16:53:41 -06:00
d50ba56650 Tools: decode RBF0 trees for UI and subtitles
Add a stdlib record/tree decoder for the measured RBF0 format. It joins 64 KiB continuations, parses the inline descriptor table, builds element/attribute/content/text trees, and writes JSON plus optional generic XML. Unknown descriptors, record types and malformed framing fail closed with a partial tree. Add synthetic tests and the measured grammar, samples and remaining unknowns to docs/rbf0.md; note the rig-set blob tree result in docs/animation.md.
2026-11-21 21:01:14 +00:00
df508f3444 docs: distinguish hash presence from record confirmation 2026-11-21 19:06:07 +00:00
df86dba224 docs: scope the motion-matcher sample 2026-11-21 19:04:30 +00:00
2a0a77f15b docs: scope the bone-table resource count 2026-11-21 19:04:04 +00:00
018fda6d82 tools: parse RBF0 rig sets and bone-table resources 2026-11-21 19:02:31 +00:00
fa54b20fc5 docs: state the RBF0 block-boundary evidence 2026-11-21 18:40:02 +00:00
672ecbb8eb docs: tighten the measured claims and caveats 2026-11-21 18:38:54 +00:00
63e0069eb7 docs: correct type-hash and packed-clip measured counts 2026-11-21 18:38:15 +00:00
5e79a65c68 docs: identify the name-table hash as joaat32 of the path stem 2026-11-21 18:37:12 +00:00
0c2b4f6783 docs: exact packed-clip counts and manifest comparison 2026-11-21 18:34:32 +00:00
3b569cd4e7 docs: use exact readable percentages 2026-11-21 18:33:12 +00:00
d5c861cc8f docs: clarify RBF0 token counts and page-count range 2026-11-21 18:32:31 +00:00
dc26450232 docs: correct observed 0DRP page-count range 2026-11-21 18:31:21 +00:00
319f984226 docs: measured animation archive composition and container index 2026-11-21 18:30:05 +00:00