Commit Graph

55 Commits

Author SHA1 Message Date
0cbc40239b world_lights_paths: read pool references through world_index.split_pointer
Meta.ref took the block number from bits 0..11 and refused any value with
bits 12-19 set as a pool reference, so a pointer to block 4,096 or above
fell through to the system-pointer path. Those bits are the high bits of the
20-bit block number. The guard did not screen system pointers either: with
fewer than 4,096 blocks, a value with bits 12-19 set has a 20-bit block number
above the block count, so it still reaches the system-pointer path.

Over levels.rpf (188,449 0x7a resources, 8,576 with lights) the summary is
byte-identical with the old and the new decoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:49:18 -05:00
9898deecbb instance_lists, world_interior_names: read the block number from 20 bits, as world_index and psin_data do
A 0DRP/PSIN pool pointer keeps the 1-based block number in its low 20 bits
and the byte offset above (docs/psin.md, docs/ped_catalogues.md, psin_data).
instance_lists and world_interior_names masked 12 bits, as docs/world.md
said, so a block number of 4,096 or more would have been read as a wrong block.

world_index.split_pointer is now the one decoder for the three tools, and
docs/world.md gives the 20-bit form. Over the 0x7a resources of levels.rpf,
story000.rpf, shared_minigame000.rpf and packs.rpf (232,846), the most blocks
one has is 1,760, and every non-null 0x52 array and 0x42 string pointer has
bits 12-19 at zero, so the counts the tools report don't change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:49:18 -05:00
ff181e07c8 Merge pull request #3863 from inerthel-agi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:01 -05:00
79313d10dc Merge pull request #3827 from Ewann
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:41 -05:00
54190bac37 Merge pull request #3826 from Kacper Serewis
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:40 -05:00
cf880bea0b Merge pull request #3813 from Mast3rL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:36 -05:00
475ed5660f world_interior_names: cap pool workers, survive unpositioned placements, clean input errors
- The pool goes through pool_workers.process_workers (61 at most on Windows) and the window count
  follows it, so --jobs above the cap no longer fails at pool creation or re-reads extra overlaps.
- A key whose placements carry no position is counted (keys_without_a_placement_position) instead
  of ending the run in min() over nothing; inner-item Pos values that are not three finite numbers
  (empty, false, too short, past float range) are dropped and counted (malformed_positions).
- The interior-box distance uses the same 1e-6 m face tolerance as the room test (EPS), so a point
  on a rotated interior face counts as inside in both measures.
- A names file that is not an InteriorNames table, --start outside the data area (checked before
  any worker starts), a negative --start and --limit below 1 each give one line and exit 2.

