Commit Graph

42 Commits

Author SHA1 Message Date
1bde4706b1 docs(story): remove stale duplicate normals row and sync decoder status and CLI flags
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.
2026-11-26 22:12:54 -03:00
2e52b2f1d7 Docs after round 44: one row per topic, escaped literal pipes, one copy of each repeated line and list item, one i18n row per language
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>
2026-11-22 23:24:16 -05:00
f2f57e7935 Merge pull request #4651 from Lucy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:50 -05:00
7a4a1b566b Merge pull request #3806 from Alex Collini
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:34 -05:00
7708d11776 docs/story.md: the full story000.rpf index (141,385 streams), replacing "not reported as a full index"
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>
2026-11-23 03:44:56 +00:00
23abaa681f story.md: ASSET-294 pairing counts rerun on the merged tree (all 7,577 story000 pages parse now)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:25:50 +01:00
30475df3ae Merge main aa2988cc into #3806 2026-11-22 23:22:14 +01:00
5ddc9dd2e1 Merge pull request #3266 from James
# Conflicts:
#	docs/restofworld.md
2026-11-22 17:01:10 -05:00
241e620eab Merge pull request #3148 from Vonsek
# Conflicts:
#	docs/story.md
2026-11-22 17:00:44 -05:00
5273ed4046 Merge pull request #3069 from Vonsek 2026-11-22 17:00:30 -05:00
468edabf79 docs/story.md: story000 normals 94.5% (rounding, review); say the centre counts predate the step exponent 2026-11-22 22:46:02 +01:00
8e91c39545 docs/story.md: say which groups the 15,997 are; point the centre exponent at #3069 (ASSET-294)
Review fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:43:08 +01:00
4836eb7148 docs/story.md: the 42 40 rules over story000.rpf
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.
2026-11-22 22:41:23 +01:00
4a1b7b61be meshlet_page: w2 bits 28-31 are an exponent, step 2^e/16 m (review by zzEmmazz)
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.
2026-11-22 22:41:10 +01:00
f6fa3e36d1 meshlet_page: check a group against the 42 40 block its centres fit (ASSET-294)
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>
2026-11-22 22:40:40 +01:00
53f22894fc docs: RSC8 is decoded; correct the audio, story and rest-of-world pages (ASSET-260)
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>
2026-11-22 12:54:31 -08:00
b955277d43 meshlet_page: coarse_steps counts the w2 bit itself; story.md states the step rule once, with both steps (review) 2026-11-22 21:34:00 +01:00
fd3c38c759 Merge pull request #3148 from Vonsek 2026-11-22 15:15:11 -05:00
2ee952b5c1 Merge pull request #3069 from Vonsek 2026-11-22 15:14:32 -05:00
515584485c Merge pull request #3033 from Vonsek 2026-11-22 15:14:14 -05:00
f3617f1e74 Merge pull request #2991 from Vonsek 2026-11-22 15:13:52 -05:00
75d9c7b470 Merge pull request #2924 from Vonsek 2026-11-22 15:13:14 -05:00
6a801497ab docs/story.md: the 42 40 rules over story000.rpf
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.
2026-11-22 20:41:08 +01:00
bd1f962745 meshlet_page: meshlet record w2 bit 28 doubles the centre step (1/8 m, +-256 m)
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>
2026-11-22 20:16:26 +01:00
4c99e1dbae meshlet_page: meshlet record word +12 bits 14-30 are the normal cone
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>
2026-11-22 20:09:16 +01:00
8b600152bf meshlet_page: meshlet record word 0 bits 16-31 are the f16 bounding-sphere radius
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>
2026-11-22 20:02:35 +01:00
38f893325a meshlet_page: 42 40 slots 11 and 18 are tangents (10:10:10, sign in bits 30-31)
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>
2026-11-22 19:55:13 +01:00
94a46f6311 meshlet_page: 42 40 slot-2 normals (octahedral 10+10 for type 1, 10:10:10 for type 7)
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>
2026-11-22 19:45:38 +01:00
4102dcfd08 Merge pull request #2745 from Vonsek 2026-11-22 13:17:30 -05:00
732f2d0a2a Merge pull request #2670 from Vonsek 2026-11-22 13:16:57 -05:00
20ac4599cc Merge pull request #2639 from Kacper Serewis 2026-11-22 13:16:43 -05:00
a2ef9e8dc4 meshlet_page: the slot tag byte is (stride / 4) << 5 | type; +0x7C is the UV scale
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>
2026-11-22 19:06:56 +01:00
1e5ac8a233 meshlet_page: meshlet record words +8/+12 are the meshlet's centre (1/16 m steps)
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>
2026-11-22 18:47:18 +01:00
bdc05cc840 meshlet_page: decode the 42 40 packed positions; +0x6C is the axis order
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>
2026-11-22 18:36:44 +01:00
27546ddc2b story_index: validate the 0DRP auxiliary table before labelling it clip-stream
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>
2026-11-22 18:22:41 +01:00
4c06877f6e meshlet_page: size the 42 40 00 00 vertex blocks and walk past them (ASSET-146)
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>
2026-11-22 17:59:30 +01:00
a78d53cf8b ASSET-51: decode the 63 30 00 00 pages as vertex blocks and meshlet groups
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>
2026-11-22 02:31:58 +00:00
76b7b5b329 Index tools: refuse --limit/--start values that scan nothing, survive empty archives
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.
2026-11-21 23:21:29 +01:00
0412c8c794 story: avoid implying the flat carve groups nested archives 2026-11-21 19:52:06 +00:00
40a3c595e1 story: state the bounded run stop accurately 2026-11-21 19:50:28 +00:00
cfb5f9a329 story: tighten PSIN header handling and measured field wording
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.
2026-11-21 19:49:55 +00:00
ec1dbca94f Docs: measure story and minigame archive composition
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.
2026-11-21 19:46:43 +00:00