nx_procgen_features.nx
buildroot/runtime/nx_procgen_features.nx
about
nx_procgen_features.nx -- feature KINDS assigned by biome law (PROCGEN
arc P3 = EXCEED10 ladder R2; seeds bucket B6 structures).
The grader's FEATURE_VARIETY axis (Shannon entropy over a kind
histogram) was structurally ABSENT (=0): the landscape's poisson points
had positions but no KINDS. This module gives each feature a kind the
causal way -- the biome it stands in decides what can grow there, and a
seeded jitter stream picks within the biome's mix:
TREE -- forests dominant; grassland scatter; treeline thins them
ROCK -- deserts, tundra, snowfields, ice; outcrops elsewhere
SHRUB -- the understory mix everywhere green
WATER -- rare: oasis (desert), melt pond (tundra), swamp pool
(tropical) -- placed where water causally collects
The mix table is the law (build-intelligence cardinal: a biome with bad
features gets a BETTER mix row, never a stripped one). No TREE in
DESERT is a tested invariant, not a comment.
Deterministic per (features, biome_map, seed): byte-identical kinds.
license_tier: ORIGINAL
dependencies 4 imports · 4 importers
imports: nx_syscalls.nxnx_tier.nxnx_prng.nxnx_procgen_biome.nx
imported by: _ft_diag.nxnx_procgen_features_test.nxnx_procgen_water_test.nxnx_worldgen_tunelib.nx
structs
| none |
consts
| 27 | const NX_MAGIC_1024: i64 = 1024 |
| 30 | const NX_FEAT_TREE: nx_int = 0 |
| 31 | const NX_FEAT_ROCK: nx_int = 1 |
| 32 | const NX_FEAT_SHRUB: nx_int = 2 |
| 33 | const NX_FEAT_WATER: nx_int = 3 |
| 34 | const NX_FEAT_N_KINDS: nx_int = 4 |
| 38 | const NX_FEAT_SEED_OFF: nx_int = 24107 |
functions
| 40 | func nx_feature_kind_is_valid(k: nx_int) -> nx_int |
| 55 | func nx_feature_kind_pick(biome: nx_int, jitter_q10: nx_int) -> nx_int called by 1: nx_feature_assign |
| 101 | func nx_feature_assign(xs: *i64, ys: *i64, n: nx_int, |
| 128 | func nx_feature_assign_with_water(xs: *i64, ys: *i64, n: nx_int, |
| 151 | func nx_feature_hist_build(kinds: *i64, n: nx_int, out_hist: *i64) -> nx_int |