Full levels.rpf v1.0.2.1 (--jobs 15): summary identical before and after, both new counters 0,
docs/world.md counts unchanged. tests/test_world_interior_names.py: 27 OK (was 20); the 8 new
tests all fail on d90c1ac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:07:53 -05:00
9593e78e94 docs/world: the material cross-check covers all five retained fragments (ASSET-305 review)
The five MaterialDataList fragments are contiguous pieces of one stream
without its head. All 14 isDeformableTerrain items are in the first one;
the later fragments hold no flag and no surface-material name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:39:55 +01:00
e710ea4ff0 docs/world: scope the material cross-check to visible flags; widths only (ASSET-305 review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:39:55 +01:00
3759d00007 docs/world: the 16 deformable-surface entries and the deformation map width (ASSET-305)
Measured on a 1.0.2.1 package: 11 defined surfaces and 5 empty slots, their
classes and physics-material counts, the isDeformableTerrain cross-check
against the retained MaterialDataList block, DeformationWorldSpaceWidth 96 m
and ParallaxWorldSpaceWidth 48 m, and the track-type split. The texel
resolution is not in the data files and stays open.

AI-assisted (Claude), on behalf of dev-ewann.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:39:55 +01:00
fcfed3996b world_interior_names: apply placement scale, guard --out, count duplicates
Address review on #3813:
- scale interior and room boxes by each placement's scaleXY/scaleZ before
  measuring (negative scales reorder the bounds); 6 of 2,590 placements are
  scaled, which moves two room hits per convention and no distances
- refuse an --out that names the archive, the --names file or a path in the
  carved folder (exit 2, one line, nothing written)
- count placed interiors only among known definitions; report placed names
  with no definition, duplicate interior definitions and repeated JSON keys
  (repeated keys keep all their items)
- emit the limbo first-room and a261e0a9 room-key counts the docs quote
- take the median from the already sorted list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:28:40 -05:00
5fdcf31720 fix(textures): filter sRGB DDS previews in linear light
Carry the DXGI transfer function through alpha-weighted preview resizing. Keep RGBA8 quantization stable on dark ties and cover the PNG bytes for tagged and untagged textures (BUILD-1087).
2026-11-22 23:06:02 +01:00
897df1d3ac Merge pull request #3813 from Mast3rL 2026-11-22 17:03:57 -05:00
e1630bd960 Document the limits of the material slot evidence (ASSET-296) 2026-11-22 22:52:15 +01:00
a8e8b154b0 world: resolve InteriorNames keys to interior archetypes and placements (ASSET-275)
Add tools/world_interior_names.py: reads CMloArchetypeDef, CMloRoomDef and
CMloInstanceDef from levels.rpf and joins them with the InteriorNames section
of GameShape__Data__LocationNameLoopkup. 1,357 of 1,358 keys are interior
archetype names, all confirmed by the 64-bit key; docs/world.md records the
placement and position measurements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:45:17 -05:00
f6d93ef060 Merge pull request #3249 from Jeremy Goldberg 2026-11-22 15:16:11 -05:00
fb50b87e64 Merge pull request #3087 from Jeremy Goldberg 2026-11-22 15:14:43 -05:00
712ac27091 feat(world-index): export authored placement and parent map identity
Use the map root reference array to retain entity ordinals across mixed classes and select the ordinary terrain parent map. Keep physical row order and optional metadata for incomplete inputs.

Refs: #3047, #3087
2026-11-22 14:50:56 -05:00
535e8c23c6 docs(world): clarify the identity needed for parent lookup
Refs: #3087
2026-11-22 14:47:31 -05:00
afa0cbb288 docs(world): identify the terrain parent-map selector
Verify the stored signed selector against both candidate maps, entity ordinals, proximity and incoming child counts.

Refs: #3087
2026-11-22 14:27:47 -05:00
ca1ffa657e docs(world): clarify cross-map terrain LOD parent lookup
Record the single referenced map case for terrain parents and the child-count, distance and name-hash checks across two regions.

Refs: #3047
2026-11-22 14:18:53 -05:00
897cca2e39 Merge pull request #2390 from itsRevela
# Conflicts:
#	docs/world.md
2026-11-22 13:14:37 -05:00
cb76dfbafe Merge pull request #2377 from Kam471
# Conflicts:
#	docs/related_projects.md
2026-11-22 13:14:24 -05:00
be3698f68d Merge pull request #2341 from alvaro-marquez-cobos
# Conflicts:
#	docs/world.md
2026-11-22 13:14:02 -05:00
999432707d Merge pull request #2329 from Leonardo Guimaraes 2026-11-22 13:13:55 -05:00
996191afab docs: record the measured RPF9, navmesh and PRD0 cross-checks 2026-11-22 18:13:27 +00:00
43b14b884c docs: world.md no longer says the pinned LooksLikeFragment rejects .#ft headers (PROC-121)
breadbbbb/rpf9-explorer#8 (null optional header pointers, range-checked
16-bit fields) and #10 are both ancestors of Leonida's pin e2939175, so the
pinned explorer accepts the fragment headers the sentence said it rejects.
Say that, keep the 41.3% as the figure at the earlier pin 917e9b9, and note
that the 99.96% was measured on 917e9b9 with #8/#10 applied, not recounted
at e2939175.
2026-11-22 10:54:37 -06:00
9c159e8285 docs: record the 6stars format facts that reproduce
Re-measured against the local package: the RPF9 stream boundary that ends a system prefix (and the negative on the 8 MiB rule), the PRD0 member type codes, and the navmesh polygon +4 packing. The navmesh road/pavement bit labels did not reproduce and are recorded as such. 6stars is cited as independent corroboration; no code was copied and the repository has no licence.
2026-11-22 16:48:48 +00:00
f425cfa0e1 Docs: distinguish historical and pinned fragment recovery (PROC-121) 2026-11-22 17:43:09 +01:00
fa3c76d318 docs: correct fragment recovery note for pinned explorer 2026-11-22 17:40:45 +01:00
cf021320e5 world_archetypes: read CMapTypes archetype definitions; check map extents (BUILD-557)
tools/world_archetypes.py reads the archetype structs of CMapTypes resources
(CBaseArchetypeDef, CMloArchetypeDef, CTimeArchetypeDef) by member hash, the
way world_index.py reads CEntityDef: name, assetName, assetType, bbMin/bbMax,
bsCentre/bsRadius, lodDist, flags. It imports world_index and world_census and
changes neither, so it does not touch the lines #1981 changes.

