code wiki / (root) / nx_game_world.nx

nx_game_world.nx

buildroot/runtime/nx_game_world.nx

7445 B170 linesdepth 3pulls 4 transitivereach 3 importersview sourcekind librarytopic game
docsdependenciesstructsconstsfunctions

about

nx_game_world.nx -- the sovereign GAME WORLD layer: procedural terrain + entity geometry, both emitted PLAYER-RELATIVE straight into the nx_swgpu vertex/triangle arrays. Extracted from nx_gx4_walk_gate the moment a second gate needed the same world (migrate-on-touch, so there is never a second copy to drift -- the dual-source hazard this ecosystem has paid for before). Behaviour-preserving by construction: the walk gate's determinism checksum must stay bit-identical across the extraction, which is how the refactor is PROVEN clean rather than assumed. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_swgpu.nx nx_game_world.nx nx_gx4_walk_gate.nx nx_gx7_game_gate.nx nx_gx9_saveload_gate.nx

imports: nx_swgpu.nx

imported by: nx_gx4_walk_gate.nxnx_gx7_game_gate.nxnx_gx9_saveload_gate.nx

structs

none

consts

8const GW_MAGIC_15000: i64 = 15000
9const GW_MAGIC_4096: i64 = 4096
10const GW_MAGIC_2500: i64 = 2500
11const GW_MAGIC_4200: i64 = 4200
12const GW_MAGIC_1200: i64 = 1200
14const GW_N: i64 = 28 // terrain grid cells per side -> (N+1)^2 verts
15const GW_CELL: i64 = 4096 // 1.0 world unit per cell (fx4096)

functions

19func gw_h(i: i64, j: i64) -> i64
30func gw_band(i: i64, j: i64) -> i64
called by 1: gw_build_terrain calls 1: gw_h
41func gw_ground(wx: i64, wz: i64) -> i64
54func gw_build_terrain(base: i64, band: i64, ppx: i64, ppz: i64, eyey: i64) -> i64
115func gw_build_entities(base: i64, ex: *i64, ez: *i64, alive: *i64, n: i64, ppx: i64, ppz: i64, eyey: i64, r: i64, lift: i64) -> i64
166func gw_dist2(ax: i64, az: i64, bx: i64, bz: i64) -> i64
called by 2: g7_runsl_sim