Decode the whole-world height map (sixng heightmap) #145
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!145
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/145/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 12:46 UTC · original
holdmysocks:claude/world-heightmap→master· +374 −0 · 4 files · 1 commits · merged 2026-11-24 13:04 UTCLinear: SIX-96
What
sixng-core::heightmapdecodes theMHIUwhole-world height maps incommon.rpf.sixng heightmap [common] [-o <dir>] [--preview] [--map 0|1] [--check <map bake dir>]writes these files to<out>/heightmap/:heightmap.png: 16-bit greyscale, north up; 0..65535 spans min z..max z.heightmap.json: world box, metres per pixel, height scale, sea value and the formula to recover metres.hillshade.png(with--preview): a hill-shaded RGB preview.--checkcompares the heights with the map bake's 8 m collision top-surface grid (heights_8m.bin) and reports the statistics.Format (verified against the data)
MHIUsamples[offset + x]. The counts add up to the sample bytes exactly.min_z + v × 550/255, so one step is 2.16 m.Checked numbers
The reference is the collision top-surface grid from the map bake (8 m cells). The difference is height map minus collision, in metres.
Correlation with collision (sampled): 0.993 for copy 1 and 0.974 for copy 0. A least-squares fit gives z ≈ 2.17·v - 47.6, close to the header scale of 2.157·v - 50.
Spot points (copy 1):
The height map sits about one quantisation step below the collision top. That is expected, because the collision also counts roofs, bridges and props. As a far-field terrain or hillshade source it is good to about ±2 m. It is too coarse to locate ground holes smaller than about 10 m.
Not done