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 4 imports · 8 importers
imports: nx_syscalls.nxnx_trimesh.nxnx_terrain_erode_lib.nxnx_worldpipe_core.nx
imported by: nx_authorgen.nxnx_engine_phys_gate.nxnx_engine_stream_gate.nxnx_m2d_engine.nxnx_worldpipe_erode_gate.nxnx_worldpipe_gate.nxnx_worldpipe_render.nxnx_worldpipe_render_gate.nx
structs
| none |
consts
| 22 | const WP_MAGIC_9600: i64 = 9600 |
| 23 | const WP_MAGIC_1000000000: i64 = 1000000000 |
| 24 | const WP_MAGIC_10100: i64 = 10100 |
| 25 | const WP_MAGIC_1000000: i64 = 1000000 |
| 26 | const WP_MAGIC_999999: i64 = 999999 |
| 27 | const WP_MAGIC_65536: i64 = 65536 |
| 64 | const HYW: i64 = 320 |
| 65 | const HYCELL: i64 = 64 |
| 66 | const HYSPAN: i64 = 10240 |
| 70 | const HYOFF: i64 = 5000000 |
| 385 | const WP_L_AMB: i64 = 256 // FLAT GROUND = unity (measured: an ambient floor of 168 made the |
| 388 | const WP_L_GAIN: i64 = 22 // diffuse gain per height-step unit |
| 389 | const WP_L_STEP: i64 = 90 // sample distance for the slope normal |
| 390 | const WP_L_MAXB: i64 = 340 // brightness ceiling (overbright allowed; channels clamp at 255) |
| 391 | const WP_L_MINB: i64 = 96 // brightness floor (shadow side never crushes to black) |
| 392 | const WP_L_JIT: i64 = 14 // per-cell albedo jitter amplitude (small: variation, not noise) |
| 393 | const WP_L_CELL: i64 = 96 // albedo cell size (matches the feature grid feel) |
functions
| 51 | 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; WP_ERODE = 1; return 0 } |
| 52 | func wp_set_erode(v: i64) -> i64 { WP_ERODE = v; return 0 } |
| 53 | func wp_set_carve(v: i64) -> i64 { WP_CARVE = v; return 0 } |
| 54 | func wp_set_feat(v: i64) -> i64 { WP_FEAT = v; return 0 } |
| 55 | func wp_set_temp_bias(v: i64) -> i64 { WP_TEMP_BIAS = v; return 0 } |
| 56 | func wp_set_cont_bias(v: i64) -> i64 { WP_CONT_BIAS = v; return 0 } |
| 57 | func wp_set_mount_scale(v: i64) -> i64 { WP_MOUNT_SCALE = v; return 0 } |
| 71 | func wp_hyd_stamp(g: *i64, x: i64, z: i64, bed: i64, rad: i64) -> i64 |
| 89 | func wp_hydro_bake() -> i64 |
| 174 | func wp_hyd_n() -> i64 { return WP_HYN } |
| 175 | func wp_hyd_stat(i: i64, k: i64) -> i64 { let st: *i64 = WP_HYSTATS as *i64; return st[i*4+k] } |
| 176 | func wp_hyd_bed(x: i64, z: i64) -> i64 |
| 208 | func wp_erode_stat(k: i64) -> i64 |
| 215 | func wp_erode_bake(ticks: i64, rain_q14: i64, talus: i64, flux_q14: i64) -> i64 |
| 265 | func wp_erode_talus_derived() -> i64 |
| 295 | func wp_erode_bake_derived(ticks: i64) -> i64 |
| 304 | func wp_erode(x: i64, z: i64) -> i64 |
| 326 | func wp_height(x: i64, z: i64) -> i64 |
| 338 | func wp_biome(x: i64, z: i64) -> i64 |
| 363 | func wp_surface(x: i64, z: i64, h: i64, slope: i64) -> i64 |
| 394 | func wp_set_light(v: i64) -> i64 { WP_LIGHT = v; return 0 } |
| 395 | func wp_shade(x: i64, z: i64, h: i64, slope: i64) -> i64 |
| 422 | func wp_feature(cx: i64, cz: i64) -> i64 |
| 437 | func wp_spawn(out: *i64) -> i64 |