nx_procgen_biome.nx
buildroot/runtime/nx_procgen_biome.nx
about
nx_procgen_biome.nx -- biome map as a CAUSAL DERIVATION from elevation
+ moisture (PROCGEN arc P2 = EXCEED10 ladder R1; the composed-primitives
cardinal: biomes are LAW, not paint).
The grader's BIOME_COHERENCE axis (nx_world_quality_grader) was
structurally ABSENT (=0) because no generator ever produced a biome map.
This module produces one the only honest way: each cell's biome follows
from WHERE it is --
elevation band = the SAME quartile law the grader checks
(low / mid / high / peak over observed range)
moisture = a second perlin-fbm field (independent seed stream)
picks the biome WITHIN the band, Whittaker-style
Band law (must stay in lockstep with _wqg_biome_expected_band):
LOW : DESERT (dry) | TUNDRA (wet)
MID : GRASSLAND < BOREAL_FOREST < TEMPERATE_FOREST < TROPICAL_RAINFOREST
(driest -> wettest)
HIGH : SNOW
PEAK : ICE
Coherence is lawful BY CONSTRUCTION; the grader is the independent
instrument that proves the law holds (and catches any future drift
between this table and the grader's). Moisture creates the within-band
variety that the render/material rung (B4) will consume as color bands.
Deterministic per (heightmap, seed): same inputs -> byte-identical map.
license_tier: ORIGINAL
dependencies 3 imports · 6 importers
imports: nx_syscalls.nxnx_tier.nxnx_perlin.nx
imported by: _ft_diag.nxnx_procgen_biome_test.nxnx_procgen_features.nxnx_procgen_features_test.nxnx_procgen_water_test.nxnx_worldgen_tunelib.nx
structs
| none |
consts
| 35 | const NX_BIOME_TUNDRA: nx_int = 0 |
| 36 | const NX_BIOME_BOREAL: nx_int = 1 |
| 37 | const NX_BIOME_GRASSLAND: nx_int = 4 |
| 38 | const NX_BIOME_TEMPERATE: nx_int = 5 |
| 39 | const NX_BIOME_DESERT: nx_int = 8 |
| 40 | const NX_BIOME_TROPICAL: nx_int = 11 |
| 41 | const NX_BIOME_SNOW: nx_int = 12 |
| 42 | const NX_BIOME_ICE: nx_int = 13 |
| 44 | const NX_BIOME_ID_SPAN: nx_int = 14 |
| 47 | const NX_BIOME_MOIST_DRY: nx_int = 0 - 256 |
| 48 | const NX_BIOME_MOIST_MID: nx_int = 0 |
| 49 | const NX_BIOME_MOIST_WET: nx_int = 256 |
| 54 | const NX_BIOME_MOISTURE_SEED_OFF: nx_int = 9173 |
| 58 | const NX_BIOME_MOIST_STEP_Q10: nx_int = 102 |
| 59 | const NX_BIOME_MOIST_OCTAVES: nx_int = 3 |
| 60 | const NX_BIOME_MOIST_PERSIST: nx_int = 512 |
functions
| 62 | func nx_biome_is_valid(b: nx_int) -> nx_int called by 1: main |
| 76 | func nx_biome_band(v: nx_int, hmin: nx_int, range: nx_int) -> nx_int |
| 89 | func nx_biome_pick(band: nx_int, moisture_q10: nx_int) -> nx_int called by 1: nx_biome_map_build |
| 108 | func nx_biome_map_build(heightmap: *i64, w: nx_int, h: nx_int, called by 5: mainmainmainmaintl_eval calls 4: nx_perlin_allocnx_perlin_fbm_2dnx_biome_bandnx_biome_pick |