Real badlands clay bands and a real biome temperature table

The bandlands rule cycled four terracotta colours off a per-column random draw.
Vanilla generates a 192-entry band table once per world, from a random source
named clay_bands, and reads it at the block's height shifted by the
clay_bands_offset noise. Brown, red and light grey terracotta were never placed
anywhere; the stripes were the wrong thickness and did not line up between
neighbouring columns. All seven colours now appear.

The temperature condition matched a hand-written list of eleven biome names.
Replacing it with the temperature field read out of the jar's 65 biome JSONs
fixes one of them: deep_frozen_ocean reads cold by name but its base
temperature is 0.5, so vanilla does not freeze it. taiga and the pine taigas
were the other way round -- excluded by name, and correctly so, but by
coincidence rather than by data.

Two parts of the vanilla calculation are left out and documented where they
belong: the height adjustment that cools peaks, and the "frozen" modifier that
warms scattered patches of frozen ocean. Both need PerlinSimplexNoise. Neither
is reachable from the overworld tree in a way that shows: the single condition
that consults temperature sits under a frozen_ocean biome check, below a water
check, and decides whether a hole in the ocean floor ices over. The snowy
mountain tops come from biome selection, not from here -- which is not what the
plan for this commit assumed.

The per-column *rand.Rand threaded through SurfaceContext goes away with the
old bandlands rule; nothing needs it now that vertical_gradient rolls
positionally.
This commit is contained in:
Master290 2026-07-27 02:31:10 +03:00
parent c19e5f0e4f
commit 3a255b52e1
8 changed files with 289 additions and 68 deletions

View file

@ -123,13 +123,12 @@ func generateVanilla(od *worldgen.OverworldDensity, fluidPicker worldgen.FluidPi
sctx = surfaceRule.NewContext()
}
for lz := 0; lz < 16; lz++ {
rng := newColumnRand(baseX+lx, baseZ+lz, int(seed))
if ruleErr == nil {
applySurfaceRule(od, surfaceRule, sctx, &columns[lx][lz],
baseX+lx, baseZ+lz, lx, lz, &worldSurface, biomeName[lx][lz], rng)
} else {
fillLegacySurface(&columns[lx][lz], surfTop[lx][lz], rng)
baseX+lx, baseZ+lz, lx, lz, &worldSurface, biomeName[lx][lz])
continue
}
fillLegacySurface(&columns[lx][lz], surfTop[lx][lz], newColumnRand(baseX+lx, baseZ+lz, int(seed)))
}
}(lx)
}
@ -275,7 +274,7 @@ func substance(aq *worldgen.Aquifer, fluidPicker worldgen.FluidPicker, x, y, z i
// One *rand.Rand is created per column (not per block) — bandlands/gradient
// consume from it sequentially, which is correct because vanilla seeds those
// per-column too. This avoids ~98k rand.New allocations per chunk.
func applySurfaceRule(od *worldgen.OverworldDensity, rules *worldgen.SurfaceRuleSet, sctx *worldgen.SurfaceContext, out *[WorldHeight]uint16, wx, wz, lx, lz int, worldSurface *[16][16]int, biomeName string, rng chunkRand) {
func applySurfaceRule(od *worldgen.OverworldDensity, rules *worldgen.SurfaceRuleSet, sctx *worldgen.SurfaceContext, out *[WorldHeight]uint16, wx, wz, lx, lz int, worldSurface *[16][16]int, biomeName string) {
top := -1
for i := WorldHeight - 1; i >= 0; i-- {
if out[i] != StateAir {
@ -299,7 +298,6 @@ func applySurfaceRule(od *worldgen.OverworldDensity, rules *worldgen.SurfaceRule
sctx.SurfaceDepth = surfaceDepth
sctx.MinSurfaceLevel = od.MinSurfaceLevelAt(wx, wz, surfaceDepth)
sctx.Steep = steepAt(worldSurface, lx, lz)
sctx.Rng = rng.toRand()
minY := MinY
stoneDepthAbove := 0
waterHeight := worldgen.NoWaterAbove