World sector grids in levels.rpf: decoder and sector-grid command #194
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!194
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/194/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-24 19:11 UTC · original
holdmysocks:claude/sector-grid→master· +397 −0 · 3 files · 2 commits · merged 2026-11-24 19:36 UTCWhat
The first eight PSO files of
levels.rpfare world sector grids (struct9c834886, 32-byte records). They come in three cell sizes: 1024 m, 512 m and 60 m. Each size has two kinds of list:The 60 m cell list is the world grid: 26,212 cells covering the playable area.
This PR adds a decoder to
sixng-core(sectorgrid.rs) and asixng sector-gridcommand. The command lists all eight grids with their kind, cell size and counts. It writes the world grid, or the grid that--entrypicks, as CSV, JSON and a mask PNG with north up.--cell-moverrides the cell size.Record layout (little endian):
xy53149a198fab3f0b56f5c799f24b342dMeasured
All of these were measured against the placements of every world map file (1.67 million entities).
xandyare real, because their joaat hashes match.65876a4d. For 37 of 46 of these values, the cells listed are exactly the cells under the map files' entity extents at 60 m. Every other cell size from 54 to 67 m scores 7 or fewer.Checked
cargo test -p sixng-core --lib sectorgrid: 6 tests on synthetic PSO files (no game data). They cover decoding, the map-group kind, rejecting a wrong schema, the north-up mask and floor rounding at 60 and 1024 m.sixng sector-grid -o …on the real archive finds all 8 grids, gives each its cell size, and puts every grid inside the height map's world box.Not known, not done
placements.