Repository navigation
Cut terrain and forest from Strata's fractal noise - #33
dmccoystephenson wants to merge 6 commits into
Conversation
The two v1 slots under tests/fixtures/ are now also checked against the fingerprint() of the colony as loaded. The pins are recorded from CI on this commit, before any change to world generation, so a later generator change that touched a loaded save would fail here. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeukDJfWGrEeQGR8FbX9
The values are what CI printed for the previous commit (run 43662799008), on GCC 13 in ubuntu:24.04 and on MSVC alike, with world generation still as v0.2.1 has it. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeukDJfWGrEeQGR8FbX9
New maps drew elevation from two octaves of value noise and forest from one, so lake shores, rock outcrops and forest edges were round blobs. They are now cut from Strata's fBm (strata/sim/noise.hpp, vendored unchanged in third_party/strata_noise from Strata main at 649f0a5, which is after v0.7.0 and not in a release; the Strata pin stays at v0.7.0). - Rock: five octaves, gain 0.65, first layer 16 cells across. Edge box-counting dimension at 1-8 cells on 512 x 512 maps (seeds 1-8): 1.02 before, 1.15 after. - Forest: three octaves, gain 0.65, first layer 7 cells across. Edge dimension of the forest mask: 1.05 before, 1.29 after. - Water: the first three octaves of the elevation field (down to four cells). Settlers have no pathfinding, and the one- and two-cell inlets of a fully rough shore trapped them: with five octaves for water too, a 1,000-seed run with no player lost 14% of colonies by tick 1000 instead of 10%. With three, 9.6% (96 of seeds 1-1000) against 9.9%. Shore dimension: 1.03 before, 1.04 after. Thresholds were set so the mean shares over seeds 1-256 (64 x 64) match the old generator: water 11.4% (was 11.1%), rock 9.1% (9.5%), trees 15.3% (15.3%), stone 2.7% (2.8%), berries 1.13% (1.14%). A new test in test_generate checks the shares over 64 seeds. Saves are not affected: a save holds the whole map, and nothing is re-derived from the seed on load. test_save_fixtures pins the fingerprint both v1 fixtures load as, recorded before this change, and still passes. New games from a given seed (including the browser game and steading-replay --new) get a different map, so the pinned seed-42 fingerprint moves from 011ed2b2f364b21b to 09826a6da618223a in test_determinism, ci.yml, browser.yml, the smoke test and the docs. The determinism test also checks the vendored noise against the values Strata's own unit test pins. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeukDJfWGrEeQGR8FbX9
Top-down maps from generate() for seeds 42 and 7 at 64 x 64 and seed 42 at 192 x 192, with the v0.2.1 generator and with fractal noise. Water is blue, rock grey (stone pale), trees dark green, berries red and the stockpile yellow. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeukDJfWGrEeQGR8FbX9
MSVC warns (C4804) on bool / double, and the rules job builds with warnings as errors. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeukDJfWGrEeQGR8FbX9
CI's headless smoke screenshots (steading --new 42 --headless --ticks 400, then 100 more) from the v0.2.1 main run and from this branch. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeukDJfWGrEeQGR8FbX9
|
Review of head Verdict: no blocking defect found. Not merged. The PR modifies do-not-auto-merge paths ( Rubric
Notes (non-blocking)
Owner action needed: approve the fingerprint move and the workflow and This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
New maps are cut from Strata's fractal noise (
strata/sim/noise.hpp), so rock outcrops and forest edges are ragged instead of round blobs. The shares of water, rock and resources stay as they were, colonies survive as often as before, and saves are unaffected.Top: maps from
generate()(water blue, rock grey with pale stone, trees dark green, berries red, stockpile yellow). Bottom: CI's headless smoke screenshots (steading --new 42 --headless --ticks 400, then 100 more ticks), taken from the v0.2.1mainrun and from this branch.What changed
D is the box-counting dimension of each mask's edge at box sizes of 1–8 cells. Rock and water were measured on 512 × 512 maps for seeds 1–8. Forest was measured on the noise field's forest mask. Strata's header measures gain 0.65 at about D 1.19. Natural coastlines are about 1.1–1.3. A cell is the finest scale here, so the octaves stop at about one cell.
Why the water stays smoother: settlers have no pathfinding.
systems.cppsteps greedily toward a target and slides along water when blocked, so shores with one- and two-cell inlets trap them. With five octaves for water as well, a no-player run of seeds 1–1000 lost 14.0% of colonies by tick 1000 (140), against 9.9% (99) for v0.2.1. Cutting water from three octaves brings it back to 10.1% (101). Mean settlers at tick 1000: 16.1 (v0.2.1: 16.2–16.7). Mean buildings: 13.6 (v0.2.1: 13.7–14.0). Shores are still more irregular at the 4–16-cell scale. Roughening them fully is better left until settlers can path round water.Balance. The thresholds were set so the mean shares over seeds 1–256 (64 × 64) match the old generator:
Per-seed spread is about the same (standard deviation over seeds 1–256: water 5.3% vs 4.7%, rock 4.2% vs 4.2%). A single seed can still move a lot: seed 42 has fewer rock outcrops than it used to. A new section in
test_generatechecks the shares over 64 seeds.(The main commit's message says 9.6% (96 lost). That figure was measured with the water threshold at −0.334 before it was rounded to −0.33. The figure for the code as committed is 10.1%.)
Save compatibility
toWorldwrites every grid channel into the base layer). Loading never callsgenerate(), andglobals.seedis used only at generation. Nothing in an existing save is re-derived from the seed, so no generator version needs recording.test_save_fixturesnow pins thefingerprint()each v1 fixture loads as:v1-seed42-tick500→05ffc670c14bab66,v1-frost-huts-seed7-tick600→50ec76feccbfd0e2. These pins were recorded from CI on the first commit, before the generator changed (run 43662799008; GCC 13 on Linux and MSVC agree). They still pass with the new generator.steading-replay --new. So the pinned seed-42 fingerprint moves from011ed2b2f364b21bto09826a6da618223aintest_determinism,ci.yml,browser.yml,web/smoke/smoke.cjs, README.md and docs/WEB.md.Strata: vendored, pin unchanged
noise.hpplanded in Strata PR #103 (649f0a5onmain). That commit is after v0.7.0 and is not in a release. Two things kept this PR from linkingstrata::simand bumping the pin:steading_colonyis deliberately Strata-free: it builds with CMake 3.16, needs no OpenUSD, and the rules jobs build it without Strata.STRATA_WITH_SIM=OFF.So
noise.hppandnoise.cppare vendored unchanged inthird_party/strata_noise(with Strata's MIT licence and a README naming the commit), the same waythird_party/usd_recorderis vendored.strata.refstays at v0.7.0 (20827c3), so none of Stratamain's other unreleased changes since v0.7.0 come in (ABI 1.13–1.16, the save-core fixes in #92).test_determinismchecks the copy against the values Strata's own unit test pins. Once a Strata release carriesnoise.hpp, linkingstrata::siminstead is an option. docs/THIRD-PARTY.md mentions the vendored copy.Tests
ctest5/5 pass.steading-simover seeds 1–1000 (numbers above). Coverage was measured with a scratch tool linkingsteading_colony.Not done here
timelapse.gifandmods-frost-huts.pngshow seed 42 on the old map and should be re-rendered on the desktop build.--map) touchesgenerate.cpptoo, so expect a small conflict there.Not merged: merging to
maindeploys the browser game.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code
https://claude.ai/code/session_01LYNeukDJfWGrEeQGR8FbX9