show what the prospecting pick reads, and find it

The ore maps GenDeposits makes are ported and match the save's for all
31 minerals in every stored region. With them and the strata, a column
reads as the pick's density mode would read it: a Minerals overlay
colours the map by reading, the probe lists every mineral the pick
finds, and Find nearest looks for a mineral read at least so high.

Readings run slightly high: the pick's column already holds the ore of
its chunk's deposits, which are not generated yet. The check against
the 13 readings stored in the save asserts exactly that direction.
Silver, gold and peridot are read from ore inside other deposits, so
they wait for the deposits themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 22:02:34 +03:00
parent 75d734c2d6
commit e174bff7e2
12 changed files with 1310 additions and 80 deletions

View File

@@ -5,7 +5,8 @@ settings, and it generates the world the way the game would and shows
it as a zoomable top-down map: terrain, rivers, oceans, climate,
landforms, geologic provinces, and rock strata at any depth. It is
mostly for finding rock: where chalk, bauxite or limestone lie, at the
surface or 20 blocks down, and which one is nearest.
surface or 20 blocks down, and which one is nearest. It also shows
what the prospecting pick would read for an ore, anywhere on the map.
[[file:doc/screenshot.png]]
@@ -20,6 +21,8 @@ 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 |
| 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
@@ -68,12 +71,15 @@ Options:
| =--assets DIR= | where the game's =assets= are; default =./assets= |
| =--zoom Z= | blocks per screen point, 1/16 to 32; default 4 |
| =--base LAYER= | the base layer: =ocean=, =rivers= or =height=; default =height= |
| =--overlay NAME= | turn on an overlay: =landform=, =climate=, =province=, =upheaval=, =strata=, =rock=; repeatable |
| =--overlay NAME= | turn on an overlay: =landform=, =climate=, =province=, =upheaval=, =strata=, =rock=, =mineral=; repeatable |
| =--opacity F= | overlay opacity, 0 to 1; default 0.5 |
| =--rock-depth N= / =--rock-y Y= | rocks at N blocks under the surface, or at height Y |
| =--rock-any= | the one highlighted rock at any depth |
| =--highlight ROCK= | highlight a rock, e.g. =chalk=; repeatable |
| =--find= | find the nearest highlighted rock on start |
| =--mineral CODE= | show a mineral's readings, e.g. =nativecopper= |
| =--min-reading NAME= | Find nearest's least reading for minerals, e.g. =high= or =very-poor=; default =decent= |
| =--find-mineral= | find the nearest such reading on start |
| =--probe X Z= | probe the column at block X, Z on start |
| =--screenshot FILE.png= | wait until everything is drawn, save the window, quit |
| =--mouse X Y= | place the cursor, for screenshots |
@@ -91,13 +97,14 @@ The map fills the middle of the window, between two panels.
*** The map
- Drag with the left mouse button to pan.
- Scroll to zoom, around the cursor.
- Click (without dragging) to probe that column: its rock strata appear
in the Probe section, and a numbered pin marks the place. Click a pin
to probe it again.
- Click (without dragging) to probe that column: its rock strata and
the prospecting pick's reading there appear in the Probe section, and
a numbered pin marks the place. Click a pin to probe it again.
- With /Rock under cursor/ on, a label by the cursor names the rock
under it, as the Rocks section is set (at the surface, at a depth, or
at a height). At any depth, it gives the Y of the rock's topmost block
and how far down that is, or says the column has none.
and how far down that is, or says the column has none. With the
Minerals overlay on, a second line gives the mineral's reading.
The further out you zoom, the coarser the terrain is sampled: every
block when zoomed in close, one in 32 when far out. Only what is on screen is computed;
@@ -122,7 +129,9 @@ when nothing is left to compute, the viewer sleeps.
Below it, how many tiles are still being generated.
- *Probe*: the last column probed: its surface height and its strata,
top down, with the Y range and thickness of each.
top down, with the Y range and thickness of each. Below them, what
the prospecting pick reads there: every mineral it finds, highest
first, with its parts per thousand, then the miniscule amounts.
- /Go to/ centres it.
- /Clear pins/ removes the pins.
- /Close/ hides it.
@@ -131,8 +140,8 @@ when nothing is left to compute, the viewer sleeps.
- *Layers*:
- *Base*: one of Ocean, Rivers or Terrain height. Drawn opaque.
- *Overlays*: any of Landform, Climate, Geologic province, Upheaval,
Rock strata thickness (pick the stratum below it) and Rock. Drawn
over the base at the /Overlay opacity/.
Rock strata thickness (pick the stratum below it), Rock and
Minerals. Drawn over the base at the /Overlay opacity/.
- /Story locations/ marks spawn and the story structures.
- /Rock under cursor/ turns the cursor label on and off.
- *Rocks*: finding rock.
@@ -150,6 +159,17 @@ when nothing is left to compute, the viewer sleeps.
the view, up to about 12,000 blocks out, jumps to the nearest one
and probes it. It samples every 16 blocks before it refines, so a
patch smaller than that can be missed. /Cancel/ stops it.
- *Minerals*: finding ore, the way the prospecting pick's density mode
does.
- Choose a mineral. The Minerals overlay colours the map by what the
pick would read there: miniscule, then very poor up to ultra high.
The legend gives each reading's share of the view.
- A reading combines the mineral's regional ore map with how much of
the column is its host rock, at the depths its deposits are placed
in. It says how likely the ore is near, not where the ore blocks
are.
- /Find nearest/ looks for the nearest column that reads at least
/Find at least/, as Rocks' /Find nearest/ does.
** vsmv
The command-line side, mostly for checking the generator against a
@@ -164,7 +184,8 @@ save:
| =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.
every stored chunk. It also compares the ore maps, and the prospecting
pick readings players took in the save, if there are any.
** Limits
- Only the /realistic/ world climate is supported, not /patchy/.
@@ -173,6 +194,14 @@ every stored chunk.
- 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.
- Prospecting readings come out a little higher than the game's: in
the readings checked, the game's was up to 12.5% lower, which can
move one across a category edge. The game's column already holds the ore of the
deposits generated in its chunk, and those deposits are not
generated here.
- Silver, gold and peridot are left out of Minerals. The game reads
them from ore inside other deposits (quartz and olivine),
which needs the deposits themselves.
** Notes
- =Plan.org= is the design and how each part was checked.