--check-extents rebuilds each fully-defined map's entitiesExtents from the
transformed archetype boxes. In levels.rpf 8-9 GiB the conjugated quaternion
reproduces 616 of 827 rotated maps (median error 0.16 mm), the stored one 236
(0.63 m), and the extents are computed without the entity scale.

docs/world.md: the member table, assetType measured against rpf9_names.py
(1 = fragment, 2 = drawable, 3 = drawable-like, no crossover), and the two
extents checks. Synthetic tests only, no game data.
2026-11-22 13:40:44 -03:00
840a6e3e32 world_lights_paths: map lights and the vehicle lane graph in levels.rpf (ASSET-102)
New stdlib tool on top of world_census.assemble and the world_index header
readers. Every field is read by member hash from each 0x7a resource's own
schema.

Lights: every CExtensionDefLightEffect reachable from the extensions list
of an archetype, interior archetype or entity, and its CLightAttrDef
lists. Counts per type, owner and resource kind, value ranges and checks.
With --entities (world_index.py --entities-out rows) archetype lights are
placed in world space through each map entity's transform, the same one
world_build.py --placements uses; --lights-out writes them (local only).

Lane graph: path nodes, links (lanes, flags, length) and junctions
(entrances, turns, traffic-light phases), with connectivity measured.

Full levels.rpf: 280,105 lights (450,195 placed through map entities),
63,808 nodes, 145,518 links, 1,546 junctions (369 signalised). The lane
graph equals SixNG's on every count; all 5,285 lights SixNG lacks come
from pool references at offsets 0x500..0x6ff that it reads as pointers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:52:58 +00:00
2b0ae9ebf8 Docs: CProceduralInfo tag table and its empty object/plant lists
The one CProceduralInfo document in common.rpf has a 255-slot procedural tag
table (107 names; one placeholder name fills 149 untagged slots) whose 66
procObj and 69 plant tags point into procObjInfos and plantInfos lists that
are both empty. No names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:25:41 +00:00
ace75cfb58 docs/world.md: building the whole city with instancing and LOD sets
Measured on levels.rpf: 1,549,343 HD/ORPHAN_HD placements in 2,940 chunks
(21 min) and all 1,669,771 placements in 12,340 tiered chunks (33 min), every
chunk checked structurally and samples parsed by three r160's GLTFLoader; the
LOD-tier medians and bands; what the viewer loads with and without bands; the
pin vs #8/#10 model coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:02:54 +00:00
15966bb361 Docs: location, interior, river and road name lookup
Counts over the one GameShape__Data__LocationNameLoopkup document in
common.rpf: 2,318 locations, 1,358 interiors with 2,280 positions (all
inside the PAMH / region tint rectangle), 66 rivers, 409 roads; keys are
their own namespace. No names or keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:15:04 +00:00
0163c1b5e4 Merge pull request #1222 from Lucy 2026-11-22 03:37:54 -05:00
807ee182d1 Merge pull request #1216 from Lucy
# Conflicts:
#	docs/world.md
2026-11-22 03:37:53 -05:00
8ca846b297 Merge pull request #1210 from Lucy 2026-11-22 03:37:51 -05:00
c62525e20c Docs: RegionTintMap covers exactly the PAMH heightmap rectangle
The one RegionTintMap document in common.rpf streams a 36 x 41 grid of
512-unit tiles that covers its world box with no partial tile, and that box
equals the PAMH max/min heightmap bounds in x and y. No names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:31:35 +00:00
d466f784fd Docs: train configs and groups (CTrainConfigs), and the stale trainConfigIndex
Counts over the one CTrainConfigs document in common.rpf: 46 configs, 314
carriages, 5 groups with 36 references. 11 of the 36 trainConfigIndex values
are one less than the named config's position, cleanly split at positions
23/26, so groups must be resolved by name. Carriage models cross-checked
against the .yft catalog. No names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:28:39 +00:00
29257a0cf5 Docs: deformable snow and mud tracks (CSnowTrackData)
Counts over the one CSnowTrackData document in common.rpf: 16 deep-surface
parameter sets with physics-material lists, 9 track types, mud/puddle,
global and trail-map blocks. Cross-checks: 13 of 24 material names occur in
the surviving part of MaterialDataList; the 9 texture names are not in the
local catalog. No values or names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:21:02 +00:00
1c56460bfb world_build: place models at their map placements (--placements)
world_build placed every model at its own coordinates or in rows; it never read the CEntityDef records.

