nx_worldpipe.nx
buildroot/runtime/nx_worldpipe.nx
about
nx_worldpipe.nx -- ★R5 STAGED PROCGEN (the banked Minecraft-pipeline curriculum, engine-convergence rung 5):
worldgen as an ORDERED STAGED PIPELINE over a MULTI-PARAMETER space -- not one noise call.
STAGE 1 PARAMS six independent noise fields at (x,z): temperature / humidity / CONTINENTALNESS / erosion /
weirdness / river. (Their 6th, depth, is the 3D-density param -- ours is a heightfield: named residual.)
STAGE 2 SPLINE height BASE = piecewise-linear SPLINE over continentalness (deep ocean -> coast -> inland -> highland),
the curriculum's core lesson: params map to height THROUGH SPLINES.
STAGE 3 RELIEF ridged mountains scaled by WEIRDNESS and flattened by EROSION (high erosion = plains).
STAGE 4 CARVER rivers CUT the terrain where the river field crosses its band (geometry change, toggleable).
STAGE 5 BIOME classified from the parameter VECTOR (temp x humidity x cont x weirdness) -- NOT from height
(the anti-"height-only" lesson: two same-height points can be desert vs snowfield).
STAGE 6 SURFACE per-biome + slope + altitude surface colours (sand/grass/snow/rock/water).
STAGE 7 FEATURES per-biome placements by seeded hash (trees / cacti / spruce / boulders).
STAGE 8 SPAWN a valid spawn point (land, gentle slope) found deterministically.
Pure integer, deterministic per seed. Stages 4/7 have toggles so gates can prove CAUSALITY per stage.
license_tier: ORIGINAL
dependencies 2 imports · 5 importers
imports: nx_syscalls.nxnx_trimesh.nx
imported by: nx_authorgen.nxnx_engine_phys_gate.nxnx_engine_stream_gate.nxnx_m2d_engine.nxnx_worldpipe_gate.nx
structs
| none |
consts
| 18 | const WP_MAGIC_1400: i64 = 1400 |
| 19 | const WP_MAGIC_3400: i64 = 3400 |
| 20 | const WP_MAGIC_2600: i64 = 2600 |
| 21 | const WP_MAGIC_2100: i64 = 2100 |
| 22 | const WP_MAGIC_1700: i64 = 1700 |
| 23 | const WP_MAGIC_1300: i64 = 1300 |
| 24 | const WP_MAGIC_2400: i64 = 2400 |
| 25 | const WP_MAGIC_9973: i64 = 9973 |
| 26 | const WP_MAGIC_524287: i64 = 524287 |
| 27 | const WP_MAGIC_1024: i64 = 1024 |
| 28 | const WP_MAGIC_9600: i64 = 9600 |
| 29 | const WP_MAGIC_1000000000: i64 = 1000000000 |
| 30 | const WP_MAGIC_10100: i64 = 10100 |
| 31 | const WP_MAGIC_1000000: i64 = 1000000 |
| 32 | const WP_MAGIC_999999: i64 = 999999 |
| 33 | const WP_MAGIC_65536: i64 = 65536 |
| 115 | const HYW: i64 = 320 |
| 116 | const HYCELL: i64 = 64 |
| 117 | const HYSPAN: i64 = 10240 |
| 121 | const HYOFF: i64 = 5000000 |
| 298 | const WP_L_AMB: i64 = 256 // FLAT GROUND = unity (measured: an ambient floor of 168 made the |
| 301 | const WP_L_GAIN: i64 = 22 // diffuse gain per height-step unit |
| 302 | const WP_L_STEP: i64 = 90 // sample distance for the slope normal |
| 303 | const WP_L_MAXB: i64 = 340 // brightness ceiling (overbright allowed; channels clamp at 255) |
| 304 | const WP_L_MINB: i64 = 96 // brightness floor (shadow side never crushes to black) |
| 305 | const WP_L_JIT: i64 = 14 // per-cell albedo jitter amplitude (small: variation, not noise) |
| 306 | const WP_L_CELL: i64 = 96 // albedo cell size (matches the feature grid feel) |
functions
| 44 | func wp_init(seed: i64) -> i64 { WP_SEED = seed; WP_CARVE = 1; WP_FEAT = 1; WP_TEMP_BIAS = 0; WP_CONT_BIAS = 0; WP_MOUNT_SCALE = WP_MAGIC_1400; WP_LIGHT = 1; return 0 } |
| 45 | func wp_set_carve(v: i64) -> i64 { WP_CARVE = v; return 0 } called by 1: main |
| 46 | func wp_set_feat(v: i64) -> i64 { WP_FEAT = v; return 0 } |
| 47 | func wp_set_temp_bias(v: i64) -> i64 { WP_TEMP_BIAS = v; return 0 } called by 1: ag_parse |
| 48 | func wp_set_cont_bias(v: i64) -> i64 { WP_CONT_BIAS = v; return 0 } called by 1: ag_parse |
| 49 | func wp_set_mount_scale(v: i64) -> i64 { WP_MOUNT_SCALE = v; return 0 } called by 1: ag_parse |
| 50 | func wp_iabs(v: i64) -> i64 { if v < 0 { return 0-v } return v } |
| 51 | func wp_clamp(v: i64, lo: i64, hi: i64) -> i64 { if v<lo {return lo} if v>hi {return hi} return v } |
| 55 | func wp_param(x: i64, z: i64, k: i64) -> i64 |
| 70 | func wp_spline(c: i64) -> i64 |
| 82 | func wp_height_core(cont: i64, ero: i64, weird: i64, x: i64, z: i64) -> i64 |
| 92 | func wp_height_params(cont: i64, ero: i64, weird: i64, x: i64, z: i64) -> i64 |
| 97 | func wp_flow_h(x: i64, z: i64) -> i64 |
| 104 | func wp_height_raw(x: i64, z: i64) -> i64 |
| 122 | func wp_hyd_stamp(g: *i64, x: i64, z: i64, bed: i64, rad: i64) -> i64 called by 1: wp_hydro_bake |
| 140 | func wp_hydro_bake() -> i64 |
| 225 | func wp_hyd_n() -> i64 { return WP_HYN } called by 1: main |
| 226 | func wp_hyd_stat(i: i64, k: i64) -> i64 { let st: *i64 = WP_HYSTATS as *i64; return st[i*4+k] } called by 1: main |
| 227 | func wp_hyd_bed(x: i64, z: i64) -> i64 |
| 240 | func wp_height(x: i64, z: i64) -> i64 called by 11: measure_worldrender_worldsim_dropmainchunk_meshmain+5 calls 2: wp_height_rawwp_hyd_bed |
| 251 | func wp_biome(x: i64, z: i64) -> i64 |
| 276 | func wp_surface(x: i64, z: i64, h: i64, slope: i64) -> i64 |
| 307 | func wp_set_light(v: i64) -> i64 { WP_LIGHT = v; return 0 } called by 1: main |
| 308 | func wp_shade(x: i64, z: i64, h: i64, slope: i64) -> i64 |
| 335 | func wp_feature(cx: i64, cz: i64) -> i64 |
| 350 | func wp_spawn(out: *i64) -> i64 |