Drop the superseded 94.6% story000 normals row, resolve the self-contradictory 0x21..0x28
attribute sentence, update PSIN/0DRP decoder items, and list meshlet_page.py check flags.
AI-assisted: Antigravity gemini-4-neon.
Also: #2490's committed conflict markers in fssm_crosscheck.md resolved to main's text, the SHADER-605 section
moved below the troubleshooting table it split, a header rule for the export-format table, two backticked
paths that name no Leonida file, and the BOM dropped from anim_move.py and its test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The doc's full walk had stopped at 72%, so story000.rpf was described from 256 MiB windows. A full
tools/story_index.py run now completes in about 10 minutes: 141,385 streams, 51.1% of the span readable,
9.61 GB unread (the raw RSC8 region), and no zlib candidate past 512 MiB. Adds the per-GiB table and the
class totals, and corrects two sampled conclusions: GiB 13 is not part of the empty RSC8 stretch (31,714
streams; only GiB 5-12 are empty), and GiB 15 is not Bink 2 only (3,702 0DRP page directories).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All 7,577 mesh streams parse (6 stop at non-mesh data after the chunks);
positions, faces, normals, tangents, radius and cones hold as in the minigame
archive (counts only); the stored centres match the box centre less often.
e = 0..4 occur; the bit-28-only rule read the 157 minigame meshlets with e = 2
at 1/8 m, where their radius covers none of them (157 of 157 at 1/4 m).
centre_step takes the exponent, coarse_steps counts e > 0, tests cover e = 1..3,
and the docs/story.md tables are recounted.
When several 42 40 blocks in a page have a group's vertex count, summarise_page took the nearest one before the
group. Nothing in the page orders them (in Q0 Q1 G0 G1 pages G0 is built on either block), so it now takes the
block whose vertex boxes are closest to the group's stored centres (centre_distance), keeping the old choice on
a tie. New counters groups_4240_several_blocks and groups_4240_block_by_centres.
Over all of story000.rpf: 16,059 groups have several blocks and 8,668 change block; opposed neighbouring faces
fall from 518,113 to 16,408 of about 36.7 M shared edges, and faces within ~25 degrees rise from 90.8% to 92.7%.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/audio.md still listed a custom RSC8 audio resource as the only
mission-side container not decoded, and story.md and restofworld.md
still called the RSC8 bodies opaque. rsc8_audio.md (ASSET-56) decoded
them: all 641,428 raw RSC8 headers in the package are AWC tag 0x5c
facial/lip-sync clips beside their Opus dialogue line, none outside an
ADAT bank and none holding an audio container. Re-measured on a local
1.0.2.1 copy with tools/rsc8_audio.py over all 22 archives (counts only).
restofworld.md also said its archives hold no audio banks; story-rest
holds 15 ADAT banks, the other five none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All 7,577 mesh streams parse (6 stop at non-mesh data after the chunks);
positions, faces, normals, tangents, radius and cones hold as in the minigame
archive (counts only); the stored centres match the box centre less often.
1,732 large, far meshlets in the minigame archive set it; read at 1/16 m their
radius covers the farthest vertex in 0 of them, at 1/8 m in 98.0% (99.9% with
the rounding allowance). centre_step and meshlet_centre take the bit,
centre_agreement uses each meshlet's step and counts coarse_steps; the
docs/story.md tables are recounted (centres 50.1% / 71.8%, radius 96.5% /
98.7%). Also fixes the docstring sentence #3033 garbled.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Axis octahedral 6+6 unorm (bits 14-19, 20-25), sin(half-angle) = (31 - f)/31
from bits 26-30, all-zero = no cone. Over the minigame archive (counts
only): 43,415 cones, axis within 25 degrees of the mean face normal for 82.0%,
every face inside within 0.05 for 97.8% (core_restofworld 74.9% / 99.7%).
meshlet_cone, cone_agreement under --cones, tests, docs/story.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Around the stored centre: it covers the farthest vertex in 95.3% of 142,613
minigame meshlets (97.5% allowing the centre's 1/16 m rounding) and 97.4% /
99.9% of 4,899 in core_restofworld; 99.9% are within 1.25x the tightest
radius (counts only). meshlet_radius, radius counts under --centres, tests,
docs/story.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unit vectors perpendicular to the stored normal: 98.9% of 7,520,441 minigame
tangent words within |dot| < 0.05; bits 30-31 are 3 or 0 in every one
(+1 / -1). tangents_4240, tangent_agreement under --normals, a test, and
docs/story.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checked against the summed face normals of the decoded positions (counts
only): 86.0% of 14.4M minigame vertices within 8 degrees, 1.5% opposed;
core_restofworld 66.3% / 11.3%, where 2% of groups are mostly inverted.
normals_4240 and normal_agreement, a --normals check, and docs/story.md with
the rule and the second-archive counts for positions, faces and centres.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rpf9-explorer's RageModelDecoder reads vertex slots this way; it sizes all
99,184 slot words of the minigame archive's 63 30 and 42 40 blocks (counts
only), so tag_stride replaces the per-tag table (for the six types seen) and
the archive walk gives identical totals. docs/story.md gets the tag/type
table, the +0x7C meaning (snorm16 UV scale, rpf9-explorer) and the slots
actually used (0-4, 11-15, 18; #2424 said 0-4 and 11-14).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
w2 bits 0-11, 12-23 and w3 bits 0-11 are x, y and z as (field - 2047) / 16.
meshlet_centre decodes them; --centres compares them with each meshlet's
vertex-box centre on 42 40 geometry: 49.8% of 427,839 axes in the same
1/16 m step and 71.4% within one over the minigame archive (counts only);
offset 2048, 1/8 m steps or swapped axes fit far worse. docs/story.md records
the rule, the controls, why the 63 30 test saw nothing (default words), and
what of the record is still open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slot 0 (tag 0x42, 8 bytes) is the (8, 16) position form rpf9-explorer's
RageModelDecoder already reads: bias f32x3 at +0x60, axis order at +0x6C,
scale f32x3 at +0x70; a = bits 8-31, b = bits 32-47 << 8 | bits 0-7,
c = bits 48-63. positions_4240 decodes it, the page checks count finite and
within-300 m positions, and --faces counts neighbouring-face agreement
(83.7% within ~25 degrees, 0.26% opposed over the minigame archive's
17.3M shared edges; counts only). The record key mode becomes axis.
docs/story.md gets the independent check and drops the open item.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
story_index gave any stream starting with a u32 of 2 or 3 and the bytes
01 01 00 00 the historical clip-stream signature, reported the count as a
version and called it a 24-byte header, even when only the eight-byte
prefix was present.
Reuse anim_index.aux_table from #2496 (u32 count 2 or 3, count
{u32 tag, u32 payloadBytes} pairs with first tag 0x101, every payload
inside the stream) and report the same record as anim_index: signature
clip-stream, count = entry count, no version, detail with the tags and
payload end. Streams that fail the check fall through to the generic
zero-prefix/text/raw handling. The tool still runs with python -I; the
other classes and the scan, directory and output paths are unchanged.
Synthetic tests cover the record, parity with anim_index, exact fit,
trailing bytes, payload overrun and oversized sizes, the bare and
truncated old prefix, wrong counts or first tags, and an archive scan.
Claim: https://github.com/ItsNotRexed/Leonida/issues/2300#issuecomment-7082717677
Depends on: #2496
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 42 40 block has a 0x80-byte header with the same slot words; tag 0x42
streams are 8 bytes a vertex and tags 0x21/0x26/0x27/0x28 4 bytes. Over
shared_minigame000.rpf 14,671 headers fit exactly and every one is followed
by a recognised chunk. The walk used to stop at these blocks; it now reads
1,569 streams instead of 335 (159,387 meshlets, 16.9M triangles), 0 left
unparsed. A 63 30 block slot past 4 takes its tag's stride. Positions and
attributes are not decoded. Counts only in docs/story.md; synthetic tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 45 shared_minigame000 streams that docs/story.md listed as undecoded float
records are mesh pages: 16-byte-aligned vertex blocks (a 0x60-byte header of
tagged slot offsets, then position/colour/normal/float2 streams) and meshlet
groups (<=128 vertices and triangles per meshlet, 7-bit packed triangles,
u16 vertex references). tools/meshlet_page.py walks them with layout checks
and writes counts only; tests build every page by hand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bvh_index, page_index, story_index, navmesh_index and psin_index:
- --limit 0 meant "no limit" (0 is falsy) and a negative --limit scanned
nothing and still exited 0 with an empty index. --limit must now be at
least 1 and --start 0 or more; argparse rejects anything else (rc 2).
- An empty .rpf crashed in mmap ("cannot mmap an empty file") and a file
shorter than the header word crashed in struct.unpack_from. bvh, page and
story now treat both as an archive with no streams.
- bvh_index directory mode: one bad archive no longer aborts the scan and
loses the results of the others; it is reported and skipped.
- A --start past the end of the archive is a one-line error (rc 2) instead
of a traceback (bvh also checked nothing and reported a negative span).
- page_index checks the output extension before the scan, not after it.
Docs: the accepted ranges and the empty-archive behaviour are written next
to each tool's usage in docs/{bvh,navmesh,page_directory,psin,story}.md.
Tests: synthetic cases for each tool; they fail on main and pass here.
Use the PSIN +4 first-section offset when it points at a known tag, keep the LSCH fallback, and test the header path. Label the RSC8 +8 field as a u32 rather than a proven size, and state that no RSC7 header was found instead of claiming absence.
Index story000, shared_minigame000, and their script/restofworld/bvh4 companions with the fixed carver. Record the measured PSIN section chain, 0DRP page headers, RSC8 v8001 headers, nested RPF9 sub-archives, Bink 2 video and the bounded story000 layout. Add a stdlib story_index.py and synthetic-header tests; no game payload or name is committed.