Lakes fill only to their lower rim and keep clear of spawn and the dock (t96)

The lake lip was Math.min(surfY), the highest ground (y grows downward), so water was poured
above the lower rim and, once levelled, ran up to the trade dock on 4 of 12 seeds. The lip is
now the lower rim edge minus one, and each lake stays 80 grains from spawn. Seed hashes and
the shallow-ore hash re-baselined (changes only under lake basins); golden fixtures also
freeze surfY/dirtY/AMB from the previous generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 19:45:51 -04:00
co-authored by Claude Opus 5.5
parent ae78756fa2
commit 80668a4baf
10 changed files with 41 additions and 13 deletions
+4 -3
View File
@@ -67,12 +67,13 @@ function* worldSteps(seedIn, w, h) {
else dirtY[x] = Math.min(dirtY[x], surfY[x] + 20);
}
}
// lakes: a basin dug below the lowest point of its rim, filled to just above it
// lakes: a basin dug below the lower of its two rims, filled to just under that rim (y grows
// downward, so the lower rim is the larger surfY); kept 80 grains clear of spawn and the dock
const lakeTop = new Int16Array(w).fill(h), noTree = new Uint8Array(w), desAt = new Uint8Array(w);
for (const f of feats) {
if (f.k !== 'lake') continue;
const lw = Math.round(90 + rng() * 40), deep = 22 + rng() * 8;
let lip = 1e9; for (let x = f.x - lw; x <= f.x + lw; x++) if (x >= 0 && x < w) lip = Math.min(lip, surfY[x]);
const lw = Math.min(Math.round(90 + rng() * 40), Math.abs(f.x - spawnX) - 80), deep = 22 + rng() * 8;
const lip = Math.max(surfY[Math.max(0, f.x - lw)], surfY[Math.min(w - 1, f.x + lw)]) - 1;
for (let x = f.x - lw; x <= f.x + lw; x++) {
if (x < 0 || x >= w) continue;
const u = (x - f.x) / lw, depth = Math.max(0, 1 - u * u) * deep;