- world_index.py --entities-out writes one JSON line per complete entity: archetype hash and 64-bit key,
  position, stored rotation, scales and LOD fields.
- world_build.py --placements matches each selected entity to an exported model the way world_names.py does
  (lower-cased joaat of the manifest name, confirmed by the Murmur3-64 key when the row has one). It then
  scales by (scaleXY, scaleXY, scaleZ), rotates by the conjugate of the stored quaternion, translates and
  converts to glTF Y-up. Normals use the inverse-transpose; a mirroring scale flips the winding.
  --lod-levels (default 0,5) and --region select the entities. world.json reports the count of each outcome
  in stats.placements.
- tests/test_world_place.py: 15 synthetic tests.
- docs/world.md: "Building a placed world", with measurements on a 700 m downtown box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:01:15 +00:00
ffab01d843 Merge pull request #1106 from cxchhh 2026-11-22 02:09:10 -05:00
b1388b6992 Docs: reconcile the census map count with SixNG's 30,785, map by map
SixNG's 7,257 extra resources have CEntityDef objects but no CMapData struct:
961 interior archetype resources (CMloArchetypeDef, 540,665 entities in interior
space) and 6,296 35abc248 entity groups (39,622 entities in group-local space).
The census has 7 maps (1,239 entities) that SixNG misses, whose entity data is in
a continuation page. Net 7,250 maps / 579,048 entities, the whole published gap.
The 23,528 maps both count agree on every entity count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:57:51 +00:00
7e990164a6 Docs: name two more grass-list members (slodID, SLODArchetypeList)
Found by joaat over common engine words; the member table gives offsets 0xB0
and 0x158.

AI-assisted (Claude).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:34:12 +00:00
3d62823f63 Docs: instanced props and grass in map resources (full corpus)
Follow-up to #936 (merged as b0f891c): documents the four instance-list
structs with their schema-named members, the InstanceList array format, and
the full run of tools/instance_lists.py over levels.rpf, story000.rpf and
shared_minigame000.rpf (237,318 map resources, 26.5 million prop and 225.5
million grass instances). Counts only.

AI-assisted (Claude). Measured on my own copy (1.0.2.1); docs only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:22:58 +00:00
8fa6b89f4c World names: whole-archive coverage, --archetypes-out and --rpf9-names
docs/world.md and docs/world_names.md said ~96% of archetypeName hashes stay
unresolved. That was a name-source limit of the two sampled windows: the
names are in levels.rpf, and rpf9_names.py already lists them. With its
name.#dr/name.#ft list as the dictionary, 99.85% of the 1,670,435 placement
entities resolve (99.94% with --max-inflate 256 MiB), every match verified by
the entity's 64-bit key.

- world_index.py --archetypes-out writes the aggregate archetype file that
  world_names.py resolve --archetypes reads (entity count and 64-bit key per
  hash); nothing in the repo produced it before. Entities of a resource that
  needs a continuation stream are counted once.
- world_names.py build --rpf9-names reads rpf9_names.py index JSON.
- docs: whole-archive coverage table, the four commands that reproduce it,
  and the corrected statements in world.md and docs/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:10:01 -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
8cd141e5a3 Merge pull request #305 from Kam471 2026-11-21 17:38:20 -05:00
5bc48f20b7 world_names: resolve placement/archetype hashes with 32-bit joaat and Murmur3-64
Measured on Xbox 1.0.2.1:
- archetypeName, map name and parent are lower-cased joaat.
- per-archetype +0x20 and map +0x10 keys are MurmurHash3 x64 128 low 64 (seed 0).
- +0x08 is a per-entity id, not a per-archetype hash.

A 79,738-name local dictionary resolves 5,107/24,105 distinct
archetype hashes (8,263/203,799 entities) in two bounded windows,
all confirmed by the 64-bit key; one 32-bit-only candidate is
rejected. Map names resolve 5/23,535 and parents 1/2,089.

Adds tools/world_names.py, synthetic tests, world_names.md, and
map_name64 to world_index output.
2026-11-21 22:36:32 +00:00