read the save's chunk blocks, and check the rock below the surface

A chunk's solid blocks are a palette of block ids, raw or zstd, and a
zstd frame of bit planes; a layer of a lone 0 is all air. With them,
vsmv verify compares the rock of every stored block below the surface
with the strata laid against our own heights, which predate the dry
seabed raise: 99.91% of 1.38 billion blocks match. Lava basalt near the
bottom, the granite of cave walls and structures, and columns whose
height differs explain all but 0.0011%, nearly all of that in one area
at the explored edge whose layer boundaries are not explained yet.

What the save has instead of stratum rock is tallied too, as the
ground truth the deposits phase can be checked against.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 11:59:26 +03:00
parent 53950a465c
commit 2c16f8caef
6 changed files with 335 additions and 17 deletions

View File

@@ -21,12 +21,16 @@ against a real save, and matches it:
| Rivers' distance to the nearest river | 100% of 6.5 million columns |
| Terrain height | 98.2% of 11.7 million columns |
| Rock at the surface | all but 14 of 11.7 million columns |
| Rock below the surface | 99.91% of 1.38 billion blocks; see below |
| Ore maps, 31 minerals | every pixel of 118 regions |
| Prospecting pick readings | 38 of 42 in the game's category; see Limits |
All but 0.02% of the other heights come from two passes that run after
the strata are laid: caves that open the surface, and the raise of dry
seabeds. Neither changes which rock is where.
seabeds. Neither changes which rock is where. Below the surface, all
but 0.0011% of the other rock comes from later passes too: lava in deep
caves turns the rock around it to basalt, and cave walls and
underground structures are built of granite.
=Plan.org= has the details.
** Building
@@ -35,6 +39,7 @@ You need:
- a C compiler;
- SDL3 (=brew install sdl3=);
- SQLite3;
- zstd (=brew install zstd=);
- a checkout of [[https://github.com/DaveGamble/cJSON][cJSON]] in =./cJSON=.
Nuklear and stb_image_write are vendored in =third_party/=.
@@ -186,14 +191,13 @@ save:
| =vsmv dump SAVE.vcdbs OUT= | PNGs of the maps the save stored |
| =vsmv verify SAVE.vcdbs DIR OUT= | regenerates everything the save stored and compares it; diff images go to OUT |
=verify= takes a few minutes, most of it on the terrain heights of
every stored chunk. It also compares the ore maps, and the prospecting
pick readings players took in the save, if there are any.
=verify= takes about five minutes, most of it on the terrain heights of
every stored chunk. It also compares the ore maps, the prospecting
pick readings players took in the save, if there are any, and the rock
of every stored block below the surface.
** Limits
- Only the /realistic/ world climate is supported, not /patchy/.
- Strata below the surface use the same code as the surface rock,
which is checked, but they are not checked against the save's blocks.
- Rivers' settings are not stored in a save. Without a =rivers.json=,
the mod's defaults are assumed.
- Other mods that change worldgen are not modelled.