code wiki / (root) / nx_worldpipe.nx

nx_worldpipe.nx

buildroot/runtime/nx_worldpipe.nx

24521 B466 linesdepth 4pulls 10 transitivereach 11 importersview sourcekind librarytopic worldpipe
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_trimesh.nx nx_terrain_erode_lib.nx nx_worldpipe_core.nx nx_worldpipe.nx nx_authorgen.nx nx_engine_phys_gate.nx nx_engine_stream_gate.nx nx_m2d_engine.nx nx_worldpipe_erode_gate.nx nx_worldpipe_gate.nx nx_worldpipe_render.nx nx_worldpipe_render_gate.nx

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

22const WP_MAGIC_9600: i64 = 9600
23const WP_MAGIC_1000000000: i64 = 1000000000
24const WP_MAGIC_10100: i64 = 10100
25const WP_MAGIC_1000000: i64 = 1000000
26const WP_MAGIC_999999: i64 = 999999
27const WP_MAGIC_65536: i64 = 65536
64const HYW: i64 = 320
65const HYCELL: i64 = 64
66const HYSPAN: i64 = 10240
70const HYOFF: i64 = 5000000
385const WP_L_AMB: i64 = 256 // FLAT GROUND = unity (measured: an ambient floor of 168 made the
388const WP_L_GAIN: i64 = 22 // diffuse gain per height-step unit
389const WP_L_STEP: i64 = 90 // sample distance for the slope normal
390const WP_L_MAXB: i64 = 340 // brightness ceiling (overbright allowed; channels clamp at 255)
391const WP_L_MINB: i64 = 96 // brightness floor (shadow side never crushes to black)
392const WP_L_JIT: i64 = 14 // per-cell albedo jitter amplitude (small: variation, not noise)
393const WP_L_CELL: i64 = 96 // albedo cell size (matches the feature grid feel)

functions

51func 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 }
52func wp_set_erode(v: i64) -> i64 { WP_ERODE = v; return 0 }
53func wp_set_carve(v: i64) -> i64 { WP_CARVE = v; return 0 }
54func wp_set_feat(v: i64) -> i64 { WP_FEAT = v; return 0 }
55func wp_set_temp_bias(v: i64) -> i64 { WP_TEMP_BIAS = v; return 0 }
56func wp_set_cont_bias(v: i64) -> i64 { WP_CONT_BIAS = v; return 0 }
57func wp_set_mount_scale(v: i64) -> i64 { WP_MOUNT_SCALE = v; return 0 }
71func wp_hyd_stamp(g: *i64, x: i64, z: i64, bed: i64, rad: i64) -> i64
89func wp_hydro_bake() -> i64
174func wp_hyd_n() -> i64 { return WP_HYN }
175func wp_hyd_stat(i: i64, k: i64) -> i64 { let st: *i64 = WP_HYSTATS as *i64; return st[i*4+k] }
176func wp_hyd_bed(x: i64, z: i64) -> i64
208func wp_erode_stat(k: i64) -> i64
215func wp_erode_bake(ticks: i64, rain_q14: i64, talus: i64, flux_q14: i64) -> i64
265func wp_erode_talus_derived() -> i64
295func wp_erode_bake_derived(ticks: i64) -> i64
304func wp_erode(x: i64, z: i64) -> i64
326func wp_height(x: i64, z: i64) -> i64
338func wp_biome(x: i64, z: i64) -> i64
363func wp_surface(x: i64, z: i64, h: i64, slope: i64) -> i64
394func wp_set_light(v: i64) -> i64 { WP_LIGHT = v; return 0 }
395func wp_shade(x: i64, z: i64, h: i64, slope: i64) -> i64
422func wp_feature(cx: i64, cz: i64) -> i64
437func wp_spawn(out: *i64) -> i64