Commit Graph

24 Commits

Author SHA1 Message Date
7cb49f83cd name the colour function type
A typedef of a function pointer type compiles now (sex#53).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:12:04 +03:00
e0901f6c8a pass the river colour as a conditional, with #line on every statement
A #line no longer lands inside a ?: (sex#54), so the build goes back
to statement-level directives, which is what lands a debugger on the
right line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:11:37 +03:00
e4ab3e875f put conditional operands back where they are used
A conditional expression as an operand keeps its parentheses now
(sex#59), so the clamps and offsets are written inline again. The
story's z direction stays a local: it is drawn before the distances,
and inlining it would reorder the draws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:11:17 +03:00
d40455d824 read the compared distances through the casts
A cast as the object of `.' keeps its parentheses now (sex#61), so
the comparator takes the two distances straight from its arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:10:24 +03:00
b74c445b25 cast the odd lattice coordinates to float directly
A cast of a bitwise expression keeps its parentheses now (sex#62), so
the int locals that held them are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:10:00 +03:00
d2721b55f7 write -INFINITY
sexc reads a dash before a name as negation now (sex#63).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:09:34 +03:00
74200559b8 write masks, colours and hash constants in hex
sexc reads hex literals now (sex#47). The OpenSimplex constants are
spelled as the C# spells them, and the colours as the comments that
stood in for them did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:09:08 +03:00
9bc1167782 size the thread and file arrays by their constants
An array of a header type takes a symbolic size now (sex#60). The
records holding them are pub, so their constants are too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:07:07 +03:00
d299ba05ac size arrays by the constants' own names
sexc converts an array bound's name now (sex#50), so MAX_STRATA and
the like go back to being written as defined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:06:24 +03:00
28f0e8acac pub-import the modules a unit's interface holds by value
sexc now checks that importers can see every type a pub form holds,
and asks for pub where the type comes from another import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 18:05:14 +03:00
a3a68df048 mark the public natfloat record as a sex#57 workaround
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:46:06 +03:00
e174bff7e2 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>
2026-10-08 22:02:34 +03:00
75d734c2d6 find one rock at any depth
A new rock mode looks for the one highlighted rock anywhere between the
surface and the mantle: the overlay shows the columns that hold it, the
cursor label how deep it starts, and Find nearest the nearest such
column. It can be chosen only while one rock is highlighted, and while
it is on, clicking a rock in the legend highlights that one instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:35:24 +03:00
df0b8d815a note the silent misparses of sex#59 found in this project
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:02:38 +03:00
c14c154303 fix four conditional operands sexc emitted without parentheses, and mark every Sex workaround with a TODO
A conditional as an operand loses its parentheses (sex#59): box-blur
allocated a quarter of its buffer, deep water got the shallow colour,
and verify's delta histogram wrote out of bounds into the height
classes. Plan.org quoted the corrupted count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:01:59 +03:00
39b0e74f2b add a readme with usage and an example screenshot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 20:50:35 +03:00
e412274837 rework the viewer around base layers, overlays and side panels
One base layer is drawn opaque and any number of overlays over it, so
rocks can be looked for on top of the terrain rather than instead of
it. Settings and rock finding live in fixed panels beside the map, not
in windows over it. What is under the cursor is worked out on a thread
of its own, since computing it per frame stalled the window.

Find nearest searches regions outward from the view's centre and stops
once no nearer region is left; probes leave pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 20:39:29 +03:00
4666188b21 lay rock strata and show them as an overlay
The surface rock matches the save's TopRockIdMap in all but 14 of
11.7 million columns. Rock tiles keep rock indices and take their
colours from a palette on upload, so highlighting one rock, to find
where it lies, recolours what is drawn instead of regenerating it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:53:26 +03:00
c4c7ab9968 generate terrain height as Rivers' GenTerra does
98.2% of stored columns match exactly; the rest is the dry seabed
raise and surface caves, both later passes that the strata never see.
GenTerra thresholds the new terrain noise through the old tanh curve's
inverse, and matching that quirk is what moved it from 87%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 19:10:54 +03:00
517d279c8d lay out rivers as the Rivers mod does
Every stored riverDistance column matches. Plates are built from 25
ocean samples per zone rather than a region map per zone, and the
ocean distance from a ring search that finds what the mod's BFS does,
so a plate costs 0.08 s; workers cache a few, as a wide view spans
several.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:40:53 +03:00
5ad62524f1 show the generated region maps in the viewer
Tiles are single maps of single regions, generated on worker threads
that each own a worldgen, since the layers keep RNG state. Only the
visible tiles are queued, nearest first, so the viewer never computes
more than the window shows and sleeps once it has drawn it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:24:59 +03:00
63fd30a189 generate the region maps as the game does
Every map in all 118 stored regions matches the save to the pixel, so
the port is checked against ground truth rather than eyeballed. Getting
there meant reproducing .NET quirks the output depends on: LCGRandom
reseeding from its previous seed, Dictionary slot order in
NaturalShape, and C#'s left-to-right evaluation of RNG draws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:12:40 +03:00
90b5d50fa5 read the save, the seed and the worldgen assets
The engine's save classes are closed, so the protobuf field numbers
were read off the data and matched to the map sizes TerraGenConfig
gives. vsmv dump renders what the save stored, as the reference the
generator will be diffed against.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:56:14 +03:00
d72ae437ae set up the build, the viewer window and the vsmv cli
The generator must reproduce .NET arithmetic bit for bit, so every unit
builds with -ffp-contract=off and -fwrapv. Nuklear goes through the
SDL3_Renderer backend, keeping the viewer off macOS's deprecated GL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:39:10 +03:00