upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/models.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/models.md')
-rw-r--r--docs/models.md198
1 files changed, 156 insertions, 42 deletions
diff --git a/docs/models.md b/docs/models.md
index bebdfecd6..a65bebf39 100644
--- a/docs/models.md
+++ b/docs/models.md
@@ -20,8 +20,8 @@ reader. Commits `917e9b9..e293917` add upstream `v1.2` model-discovery changes (
20optional fragment pointers, skipping texture dictionaries in drawable-dictionary scans, 16-bit 20optional fragment pointers, skipping texture dictionaries in drawable-dictionary scans, 16-bit
21bone-palette indices, probe-count parity, and zero-radius drawables) plus BCPack BC1/BC3/BC4/BC5 21bone-palette indices, probe-count parity, and zero-radius drawables) plus BCPack BC1/BC3/BC4/BC5
22decoding (PR #7). A full ten-archive re-count at `e293917` recovers **382,781 models** (**+32,530** 22decoding (PR #7). A full ten-archive re-count at `e293917` recovers **382,781 models** (**+32,530**
23over `917e9b9`'s 350,251) with **0 decode failures**; the `levels.rpf` fragment, bone-binding and 23over `917e9b9`'s 350,251) with **0 decode failures**, **55,417 fragments** and **2,636,248,990
24triangle cells are not independently reproduced (see the table note), and the earlier 24triangles** (the `levels.rpf` cells from a full export, see the table note), and the earlier
25`917e9b9`, `c3708fb`, and `48557ea` measurements are kept below as controls. This page records the 25`917e9b9`, `c3708fb`, and `48557ea` measurements are kept below as controls. This page records the
26measured state; it is not a competing patch. 26measured state; it is not a competing patch.
27 27
@@ -60,22 +60,29 @@ effect of upstream `v1.2` PRs #8–#12:
60| `pack/story000_restofworld/...` | 1 | **3** | 3 | 0 | 0 | 0 | 2,620 | 0 | 0 | 60| `pack/story000_restofworld/...` | 1 | **3** | 3 | 0 | 0 | 0 | 2,620 | 0 | 0 |
61| `pack/story000/story000.rpf` | 4,195 | **7,461** | 4,156 | 3,305 | 0 | 0 | 39,861,747 | 0 | +1 | 61| `pack/story000/story000.rpf` | 4,195 | **7,461** | 4,156 | 3,305 | 0 | 0 | 39,861,747 | 0 | +1 |
62| `packs.rpf` | 26,389 | **26,585** | 23,720 | 2,865 | 2,865 | 26,585 | 64,966,572 | 0 | +2,551 | 62| `packs.rpf` | 26,389 | **26,585** | 23,720 | 2,865 | 2,865 | 26,585 | 64,966,572 | 0 | +2,551 |
63| `levels.rpf` | 235,330 | **343,327** | 130,239 | 213,088 | † | † | † | 71 | +29,327 | 63| `levels.rpf` | 235,330 | **343,327** | 130,239 | 213,088 | 50,731 | 59,544 | 2,509,947,536 | 71 | +29,327 |
64| `textures.rpf` | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 64| `textures.rpf` | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
65| `common.rpf`, `core_restofworld001` | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 65| `common.rpf`, `core_restofworld001` | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
66| **Total** | **270,819** | **382,781** | **159,511** | **223,270** | **†** | **†** | **†** | **72** | **+32,530** | 66| **Total** | **270,819** | **382,781** | **159,511** | **223,270** | **55,417** | **89,887** | **2,636,248,990** | **72** | **+32,530** |
67 67
68† `levels.rpf` was counted with `count.exe recover --verify`, which reports candidates, models, 68`levels.rpf` was first counted with `count.exe recover --verify`, which reports candidates, models,
69dictionary children, standalone models, rejects and decode failures only: no `levels.rpf` manifest 69dictionary children, standalone models, rejects and decode failures only, so its fragment,
70exists and the harness emits no fragment, bone-binding or triangle field. Those three `levels.rpf` 70bone-binding and triangle cells were open. A full `rpf9dump models <levels.rpf> <out>` export at
71cells, and the totals that would include them, are therefore **not independently reproduced**. The 71`e293917` (25 min, about 340 GB of OBJ, deleted afterwards) fills them from its manifest: 235,330
72other archives measure 4,686 fragments, 30,343 bone-bound and 126,301,454 triangles. 72candidates, 235,259 recovered, 71 not recovered, 343,327 entries, `fail=0`, the recovery count to
73the row. Its `Drawable` field is set on 130,239 entries and null on 213,088, the dictionary-children
74and standalone cells above (3,694 dictionaries have a single child, so counting shared offsets
75instead gives 126,545 / 216,782). `IsFragment` is true on 50,731 entries and `HasBoneBindings` on
7659,544; `Tris` sums to 2,509,947,536. The same counting on a fresh `data.rpf` export gives that
77row's 268 / 2,907, 1,758, 2,891 and 3,387,016. The other archives measure 4,686 fragments, 30,343
78bone-bound and 126,301,454 triangles.
73 79
74Every recovered entry was read back from its archive segments and decoded through 80Every recovered entry was read back from its archive segments and decoded through
75`RageModelDecoder.Decode`: **382,781 / 382,781 decoded, 0 decode failures**. The other archives 81`RageModelDecoder.Decode`: **382,781 / 382,781 decoded, 0 decode failures**. The other archives
76measure **236,311 meshes**, **104,183,438 vertices**, **126,301,454 triangles** and **512 embedded 82measure **236,311 meshes**, **104,183,438 vertices**, **126,301,454 triangles** and **512 embedded
77textures**; the `levels.rpf` mesh/vertex/triangle/embedded cells are not independently reproduced 83textures**; `levels.rpf` adds 3,854,587 meshes, 2,364,218,711 vertices, 2,509,947,536 triangles and
78(see the table note). 841,293 embedded textures (the export's own summary line), for **4,090,898 meshes**, **2,468,402,149
85vertices**, **2,636,248,990 triangles** and **1,805 embedded textures** over all ten archives.
79 86
80What moved between `917e9b9` and `e293917`: 87What moved between `917e9b9` and `e293917`:
81 88
@@ -129,7 +136,7 @@ entries are dictionary children.
129### Re-count at `e293917` 136### Re-count at `e293917`
130 137
131A full `rpf9dump models` re-run over the same archives at the current pin (the manifests are 138A full `rpf9dump models` re-run over the same archives at the current pin (the manifests are
132local; `levels.rpf` has a recovery count but no full OBJ export): 139local; `levels.rpf` was exported separately, see the table note above):
133 140
134| Archive | Rows | Non-fragment | Fragments | Delta vs `917e9b9` | 141| Archive | Rows | Non-fragment | Fragments | Delta vs `917e9b9` |
135|---|---:|---:|---:|---:| 142|---|---:|---:|---:|---:|
@@ -141,7 +148,8 @@ local; `levels.rpf` has a recovery count but no full OBJ export):
141| `story000_restofworld` | **3** | 3 | 0 | 0 | 148| `story000_restofworld` | **3** | 3 | 0 | 0 |
142| `common`, `textures`, `story000_script`, `core_restofworld001` | 0 | 0 | 0 | 0 | 149| `common`, `textures`, `story000_script`, `core_restofworld001` | 0 | 0 | 0 | 0 |
143| **Total, excluding `levels.rpf`** | **39,454** | **34,768** | **4,686** | **+3,203** | 150| **Total, excluding `levels.rpf`** | **39,454** | **34,768** | **4,686** | **+3,203** |
144| `levels.rpf` | recovery count only, see below | - | - | +29,327 | 151| `levels.rpf` | **343,327** | 292,596 | 50,731 | +29,327 |
152| **Total** | **382,781** | **327,364** | **55,417** | **+32,530** |
145 153
146The gain outside `levels.rpf` is fragments: upstream `v1.2` PRs #8-#12 recover zero-radius 154The gain outside `levels.rpf` is fragments: upstream `v1.2` PRs #8-#12 recover zero-radius
147fragments that the earlier export skipped (2,551 in `packs.rpf`, 594 in `data.rpf`), plus one 155fragments that the earlier export skipped (2,551 in `packs.rpf`, 594 in `data.rpf`), plus one
@@ -150,8 +158,8 @@ is 0.
150 158
151`levels.rpf` was re-counted at `e293917` (10 shards over 235,330 candidates): **343,327 models** 159`levels.rpf` was re-counted at `e293917` (10 shards over 235,330 candidates): **343,327 models**
152(130,239 dictionary children + 213,088 standalone), against 314,000 at `917e9b9` (206,981 160(130,239 dictionary children + 213,088 standalone), against 314,000 at `917e9b9` (206,981
153candidates; 130,225 children + 183,801). The +29,327 is a recovery count, not a row-for-row delta, 161candidates; 130,225 children + 183,801). The +29,327 is a recovery count, not a row-for-row delta.
154and no full OBJ export was run. Triangle totals were not re-run either. 162The full OBJ export at `e293917` (table note above) gives the same 343,327 rows.
155 163
156The last column is the `c3708fb` recovery for comparison. `story000`'s standalone count is 164The last column is the `c3708fb` recovery for comparison. `story000`'s standalone count is
1573,304 vs 3,305; the full new-pin standalone total is 190,765, 27 below the `c3708fb` 190,792. 1653,304 vs 3,305; the full new-pin standalone total is 190,765, 27 below the `c3708fb` 190,792.
@@ -248,9 +256,8 @@ reproduced the ten-archive total. The `48557ea` column is the pre-fix control:
248The `packs.rpf` row is the pre-dictionary-root control: at `917e9b9` that archive recovers 256The `packs.rpf` row is the pre-dictionary-root control: at `917e9b9` that archive recovers
24924,034 models (26,585 at `e293917`), and the other archives' new-pin counts are in the table above. 25724,034 models (26,585 at `e293917`), and the other archives' new-pin counts are in the table above.
250The rows here are the `c3708fb` measurements (190,792 models); the `917e9b9` re-count is 350,251, 258The rows here are the `c3708fb` measurements (190,792 models); the `917e9b9` re-count is 350,251,
251and the `e293917` re-count outside `levels.rpf` is 39,454. Triangle totals have not been re-run at 259and the `e293917` re-count outside `levels.rpf` is 39,454. The `e293917` triangle totals of all ten
252either new pin; the `e293917` `levels.rpf` geometry cells are not independently reproduced (see 260archives, `levels.rpf` included, are in the table above.
253the table note above).
254 261
255At `c3708fb`, every candidate is recovered, read back and decoded: 0 decode failures, 0 readback 262At `c3708fb`, every candidate is recovered, read back and decoded: 0 decode failures, 0 readback
256failures, no duplicate model names, and 2.22 billion triangles (1.95 billion before). The 263failures, no duplicate model names, and 2.22 billion triangles (1.95 billion before). The
@@ -443,22 +450,39 @@ records. No unhandled layout tag appears:
443- **Sentinels.** On each surface, 11 entries have every estimate 0 and 10 more have zero speeds with an 450- **Sentinels.** On each surface, 11 entries have every estimate 0 and 10 more have zero speeds with an
444 infinite time (`inf`). `inf` occurs in 38 road and 99 offroad blocks overall, so a parser must accept `inf` 451 infinite time (`inf`). `inf` occurs in 38 road and 99 offroad blocks overall, so a parser must accept `inf`
445 in these fields (it reads as "never reaches the test speed or distance"). 452 in these fields (it reads as "never reaches the test speed or distance").
446- **`fOverallRating` is a weighted mean of the other four ratings** (measured, confirmed to float noise). Over the 453- **`fOverallRating` is a weighted mean of the other four ratings** (measured, confirmed to float noise) on the
447 504 rating blocks, `fOverallRating` = 0.21 `fSpeedRating` + 0.38 `fHandlingRating` + 0.40 454 345 of the 504 rating blocks whose four parts are all above 10: there `fOverallRating` = 0.21
448 `fAccelerationRating` + 0.01 `fBrakesRating`: the four weights sum to 1, so handling and acceleration weigh 455 `fSpeedRating` + 0.38 `fHandlingRating` + 0.40 `fAccelerationRating` + 0.01 `fBrakesRating`, with a residual
449 about twice speed and brakes is 1%. The residual is at most 7e-5 on the 345 rating blocks whose four parts are 456 of at most 7e-5. The four weights sum to 1, so handling and acceleration weigh about twice speed and brakes is 1%.
450 all above 10, and differencing a key's road and offroad blocks gives the same 0.2100 / 0.3800 / 0.4000 / 457 Differencing a key's road and offroad blocks gives the same 0.2100 / 0.3800 / 0.4000 / 0.0100 on the 139 keys
451 0.0100 on the 139 keys that are above 10 on both surfaces, so the weights do not depend on the surface. 458 that are above 10 on both surfaces, so the weights do not depend on the surface.
452- **The same 10 floor is on the overall** (likely). 24 blocks whose four parts run 10.0 to 11.97 carry an 459- **The overall has the same observed minimum of 10.** The other 159 rating blocks each have at least one part
453 `fOverallRating` of exactly 10; and the other 159 rating blocks, which have at least one part at exactly 10, 460 at exactly 10, and the formula does not hold for them: they sit up to 4.1 below the weighted mean, and 24 of
454 sit up to 4.1 below the weighted mean, as parts raised to 10 from a lower value would, while no block without 461 them carry an `fOverallRating` of exactly 10. No block without a part at 10 deviates. The exports show only
455 a part at 10 deviates. 462 this minimum; they cannot tell where, or whether, the engine clamps.
456- **Scale.** The ratings are continuous floats, not a 0-1 or 0-100 score: 342 to 451 distinct values per field 463- **Scale.** The ratings are continuous floats, not a 0-1 or 0-100 score: 342 to 451 distinct values per field
457 over the 504 blocks, a floor of exactly 10, and `fAccelerationRating` the only field past 1,000 (22 blocks, 464 over the 504 blocks, a floor of exactly 10, and `fAccelerationRating` the only field past 1,000 (22 blocks,
458 maximum 1,327). 465 maximum 1,327).
459 466
460Not measured here (hypothesis): whether the estimates are precomputed from handling data or measured by 467Not measured here (hypothesis): whether the estimates are precomputed from handling data or measured by
461simulation, and what fixes the top of the rating scale. 468simulation, and what fixes the top of the rating scale.
469- **The estimates are a separate stored table, not the performance maps.** `common.rpf`'s data area at `0x9580`
470 also holds `CVehiclePerformanceMaps` (285 rows, 10 result fields) and `CTyreDataSet` (40 tyre types). 251 of the
471 252 estimate keys join the performance rows, but no field reproduces an estimate exactly: the best OLS over
472 all ten gives R^2 0.872, and `fAccelerationTime` against `accelZeroSixty` is R^2 0.811 with a median |residual|
473 of 0.54 s. The clearest relation is internal to the estimates: over the 231 rows with a finite top speed,
474 `fStandingQuarterTime = 6.73 + 401.0 / fTopSpeed` (R^2 0.99998, median |residual| 1.01 s; R^2 0.82 over the
475 209 rows under 30 s). For the seven top-speed-limited rows, `fTopSpeed * fStandingQuarterTime` is
476 402.339 +/- 0.0003 m, a quarter mile; the residual tracks the 0-60 time.
477- **The ratings are deterministic functions of the estimates.** Each of the 223 distinct road top speeds gives
478 one `fSpeedRating`; handling/corner has 221 levels, acceleration/acceleration time 204, brakes two collisions,
479 and `fOverallRating` uses more than one field. The rating scale and the overall weighting are still not fitted.
480- **The handling inputs are not in the readable archives.** No `CHandlingData`/`handling.meta`, `fMass`,
481 `fInitialDriveForce`, `fInitialDragCoeff`, `nInitialDriveGears`, `fTractionCurve*`, `fBrakeForce` or
482 `fSuspensionForce` occurs in `common.rpf`, `data.rpf`, `packs.rpf` or `script.rpf`; the executable is absent.
483 `levels.rpf` is map data and was not fully scanned. The table is therefore consistent with an offline
484 estimator fed by handling-derived scalars, but whether it was fitted to handling or copied from a simulation
485 cannot be verified from this package.
462 486
463## Character skeletons 487## Character skeletons
464 488
@@ -485,9 +509,11 @@ python -I tools/character_census.py <models-dir-or-manifest> [--json FILE] [--cs
485It reads every nested `model.json` (the decoded-pack layout: `type`, `vertex_count`, 509It reads every nested `model.json` (the decoded-pack layout: `type`, `vertex_count`,
486`triangle_count`, `materials[].shader_name_hash`, `materials[].textures[].hash64`, 510`triangle_count`, `materials[].shader_name_hash`, `materials[].textures[].hash64`,
487`drawable.skeleton`/`drawable.models[].bone_palette` and `meshes[].skin_influences`), or the 511`drawable.skeleton`/`drawable.models[].bone_palette` and `meshes[].skin_influences`), or the
488`Items[]` of a manifest (`Verts`, `Tris`, `IsFragment`, `HasBoneBindings`, `Materials[]`). It 512`Items[]` of a manifest (`Verts`, `Tris`, `IsFragment`, `HasBoneBindings`, `Materials[]`). The
489prints one row per model with kind, vertex/triangle counts, bones, 8-influence skin, shader 513local exporter does not write an index count, so the index column and total normally stay unknown;
490hashes and texture keys, then totals by kind and by shader hash. A missing or wrongly typed field 514an input that supplies `index_count` is counted, but the field is optional and not part of the
515decoded layout. It prints one row per model with kind, vertex/triangle counts, bones, 8-influence
516skin, shader hashes and texture keys, then totals by kind and by shader hash. A missing or wrongly typed field
491is reported on that row instead of ending the run. An `rpf9dump models` manifest records only 517is reported on that row instead of ending the run. An `rpf9dump models` manifest records only
492`HasBoneBindings`, not a bone count or influence width, so those cells stay `?`. Report paths that 518`HasBoneBindings`, not a bone count or influence width, so those cells stay `?`. Report paths that
493alias an input are refused. The tests are synthetic: `python -I tests/test_character_census.py`. 519alias an input are refused. The tests are synthetic: `python -I tests/test_character_census.py`.
@@ -517,6 +543,11 @@ Names are per model and a building holds glass, decal and opaque shaders alike,
517in absolute terms; the enrichment against bucket 0 is the signal. For export: bucket 1 needs blending, 2 is 543in absolute terms; the enrichment against bucket 0 is the signal. For export: bucket 1 needs blending, 2 is
518a projected decal, 3 needs alpha testing, 6 is a water surface. 544a projected decal, 3 needs alpha testing, 6 is a water surface.
519 545
546`common.rpf` carries the matching preset-to-effect table (`SPS1`, decoded by `tools/gamedata_sps1.py`,
547[`gamedata.md`](gamedata.md#sps1-shader-preset-table)): `858` `.sps` presets map onto `539` `SGD5` Database 0 effects
548with a default `u8` render bucket (`0..7`), `63` effects accept multiple buckets, and the single bucket-`4`
549and bucket-`5` presets both resolve to effect `fc34f08b`.
550
520## Material shader hashes and the carved programs 551## Material shader hashes and the carved programs
521 552
522`rpf9dump` also writes each material's shader hash (`manifest.json` → `Materials[].Shader`, u32 as 8 hex digits). 553`rpf9dump` also writes each material's shader hash (`manifest.json` → `Materials[].Shader`, u32 as 8 hex digits).
@@ -635,7 +666,21 @@ They are reachable through the **effect records** in `shaders.rpf` (found by @je
635are little-endian: 666are little-endian:
636 667
6371. **The effect record.** It starts with a one-byte name length and the name, including its terminator, then a 6681. **The effect record.** It starts with a one-byte name length and the name, including its terminator, then a
638 u32 whose meaning is not known. Six stage lists follow, each a u32 count and that many u32 ordinals. 669 u32 (below). Six stage lists follow, each a u32 count and that many u32 ordinals.
670
671 The u32 is a size computed from the record's own counted fields (@jeremygold02). Let G be the ordinals in the
672 six lists, T the techniques, P the passes, and W the post-pass word count. Let A and B be the two block
673 lengths after them, E the post-pass entry count, I the payload bytes of the entries whose tag is a length
674 (not `0x80000000`), and S the string-pool length. Lengths don't count their own prefixes. Then, with
675 `x = 4W + A + B`:
676
677 ```text
678 word = 48 + 8(G + T + E) + 32P + I + S + (round_up(x, 8) if E else x)
679 ```
680
681 This holds for all 932 records of this build (910 + 22, recomputed here). The value never equals the record's
682 serialized length (0 of 932), so the next record is found by the sequential walk, not by this word. What the
683 runtime uses it for is unknown. Groups 3 and 4 are empty here, so their share of it is unmeasured.
639 684
640 `shaders.rpf` holds **two shader databases** (SGD5), and an ordinal counts within one of them (found by 685 `shaders.rpf` holds **two shader databases** (SGD5), and an ordinal counts within one of them (found by
641 @jeremygold02). Each database stores six program groups, each a u32 count followed by its programs. A program 686 @jeremygold02). Each database stores six program groups, each a u32 count followed by its programs. A program
@@ -682,7 +727,8 @@ record, technique and pass. The record and pass format below was also checked by
682 727
683Two things are still open: 728Two things are still open:
684 729
685- **The u32 after an effect's name.** What it means is still unknown. 730- **The u32 after an effect's name.** It is reproduced from the record's fields; how the runtime uses it is
731 still unknown.
686- **Which technique and pass the game draws with.** That is a run-time choice; it is presumably made in the 732- **Which technique and pass the game draws with.** That is a run-time choice; it is presumably made in the
687 executable (RT-5). 733 executable (RT-5).
688 734
@@ -713,15 +759,29 @@ vehicle models to far-away light recipes. Counts only; no model names.
713 this build the document is an index from model and variant to recipe with the light positions absent, 759 this build the document is an index from model and variant to recipe with the light positions absent,
714 so distant vehicle lights cannot be reconstructed from it. 760 so distant vehicle lights cannot be reconstructed from it.
715 761
762To reproduce the joins, locate the XML roots in the [common carve catalog](gamedata.md) with
763`python -I tools/gamedata_xml.py <common-carve-dir> --json xml.json`. Trim and lowercase the field
764text, then match each nonempty `CVehicleDistantLightData/recipeLights/Item` by `vehicleModelName`
765and its sorted list of `secondaryRecipes/Item` values against `vehicleName` and the same list on
766`CPaletteIndexedRecipeTintsArray` rows at `.//recipeCombinations/Item`. For the carriage check,
767expand the light lists to distinct pairs and compare with `CTrainConfigs` rows at `.//carriages/Item`.
768
716The sampled `CPaletteIndexedRecipeTintsArray` document reuses 746 of the 780 distinct distant-light 769The sampled `CPaletteIndexedRecipeTintsArray` document reuses 746 of the 780 distinct distant-light
717secondary tokens in its own `secondaryRecipes` field. Of the 1,668 distant-light rows with at least one 770secondary tokens in its own `secondaryRecipes` field. Of the 1,668 distant-light rows with at least one
718token, 1,339 match a palette recipe on both vehicle name and the complete token list, ignoring case and 771token, 1,339 match a palette recipe on both vehicle name and the complete token list, ignoring case and
719token order. Replacing each vehicle name with the next of the 319 lowercased names in sorted order 772token order. Replacing each vehicle name with the next of the 319 distinct names from all light rows in sorted order
720(wrapping at the end) and keeping its tokens fixed gives 56 matches among the same 1,668 rows. 773(wrapping at the end) and keeping its tokens fixed gives 56 matches among the same 1,668 rows.
721 774
775For a single-token comparison, the distant-light rows give 1,547 distinct (vehicle, secondary token)
776pairs. Four match the `modelName` and `modelSetName` fields on the same `CTrainConfigs` carriage row,
777after trimming whitespace and ignoring case. These four pairs cover two vehicle models and four model
778sets. Rotating the 319 vehicle names as above gives zero matching pairs. Keeping the vehicle fixed and
779rotating the 780 distinct tokens in sorted order, with wraparound, gives two matching pairs.
780
722In the 34-row `CVehicleBoneOffsetsArray` document, 0 of the 780 distinct tokens match a whole text or 781In the 34-row `CVehicleBoneOffsetsArray` document, 0 of the 780 distinct tokens match a whole text or
723attribute value case-insensitively. In the 2,447-row document of the same type, 178 of the 780 match 782attribute value case-insensitively. In the 2,447-row document of the same type, 178 of the 780 match
724`boneOffsets/Item/name`. These comparisons establish recipe reuse across the light and palette documents. 783`boneOffsets/Item/name`. All 2,447 rows have empty `vehicleName` fields, so those name matches provide
784no same-row vehicle association.
725Which physical parts or liveries a token selects, and where the runtime obtains light positions, remain open. 785Which physical parts or liveries a token selects, and where the runtime obtains light positions, remain open.
726 786
727## Skinned GLB export 787## Skinned GLB export
@@ -739,21 +799,75 @@ the drawable's local joint palette through the drawable and ped tables, and emit
739in [character_skeleton.md](character_skeleton.md#skinned-glb-export). On the 1.0.2.1 package, the 799in [character_skeleton.md](character_skeleton.md#skinned-glb-export). On the 1.0.2.1 package, the
740head (8,983 v) and biker jacket (9,818 v) produce one skin with 596 ped joints (703 with the 800head (8,983 v) and biker jacket (9,818 v) produce one skin with 596 ped joints (703 with the
741jacket's `GM_U01_*` helpers); every weight sums to 255 and the rest-pose reconstruction error is 801jacket's `GM_U01_*` helpers); every weight sums to 255 and the rest-pose reconstruction error is
7426e-8 m. `python -I tests/test_skinned_glb.py` runs 10 synthetic tests and needs no game files. 8026e-8 m. `python -I tests/test_skinned_glb.py` runs 19 synthetic tests and needs no game files.
7436e-8 m. `python -I tests/test_skinned_glb.py` runs 15 synthetic tests and needs no game files. 803
804`tools/glb_inspect.py` reads such a GLB back without a library, so an export can be checked
805before it is opened in a viewer:
806
807```
808python -I tools/glb_inspect.py out.glb [--json report.json]
809```
810
811It prints the chunk layout and padding, the `counts` of scenes, nodes, meshes, materials, images,
812skins and animations, each mesh's primitive, vertex and triangle counts, each material's
813`baseColorTexture`, each skin's joint count, each animation's channels and duration, and the
814POSITION bounding box (marked `partial` when a POSITION accessor has no `min`/`max`). It reports
815what the JSON chunk says — a field the exporter dropped reads `(missing)` — and never infers
816geometry from the BIN chunk. Standard library only; no game files.
744 817
745## What to do next 818## What to do next
746 819
7471. **Done:** [rpf9-explorer PR #1](https://github.com/breadbbbb/rpf9-explorer/pull/1) is merged upstream. 8201. **Done:** [rpf9-explorer PR #1](https://github.com/breadbbbb/rpf9-explorer/pull/1) is merged upstream.
7482. **Done:** the pin is `e293917` (was `917e9b9`, originally `48557ea`). 8212. **Done:** the pin is `e293917` (was `917e9b9`, originally `48557ea`).
7493. **Done:** all ten `MODEL_ARCHIVES` were re-counted and read-back decoded at `e293917` (**382,781 8223. **Done:** all ten `MODEL_ARCHIVES` were re-counted and read-back decoded at `e293917` (**382,781
750 models**, **0 decode failures**; table above; the `levels.rpf` geometry cells are not 823 models**, **0 decode failures**; table above, `levels.rpf` geometry from a full export).
751 independently reproduced).
7524. Investigate the 71 remaining unrecovered fragment candidates in `levels.rpf` (and the 1 8244. Investigate the 71 remaining unrecovered fragment candidates in `levels.rpf` (and the 1
753 texture-dictionary candidate in `textures.rpf`) if further upstream recovery is wanted. 825 texture-dictionary candidate in `textures.rpf`) if further upstream recovery is wanted.
7545. Keep issue #29 in sync with the `e293917` counts. 8265. Keep issue #29 in sync with the `e293917` counts.
7553. **Done:** `tools/rpf9dump models` was re-run over the model-bearing archives at `e293917`; 8273. **Done:** `tools/rpf9dump models` was re-run over the model-bearing archives at `e293917`;
756 the six non-`levels.rpf` archives total 39,454 rows (+3,203, almost all recovered fragments). 828 the six non-`levels.rpf` archives total 39,454 rows (+3,203, almost all recovered fragments).
757 `levels.rpf` has a recovery count (343,327 models, +29,327) but no full OBJ export; triangle 829 `levels.rpf` has the same 343,327 rows in a full export (50,731 fragments, 2,509,947,536
758 totals were not re-run. 830 triangles).
7594. Keep the README and issue #29 in sync with the new counts. 8314. Keep the README and issue #29 in sync with the new counts.
832
833### Predict model offsets for placements
834
835Run `python -I tools/world_drawable_lookup.py entities.jsonl archetypes.json names.json`
836with the placement rows from `world_index.py --entities-out`, the definitions from
837`world_archetypes.py`, and a bounded `rpf9_names.py --types dr,ft` report. The command
838prints local scratch JSON. Supply `--manifest path/to/models/manifest.json` for each
839existing export whose listed identities should be excluded.
840
841The lookup requires agreement between the placement archetype, the definition's name and
842assetName, the resource stem's joaat and its 64-bit placement key. It considers type 1
843fragments and type 2 drawables at page offset +16. Multiple offsets for an identity in
844the indexed window are marked ambiguous. Even a single hit is a prediction: a stream
845can mention another model. Export a window around the predicted offset with
846`rpf9dump models <archive> <outdir> --start BYTES --length BYTES`, compare the manifest offset and
847model identity and run `world_build.py --placements` with the exported geometry.
848
849Save the lookup JSON and run
850`python -I tools/world_drawable_verify.py lookup.json first/models/manifest.json second/models/manifest.json`
851to verify single-offset predictions. Supply completed normal model manifests from the
852same source archive. The verifier reads cached JSON only. It uses the world builder's
853name hashes and counts each identity and its placements once. A matching offset and both
854hashes confirm an observation, including dictionary children sharing an offset. The local
855report counts repeat exact observations and lists other offsets for the same identity.
856Without an exact match, a different name at the offset takes precedence over a matching
857identity elsewhere. The coverage flag independently records whether the predicted offset
858falls in a supplied scan (start inclusive, end exclusive). A full scan covers all offsets.
859A covered prediction with no named evidence remains missing. Geometry loadability is
860checked separately by running the normal world builder on confirmed placement rows.
861
862Add `--window-bytes BYTES` to recommend one scan in the name index's archive.
863The optional `export_window` field gives the decimal `start` and `length` for
864`rpf9dump models`. It maximizes the sum of unmatched placement rows with a
865single predicted offset in that index. Each identity contributes its placement
866count once. Ambiguous identities contribute zero. For a tie it takes the earliest
867last offset, then trims the interval to its first and last included bytes.
868An empty selection yields JSON null. Run the lookup separately for each archive.
869
870The budget bounds the half-open range of candidate **starts**. The exporter can
871inspect prefix bytes and read model segments beyond the range. The report
872predicts coverage. Confirm identities and offsets in the exported manifest and
873check the resulting placement count with `world_build.py`.