fix(assets): mountain rock could never fire — kelvin compared to 0.35 (T-1295)
compute_biome receives absolute kelvin (the Whittaker table is kelvin; the
0-1 normalisation happens afterwards in simulate(), for the renderer only),
but two terrain rules compared it to 0.35. That was the case from the
generator's first commit (f84275edf):
- mountain rock, `temperature < 0.35`: never true, so the class never
appeared through this rule on any body;
- sulfuric scrub, `temperature > 0.35`: always true.
0.35 can only mean a fraction of the world's own range, the normalisation
compute_moisture already uses, so both rules now compare against that. A
world with no temperature range reads 0 (the cold end).
tooling/test_planet_biome_rules.py pins the rule both ways on a synthetic
body: cold high ground turns to rock (>90%, since anomaly scatter repaints
~3%), and warm high ground and low ground do not. Mutation-proven: restoring
the kelvin comparison fails it at a rock share of exactly 0.000. Wired into
make test-tooling.
Sulfuric scrub remains unreachable for a different reason: it converts rock
only at elev_norm 0.25-0.65, and rock exists only above 0.65. It is left as
found, since making it reachable is a design call and belongs to the balancing
pass, so it is not pinned.
Found while shaping the D-258 biome bake. The committed reliefmaps and globes
were rendered with the bug, and the coming bake reflects the fix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -716,7 +716,15 @@ def compute_biome(body_def, elevation, sea_level, surface_water,
|
||||
has_ice_deposition = atmo not in ("none",) and hydro_here not in ("none", "subsurface")
|
||||
if has_ice_deposition:
|
||||
biome[land & (elev_norm > 0.85)] = 17
|
||||
biome[land & (elev_norm > 0.65) & (temperature < 0.35)] = 18
|
||||
# `temperature` is absolute kelvin here, but the two rules below were
|
||||
# written against a 0-1 scale and compared kelvin to 0.35 from the first
|
||||
# commit: mountain rock could never fire, and the sulfuric test was always
|
||||
# true (T-1295). 0.35 only means something as a fraction of this world's own
|
||||
# range — the same normalisation simulate() applies for the renderer — so
|
||||
# that is what they now compare against. A world with no range reads 0.
|
||||
t_span = float(temperature.max() - temperature.min())
|
||||
t_norm = (temperature - temperature.min()) / t_span if t_span > 0 else np.zeros_like(temperature)
|
||||
biome[land & (elev_norm > 0.65) & (t_norm < 0.35)] = 18
|
||||
|
||||
# ── Modifier stack ─────────────────────────────────────────────────────
|
||||
env = body_def.get("environment", {})
|
||||
@@ -751,7 +759,7 @@ def compute_biome(body_def, elevation, sea_level, surface_water,
|
||||
|
||||
# Sulfuric substrate: scrub on volcanic mid-elevations
|
||||
if substrate == "sulfuric":
|
||||
scrub = land & (elev_norm > 0.25) & (elev_norm < 0.65) & (temperature > 0.35)
|
||||
scrub = land & (elev_norm > 0.25) & (elev_norm < 0.65) & (t_norm > 0.35)
|
||||
biome[scrub & (biome == 18)] = EXOTIC_CLASSES["sulfuric_scrub"]
|
||||
|
||||
# ── Anomaly scatter ─────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user