code wiki / (root) / nx_wasm_craft_gait_candidate_t139.nx

nx_wasm_craft_gait_candidate_t139.nx

buildroot/runtime/nx_wasm_craft_gait_candidate_t139.nx

262144 B4751 linesdepth 5pulls 30 transitivereach 1 importersview sourcekind librarytopic wasm
docsdependenciesstructsconstsfunctions

about

nx_wasm_craft.nx -- NISHI CRAFT: a GENERATED 3D VOXEL WORLD, playable first-person. The operator's 2026-05-19 vision ("build minecraft equivalent on the lowest possible hardware") finally EMITTING: procedural terrain (integer value-noise heightmap, biome banding, water, trees) in a 64x32x64 block grid, rendered by a per-pixel integer DDA raycast (true 3D: block faces, face shading, distance fog, sky), walked in first person (collision, auto-step-up, water float), and EDITED live (break/place at the crosshair). Every pixel and every world byte is NishiLang; base-relative so the identical code runs natively (gate, PNG proof) and as wasm (browser page); input arrives through nx_input_abstract (keyboard/gamepad/touch all work on day one). Controls (via the input layer's semantic actions): W/S or Up/Down = walk, A/D or Left/Right = turn, R/F = look up/down (bound to the MENU/PAUSE bits -- the 8-action mask is fully spent; widening it to 16 actions is the filed follow-up), E = break block, B = place stone. Touch d-pad works: center tap = break. license_tier: ORIGINAL

dependencies 19 imports · 1 importers

nx_syscalls.nx nx_itrig.nx nx_input_abstract.nx nx_atmosphere.nx nx_weather_lib.nx nx_softbind.nx nx_skeleton.nx nx_skin_ita.nx nx_nxa_anim_gait_candidate_t139.nx nx_morf_draw_core.nx nx_wasm_craft_gait_candidate_t nx_gait_engine_gate_t139.nx

diagram shows first 10 each side; +9 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_itrig.nxnx_input_abstract.nxnx_atmosphere.nxnx_weather_lib.nxnx_softbind.nxnx_skeleton.nxnx_skin_ita.nxnx_nxa_anim_gait_candidate_t139.nxnx_morf_draw_core.nxnx_nxa_morf_draw_admit.nxnx_entity_store.nxnx_gamesave_core.nxnx_indoorgen_data.nxnx_worldpipe_core.nxnx_genp_allow_lib.nxnx_perf_lib.nxnx_beach_release_recipe_move_t72.nxnx_beach_contact_sweep.nx

imported by: nx_gait_engine_gate_t139.nx

structs

none

consts

44const WATER_MAGIC_16777216: i64 = 16777216
45const EJRN_HASH_MUL: i64 = 40503
46const WATER_MAGIC_33554431: i64 = 33554431
47const TERRAIN_HASH_X: i64 = 374761393
48const TERRAIN_HASH_Z: i64 = 668265263
49const TERRAIN_HASH_SEED: i64 = 1442695041
50const SAVE_CK_MASK: i64 = 4611686018427387903
51const TERRAIN_HASH_MIX: i64 = 1274126177
52const RAY_HUGE: i64 = 1099511627776
53const WATER_MAGIC_65536: i64 = 65536
54const WATER_MAGIC_4096: i64 = 4096
55const WATER_MAGIC_1048576: i64 = 1048576
56const WATER_MAGIC_1536: i64 = 1536
57const WATER_MAGIC_6144: i64 = 6144
58const GENE_MASK_TEMPERAMENT: i64 = 57344
59const SAVE_CK_SEED: i64 = 1469598103
60const SAVE_CK_PRIME: i64 = 1099511
61const WATER_MAGIC_2400: i64 = 2400
62const WATER_MAGIC_2500: i64 = 2500
63const WATER_MAGIC_1400: i64 = 1400
64const CRAFT_DEFAULT_SEED: i64 = 20260728
105const W: i64 = 1920
106const H: i64 = 1200
107const WASM_PAGE_BYTES: i64 = 65536
113const WASM_PAGES: i64 = 364
114const WASM_MEM_BYTES: i64 = WASM_PAGES * WASM_PAGE_BYTES
126const RES: i64 = 2 // ray per RESxRES pixel block (240x150 rays)
127const RW: i64 = 240
128const RH: i64 = 150
129const FOC: i64 = 120 // ~90 degree fov at RW=240
134const Q_MAX: i64 = 24
135const Q_START: i64 = 5
152const FB_COLOR_MASK: i64 = 16777215
153const FB_DEPTH_SHIFT: i64 = 32
154const FB_DEPTH_MAX: i64 = 16777215
160const HUD_DESIGN_W: i64 = 480
161const HUD_PIP_MAX: i64 = 24
162const HUD_HOTBAR_N: i64 = 7
164const WX: i64 = 128 // world blocks (v2: 4x the area, taller)
165const WY: i64 = 48
166const WZ: i64 = 128
167const WATER_H: i64 = 9
171const B_FARM: i64 = 12 // tilled farmland, dry
172const B_CROP0: i64 = 13 // crop sprout (placed by SEEDS onto farmland)
173const B_CROP1: i64 = 14 // crop growing
174const B_CROP2: i64 = 15 // crop MATURE -- breaking it is the HARVEST
175const B_FARMW: i64 = 16 // farmland, wet (rain or water within the 5x5 ring)
181const O_FB: i64 = 3592832 // W*H i64 packed R|G<<8|B<<16 (at the arena tail; see CRAFT_TOTAL)
182const O_ST: i64 = 1152000 // 64 state slots
183const O_INPUT: i64 = 1152512 // nx_input_abstract arena (64 words)
184const O_VOX: i64 = 1153024 // WX*WY*WZ u8 blocks
185const O_MOBS: i64 = 1939456 // nx_entity_store arena (certified part): en_bytes(16,7)=1632
186const MOB_CAP: i64 = 16
187const MOB_NCOMP: i64 = 7
188const MOB_BYTES: i64 = 1632
189const O_SPEC: i64 = 1941120 // GAME SPEC block (64 words) -- AFTER the arena's 1632B end
190const O_EJRN: i64 = 1941760 // EDIT JOURNAL: 8192 packed i64 hash slots at ABSOLUTE world
192const EJRN_SLOTS: i64 = 8192
193const EJRN_BYTES: i64 = 65536
194const O_SAVE: i64 = 2730336 // v6 save image (relocated past MOBAUX): 128B header + voxels
197const SAVE_HDR: i64 = 128
198const SAVE_BODY: i64 = 853600 // WX*WY*WZ + MOB_BYTES + EJRN_BYTES
199const SAVE_BODY_V5: i64 = 788064 // pre-streaming body (load-compat: v5 saves still open)
200const SAVE_LEN: i64 = 853728 // SAVE_HDR + SAVE_BODY
201const CRAFT_BYTES: i64 = 3584064 // O_SAVE + SAVE_LEN
202const O_MOBAUX: i64 = 2729952 // 16 mobs x (dx,dz,dy) last-applied step, i64 triples
220const O_MOBHDG: i64 = 2729696
221const O_MOBVY: i64 = 2729824 // GE12: 16 mobs x 1 word VERTICAL VELOCITY Q8/tick (128B, the slack
226const O_SOFT: i64 = 3584064 // A4 soft-body springs: 16 mobs x SB_PTS(6, R7 regions) x SD_STRIDE words.
229const O_NEED: i64 = 3588672 // C1 needs: 16 mobs x 4 words (hunger, energy, social, spare).
231const O_MIND: i64 = 3589184 // C3/C5 THE INNER LIFE: 16 girls x 24 words -- 8 THOUGHT
236const O_PASS: i64 = 3592256 // THE TRAVELER'S PASSPORT (the isekai carry): the
242const PASS_MAGIC: i64 = 20260802001
243const PASS_LEN: i64 = 192 // 24 wire words: [0]magic [1]ver [2]charseed [3]broken
248const O_GENP: i64 = 3592640 // W1c GEN-TIME RECIPE OVERRIDES (192B): [0] magic, [1] n,
254const GENP_MAGIC: i64 = 20260813001
255const GENP_MAXP: i64 = 11
265const O_RIG: i64 = O_FB + W*H*8
269const RIG_BYTES: i64 = 188736
270const O_PROJ: i64 = O_RIG + RIG_BYTES
271const PROJ_MAXV: i64 = 211 // projected-vertex slots == RIG_VERT_TOTAL (declared beside the
278const PROJ_BYTES: i64 = PROJ_MAXV * 24
279const O_SKIN3: i64 = O_PROJ + PROJ_BYTES // 3-word sRGB scratch for nx_skin_ita's out3 (wasm has no
302const WC_CAST_N: i64 = 12 // the cast genmobs places (placed < WC_CAST_N); hair state is sized to it
303const HG_MOBS: i64 = WC_CAST_N
304const HG_NP: i64 = 8 // points per HSTR strand: the section contract (GR_PTS in nx_nxa_groom)
305const HG_W: i64 = HG_NP*3 // words per strand (GR_WORDS)
306const HG_NSEG: i64 = HG_NP - 1
307const HG_REND_MAX: i64 = 1200 // render strands: the page's shipped NXH_GUIDES budget, PRESERVED and moved here
308const HG_SIM: i64 = 128 // simulated guides per girl. PICKED, named as picked: 1200/128 = 9.4 render
312const HG_TEX_SR: i64 = 4 // strands per guide-texture row: rows = strands/4 keep every hair texture under
314const HG_TAB_W: i64 = 8 // render-strand table row: [rest-idx nb1 nb2 w1 w2 lockw spanz 0]
315const HG_CAP_MAX: i64 = 32 // collider slots (mask bits): head neck 2 shoulders 2 arms torso + DYNA anchors
316const HG_CAP_W: i64 = 10 // ax ay az bx by bz r kind sx sy
317const HG_KIND_CAP: i64 = 0
318const HG_KIND_ELL: i64 = 1
319const HG_Q12: i64 = WATER_MAGIC_4096 // ellipse-scale / segment-parameter fixed point: the engine's fx4096
320const HG_SKEL_W: i64 = 8 // words per SKEL joint: parent x y z + 4 (the 64-byte joint record the page reads)
321const HG_DYNA_MINW: i64 = 8 // a DYNA row carries side x y z k c max infl before an anchor is readable
322const HG_DYNA_MAXW: i64 = 64 // a row wider than this is not this format (nx_nxa_dyna writes 12); bounds the count check
323const HG_DYNA_INFL: i64 = 7 // DYNA word: influence radius (nx_nxa_dyna payload layout)
324const HG_HDR_BYTES: i64 = 512
325const HG_H_LOADED: i64 = 0
326const HG_H_NSTR: i64 = 1
327const HG_H_NREND: i64 = 2
328const HG_H_NSIM: i64 = 3
329const HG_H_SKIN: i64 = 4
330const HG_H_LOCKW: i64 = 5
331const HG_H_NCAP: i64 = 6
332const HG_H_SEGLEN: i64 = 7
333const HG_H_SPAN: i64 = 8
334const HG_H_TICKS: i64 = 9
335const HG_H_PUSHES: i64 = 10
336const HG_H_INSIDE: i64 = 11
337const HG_H_MAXDISP: i64 = 12
338const HG_H_H: i64 = 13
339const HG_H_ZMN: i64 = 14
340const HG_H_HJ: i64 = 15
341const HG_H_RC: i64 = 16
342const HG_H_NOCOLL: i64 = 17 // gate lever: 1 skips the push-out (the neg-control that proves it fires)
343const HG_H_RESTIN: i64 = 18 // rest nodes inside a collider BODY at load: the clipping the operator sees at rest
344const HG_H_WINDOFF: i64 = 19 // gate lever: 1 ignores the wind field
345const HG_H_GUST: i64 = 20
346const HG_H_TICKED: i64 = 21 // girls ticked on the last hairtick
347const HG_RC_NOSTR: i64 = 0 - 1 // load refusals, each naming its conjunct
348const HG_RC_HSTRCAP: i64 = 0 - 2
349const HG_RC_NOVERT: i64 = 0 - 3
350const HG_RC_VERTCAP: i64 = 0 - 4
351const HG_RC_NOSKEL: i64 = 0 - 5
352const HG_RC_SKELCAP: i64 = 0 - 6
354const O_HGHDR: i64 = O_SKIN3 + 24
355const O_HGREST: i64 = O_HGHDR + HG_HDR_BYTES
356const O_HGRL: i64 = O_HGREST + HG_REND_MAX*HG_W*8
357const O_HGCAP: i64 = O_HGRL + HG_SIM*HG_NSEG*8
358const O_HGMASK: i64 = O_HGCAP + HG_CAP_MAX*HG_CAP_W*8
359const O_HGSIMIDX: i64 = O_HGMASK + HG_SIM*8
360const O_HGTAB: i64 = O_HGSIMIDX + HG_SIM*8
361const HG_BLK_BYTES: i64 = HG_MOBS*HG_SIM*HG_W*8
362const O_HGX: i64 = O_HGTAB + HG_REND_MAX*HG_TAB_W*8 // positions
363const O_HGP: i64 = O_HGX + HG_BLK_BYTES // previous positions (velocity = X - P)
364const O_HGD: i64 = O_HGP + HG_BLK_BYTES // THE EXPORT: displacement from rest, the buffer the page copies per frame
365const O_HGSCR: i64 = O_HGD + HG_BLK_BYTES // solver scratch: correction (HG_W) + collider probe (6) + point (3)
366const HG_SCR_WORDS: i64 = HG_W + 9
369const O_PERF: i64 = O_HGSCR + HG_SCR_WORDS*8
376const O_TILE: i64 = O_PERF + PF_WORDS*8
377const TILE_W: i64 = 32 // i64 words per worker slot
378const TILE_HOUT: i64 = 8 // word offset of the 5 wray outs inside a slot
379const TILE_MAX: i64 = 32 // the most workers a band pass may be cut into; the thread ladder
396const O_HQ: i64 = O_TILE + TILE_MAX*TILE_W*8
397const HQ_BYTES: i64 = WX*WZ*8
398const O_URAW: i64 = O_HQ + HQ_BYTES
399const URAW_WORDS: i64 = 44 // GE53: 41 words (r_surf at 40) padded to the vec4u boundary
400const URAW_BYTES: i64 = 176 // URAW_WORDS*4: a vec4u-aligned struct, so the 3-word tail pad is real (was 160 beside WORDS=44 -- pack_uniforms zeroed 176 B into a 160 B block; corrected 2026-09-06 when the GE53 shader shipped its 41-word struct)
401const UR_CAMX: i64 = 0 // Q8 world units (the page used camx()/256)
402const UR_CAMY: i64 = 1
403const UR_CAMZ: i64 = 2
404const UR_TNOW: i64 = 3
405const UR_YAW: i64 = 4 // Q12 radians (the page used yaw()/4096)
406const UR_PITCH: i64 = 5
407const UR_SUNEL: i64 = 6 // Q12 sine of the sun elevation (cal_sunel)
408const UR_DAYT: i64 = 7
409const UR_DLEN: i64 = 8
410const UR_RAIN: i64 = 9
411const UR_SKT: i64 = 10 // packed RGB (spec word 7)
412const UR_SKH: i64 = 11 // packed RGB (spec word 8)
413const UR_SUN: i64 = 12 // spec word 9 (the GPU applies the df>.04 daylight guard)
414const UR_CLD: i64 = 13 // spec word 10
415const UR_WMAX: i64 = 14
416const UR_SELB: i64 = 15 // sel_block(S_SEL)
417const UR_HOK: i64 = 16
418const UR_NPCT: i64 = 17 // npc target t, or -1
419const UR_BROKEN: i64 = 18 // edit counters (broken + placed): the bridge refreshes the voxel texture when their sum moves
420const UR_PLACED: i64 = 19
421const UR_PAL: i64 = 20 // 12 packed RGB words (spec 16..27), vec4u-aligned at byte 80
422const UR_PALF: i64 = 32 // 5 packed RGB words (spec 34..38) at byte 128
423const UR_RESW: i64 = 37 // canvas width in px -- the door tells the sim through set_res (the sim has no window)
424const UR_RESH: i64 = 38
425const UR_SURF: i64 = 40 // Continuous terrain representation.
426const UR_WATER_Q8: i64 = 41 // Water surface from P_WATER, Q8 world units; words42..43 remain padding.
427const UR_YFLIP: i64 = 39 // 1 on the WebGPU door (top-left fragment origin), 0 on WebGL2 -- set_yflip
430const CONTACT_BOX_WORDS: i64 = 6
431const CONTACT_RESULT_WORDS: i64 = 3
432const CONTACT_STATE_WORDS: i64 = 3
433const O_CONTACT: i64 = O_URAW + URAW_BYTES
435const EJ_INDEX_BUCKETS: i64 = EJRN_SLOTS*2
436const O_EJ_INDEX: i64 = O_CONTACT + (2*CONTACT_BOX_WORDS+CONTACT_RESULT_WORDS+CONTACT_STATE_WORDS)*8
437const O_EJ_NEXT: i64 = O_EJ_INDEX + EJ_INDEX_BUCKETS*8
438const CRAFT_TOTAL: i64 = O_EJ_NEXT + EJRN_SLOTS*8
453const NXA_NJ_CAP: i64 = 128 // ref9e 104 joints; the corpus tops out at 370 (nx_nxa_play) = the next rung
454const NXA_ANIM_CAP_W: i64 = 131072 // 1 MiB of key words; ref9e ANIM measured 113,465 words
455const NXA_POSE_CAP_W: i64 = 2048 // ref9e POSE measured 835 words (one frozen stand pose)
456const NXA_HDR_W: i64 = 16
457const NXA_H_LOADED: i64 = 0
458const NXA_H_NJ: i64 = 1
459const NXA_H_DUR: i64 = 2
460const NXA_H_MPB: i64 = 3
461const NXA_H_RJ: i64 = 4
462const NXA_H_POSE: i64 = 5
463const NXA_H_RV: i64 = 6 // six words: x0 y0 vx16 vy16 t0 span (nx_nxa_anim_lib NA_RV_W)
464const NXA_H_RC: i64 = 12
465const NXA_H_NAW: i64 = 13
467const NXA_H_NPW: i64 = 14
468const NXA_H_MORF_TOKEN: i64 = 15
469const NXA_MOB_W: i64 = 4 // per girl: idle weight q12, clip-time adjustment ms, two spare
470const NXA_M_IW: i64 = 0
471const NXA_M_CTADJ: i64 = 1
475const NXA_IW_IN_TENTHS_PER_S: i64 = 50
476const NXA_IW_OUT_TENTHS_PER_S: i64 = 25
477const NXA_SNAP_TENTHS_PER_S: i64 = 60
478const NXA_SNAP_IW_MAX_Q12: i64 = 3891
479const NXA_IW_FLOOR_Q12: i64 = 16
480const NXA_DT_MS_MAX: i64 = 1000 // a tab that slept a minute eases one second, it does not slam
481const NXA_RC_NOT_LOADED: i64 = 0 - 1
482const NXA_RC_NO_MOB: i64 = 0 - 2
483const NXA_RC_SLOT: i64 = 0 - 3
484const NXA_RC_NJ_ZERO: i64 = 0 - 11
485const NXA_RC_NJ_CAP: i64 = 0 - 12
486const NXA_RC_NAW_ZERO: i64 = 0 - 13
487const NXA_RC_NAW_CAP: i64 = 0 - 14
488const NXA_RC_NPW_CAP: i64 = 0 - 15
489const NXA_RC_POSE_OVERRUN: i64 = 0 - 16
490const NXA_RC_TRACKS: i64 = 0 - 20 // plus nx_nxa_anim_lib's own rc: -21 bad tracks, -22 overrun
495const CRAFT_STATIC_RESERVE_PAGES: i64 = 1
496const CRAFT_STATIC_BASE_PAGES: i64 = WASM_PAGES
497const CRAFT_STATIC_LIMIT_PAGES: i64 = CRAFT_STATIC_BASE_PAGES+CRAFT_STATIC_RESERVE_PAGES
498const CRAFT_STATIC_BASE: i64 = CRAFT_STATIC_BASE_PAGES*WASM_PAGE_BYTES
499const CRAFT_STATIC_LIMIT: i64 = CRAFT_STATIC_LIMIT_PAGES*WASM_PAGE_BYTES
500const O_NXA: i64 = CRAFT_STATIC_LIMIT
501const O_NXA_SKEL: i64 = O_NXA + NXA_HDR_W*8
502const O_NXA_TIDX: i64 = O_NXA_SKEL + NXA_NJ_CAP*NA_SKEL_W*8
503const O_NXA_PQ: i64 = O_NXA_TIDX + NXA_NJ_CAP*NA_IDX_W*8
504const O_NXA_PD: i64 = O_NXA_PQ + NXA_NJ_CAP*4*8
505const O_NXA_MOB: i64 = O_NXA_PD + NXA_NJ_CAP*3*8
506const O_NXA_SCR: i64 = O_NXA_MOB + WC_CAST_N*NXA_MOB_W*8
507const O_NXA_OUT: i64 = O_NXA_SCR + NA_SCR_W*8
508const O_NXA_POSE: i64 = O_NXA_OUT + WC_CAST_N*NXA_NJ_CAP*NA_ROW_W*8
509const O_NXA_ANIM: i64 = O_NXA_POSE + NXA_POSE_CAP_W*8
511const O_NXA_ORDER: i64 = O_NXA_ANIM + NXA_ANIM_CAP_W*8
515const O_NXA_GAIT: i64 = O_NXA_ORDER+NXA_NJ_CAP*8
516const NXA_GAIT_CAP: i64 = NXA_ANIM_CAP_W/NA_CH2_KEY_W
517const O_NXA_GAIT_GENERATION: i64 = O_NXA_GAIT+NA_GAIT_INPUT_W*8
518const O_NXA_GAIT_HEADER: i64 = O_NXA_GAIT_GENERATION+8
519const O_NXA_GAIT_TABLE: i64 = O_NXA_GAIT_HEADER+NA_GAIT_HEADER_W*8
520const NXA_M_PATH_Q14: i64 = 2
521const NXA_M_MOVING: i64 = 3
522const NXA_PATH_Q14: i64 = NA_Q12*4
523const NXA_SCALE_BASE: i64 = 940
524const NXA_SCALE_STEP: i64 = 30
525const NXA_SCALE_DEN: i64 = 1000
527const CRAFT_EXT_TOTAL: i64 = O_NXA_GAIT_TABLE+NXA_GAIT_CAP*NA_GAIT_ROW_W*8
529const WASM_PAGES_REQ: i64 = (CRAFT_EXT_TOTAL + WASM_PAGE_BYTES - 1)/WASM_PAGE_BYTES
535const HG_MIB: i64 = 1048576
536const HG_SCR_HSTR: i64 = O_FB
537const HG_SCR_HSTR_CAP: i64 = 4*HG_MIB
538const HG_SCR_VERT: i64 = O_FB + 4*HG_MIB
539const HG_SCR_VERT_CAP: i64 = 8*HG_MIB
540const HG_SCR_SKEL: i64 = O_FB + 12*HG_MIB
541const HG_SCR_SKEL_CAP: i64 = 2*HG_MIB
542const HG_SCR_DYNA: i64 = O_FB + 14*HG_MIB
543const HG_SCR_DYNA_CAP: i64 = HG_MIB
545const HG_TPS: i64 = 60 // see the header: the page accumulator's 16.6667 ms, hd_ticks_per_s()
546const HG_UNITS_PER_178CM: i64 = 171530 // the page's pairing (GPE_UNITS_PER_178CM), named as the same number
547const HG_CM_178: i64 = 178
548const HG_CM_PER_M: i64 = 100
549const HG_UPB: i64 = HG_UNITS_PER_178CM*HG_CM_PER_M/HG_CM_178 // bind units per world block (1 block = 1 m): 96365
550const HG_G_CMS2: i64 = 981 // standard gravity, cm/s^2
551const HG_G: i64 = HG_G_CMS2*HG_UNITS_PER_178CM/(HG_CM_178*HG_TPS*HG_TPS) // 262 units/tick^2 -- the dress lane's NXGD_G derivation
552const HG_FTL_S_PERMIL: i64 = 1000 - SB_C_HAIR*1000/SD_G // DFTL s_damping (Mueller 2012 "Fast Simulation of Inextensible Hair
554const HG_FENCE_DIV: i64 = 4 // the chain's small-angle validity fence: seglen/4 (SD_Q8/4 in the retired page solver)
555const HG_PROJ_ITERS: i64 = 3 // length/collision alternations per point; the LAST op is always the length projection
556const HG_LOCK_W_MIN: i64 = 900 // the ribbon builder's lock half-width floor (w09 = max(900, span*.045)), PRESERVED
557const HG_LOCK_W_PERMIL: i64 = 45
558const HG_SKIN_NUM: i64 = 16 // skin = lockw x 1.6: half-width + the .6 child scatter -- the farthest a render vertex sits off its guide
559const HG_SKIN_DEN: i64 = 10
560const HG_REACH_DIV: i64 = 2 // collider mask reach = strand length / 2: twice the static fence (L/4), for overshoot
561const HG_GUST_TICKS: i64 = 2*HG_TPS // gust envelope cadence 0.5 Hz: the incumbent shader sway (3.1 rad/s), PRESERVED
562const HG_GUST_SALT: i64 = 3400 // whash seed offset (the weather lib salts with seed + 3300)
563const HG_TORSO_GATE_X: i64 = 15000 // the MFS torso gate (axb < 15000.), the same half-width the paint bands use
565const HG_R_HEADBAND: i64 = 885
566const HG_R_HEAD_J: i64 = 955
567const HG_R_ACROMION: i64 = 818
568const HG_R_CHEST: i64 = 720
569const HG_R_HIP: i64 = 520
570const HG_R_ELBOW: i64 = 630
571const HG_R_NECK_LO: i64 = 840
572const HG_R_SH_LO: i64 = 770
573const HG_R_SH_HI: i64 = 860
574const HG_R_ARM_LO: i64 = 600
575const HG_R_ARM_HI: i64 = 800
576const HG_R_ARM_XMIN: i64 = 60
577const HG_R_ELBOW_XMIN: i64 = 50
580const TH_RAIN: i64 = 1
581const TH_FEAR: i64 = 2
582const TH_MET: i64 = 3
583const TH_SLEPT: i64 = 4
584const TH_HUNGRY: i64 = 5
585const TH_SAWTAKEN: i64 = 6
586const TH_HEARD_TAKEN: i64 = 7
587const TH_HEARD_FRIEND: i64 = 8
588const TH_COMPANY: i64 = 9
590const GO_FRIEND: i64 = 1
591const GO_TAKEN: i64 = 2
592const SAVE_MAGIC: i64 = 20260728001
593const SAVE_VER: i64 = 6 // v6 = STREAMING WORLD (origin + edit journal in the image);
595const SAVE_VER5: i64 = 5
597const MC_X: i64 = 0
598const MC_Y: i64 = 1
599const MC_Z: i64 = 2
600const MC_KIND: i64 = 3
601const MC_PH: i64 = 4
602const MC_DISG: i64 = 5 // 1 = a HUMAN girl disguised as a monster girl (the lore:
605const MC_GENE: i64 = 6 // 20-bit APPEARANCE GENOME rolled at spawn -- every girl is
611const S_SEED: i64 = 0
612const S_CX: i64 = 1 // camera pos Q8 (256 = one block)
613const S_CY: i64 = 2
614const S_CZ: i64 = 3
615const S_YAW: i64 = 4 // it-units (IT_PI = half turn)
616const S_PITCH: i64 = 5
617const S_T: i64 = 6
618const S_BROKEN: i64 = 7
619const S_PLACED: i64 = 8
620const S_HX: i64 = 9 // crosshair DDA hit cache
621const S_HY: i64 = 10
622const S_HZ: i64 = 11
623const S_HFACE: i64 = 12 // 0 none, 1 +x, 2 -x, 3 +y, 4 -y, 5 +z, 6 -z
624const S_HOK: i64 = 13 // 1 = in reach
625const S_VY: i64 = 14 // vertical velocity Q8/tick (jump + gravity)
626const S_GROUNDED: i64 = 15 // 1 = standing on a surface (jump allowed)
627const S_SEL: i64 = 16 // hotbar slot 0..4 (Q cycles; sel_block maps to a block type)
628const S_LBX: i64 = 17 // last-broken cell (probes/particles; the hit cache retargets
629const S_LBY: i64 = 18 // every frame, so "what did I just break" needs its own slots)
630const S_LBZ: i64 = 19
631const S_Q: i64 = 20 // ray pixel size 2..5 -- ADAPTIVE: the organ tunes itself from
632const S_FMA: i64 = 21 // the surface's reported frame ms (EMA x16); shim only reports
633const S_WMAX: i64 = 22 // highest solid y in the world -- rays above it heading up/flat
635const S_SPX: i64 = 23 // spawn point (H key + void-fall auto-respawn return here)
636const S_SPY: i64 = 24
637const S_SPZ: i64 = 25
638const S_NPCT: i64 = 26 // crosshair NPC target: dense index of the girl under the
640const S_FOUND: i64 = 27 // disguised humans FOUND (met + identified = under protection)
641const S_LOST: i64 = 28 // found humans TAKEN by wardens (the cost of not protecting)
642const S_BCD: i64 = 29 // birth cooldown ticks (community pacing)
643const S_WOX: i64 = 30 // WORLD ORIGIN of the window, in blocks (v6 streaming): the
644const S_WOZ: i64 = 31 // arena is a 128x48x128 CACHE over unbounded absolute terrain
645const S_EJDROP: i64 = 32 // edits REFUSED because the journal was full (loud, never silent)
646const S_HARV: i64 = 33 // MATURE crops harvested (the farming loop's payoff counter)
647const S_PLANT: i64 = 34 // seeds planted
648const S_GROWN: i64 = 35 // crops that reached maturity (world truth, gate-readable)
649const S_VAR: i64 = 36 // which world identity this arena runs (the passport's
651const S_GENP: i64 = 37
652const S_TGT: i64 = 38 // DISPLAY-DERIVED frame budget, EMA-x16 units (0 = shipped
657const S_BLDG: i64 = 39 // W3 settlements: buildings stamped into this arena (a
662const S_BLDGX: i64 = 40 // last-stamped building anchor, arena-local (gate probe)
663const S_BLDGY: i64 = 41 // its floor height
664const S_BLDGZ: i64 = 42
665const S_RESW: i64 = 44 // GE55: canvas size and origin, written by the door (set_res / set_yflip)
666const S_RESH: i64 = 45
667const S_YFLIP: i64 = 46
668const S_FACE_RADIUS: i64 = 49
669const S_FACE_GAIN: i64 = 50
670const FACING_RADIUS_MAX_Q8: i64 = 2147483647
671const S_AGEN: i64 = 47
672const S_DPAPPLIED: i64 = 48 // GE59: the P_DAYPHASE value last applied to S_T (0 = never) -- one re-base per distinct poke, never per tick // GE57: arena GENERATION -- +1 per wc_shift that moves. The GPU tiers key every voxel-texture upload on it: a 16-block re-base drawn against the previous texture is the transport/fall-through the operator sees (2026-09-05).
673const S_GT_KEEP: i64 = 43 // ground-truth capture: when 1, render_impl leaves the depth plane in
677const SHIFT_STRIDE: i64 = 16 // one window slide, in blocks
678const SHIFT_MARGIN: i64 = 32 // player this close to a window edge -> the world slides under them
681const P_TBASE: i64 = 0 // terrain base height
682const P_TAMP1: i64 = 1 // large-noise amplitude
683const P_TAMP2: i64 = 2 // detail-noise amplitude
684const P_WATER: i64 = 3 // flood level
685const P_SNOW: i64 = 4 // snow line (99 = never)
686const P_TREE: i64 = 5 // tree sparsity modulus (0 = no trees)
687const P_CAVETH: i64 = 6 // cave carve threshold (lower = more cavern)
688const P_SKYTOP: i64 = 7 // packed zenith colour
689const P_SKYHOR: i64 = 8 // packed horizon colour
690const P_SUN: i64 = 9 // 1 = sun disc
691const P_CLOUD: i64 = 10 // 1 = cloud deck
695const P_WXCOV: i64 = 11 // cloud coverage Q12 (drives the cloud density band)
696const P_WXWINDX: i64 = 12 // wind x component, Q12-scaled speed*cos(dir)
697const P_WXWINDZ: i64 = 13 // wind z component
698const P_WXTYPE: i64 = 14 // precip type this eighth: 0 none, 1 rain, 2 snow
699const P_WXTEMP: i64 = 15 // temperature Q12 (relative scale, freezing=1024)
700const P_PAL: i64 = 16 // +blocktype = packed base colour (0..11)
701const P_MOBC: i64 = 28 // +kind*2+half = packed mob colours (3 kinds x 2 tones)
702const P_PAL2: i64 = 34 // +b-12 = packed colour for farm blocks 12..16 (5 rows, 34-38)
703const P_DAYLEN: i64 = 40 // A1 calendar: ticks per day (ALL timing is spec DATA)
704const P_SEASD: i64 = 41 // days per season (4 seasons cycle)
705const P_GROWE: i64 = 42 // farm-tick cadence: one grow/hydrate pass every N ticks
706const P_GROWW: i64 = 43 // crop speed on WET farmland (Minecraft stencil speed)
707const P_GROWD: i64 = 44 // crop speed on DRY farmland
708const P_RAINS: i64 = 45 // +season = rain permil per day-eighth (4 rows, 45-48)
731const P_STYLE: i64 = 49
732const P_DAYPHASE: i64 = 39 // GE59 (2026-09-05): the boot clock as DATA -- the OTHER dead hole (world_recipes.conf names 39 and 49). Post-boot band, so it cannot be read at init: apply2_impl re-bases S_T to it on the next tick, once per distinct value; 0 (the zeroing loop) leaves the DAYLEN/4 boot phase, so every existing world is byte-identical by construction. If P_PAL2 ever widens, this slot moves with the ONE named const.
733const WC_STYLE_REAL: i64 = 0 // textured, smooth light -- the shipped look, unchanged
734const WC_STYLE_TOON: i64 = 1 // banded light (anime/cel)
735const WC_STYLE_FLAT: i64 = 2 // untextured facets (artsy low-poly)
736const WC_STYLE_SOFT: i64 = 3 // SMOOTH TERRAIN: ground lit by a heightfield normal interpolated across the block (no grid bevel, no per-block facet)
740const WC_SOFT_SCAN: i64 = 3
741const WC_STYLE_MAX: i64 = 3 // the highest id this engine owns; set_style REFUSES above it
745const WC_TOON_CUT: i64 = 588
746const WC_TOON_LO: i64 = 412
747const WC_TOON_HI: i64 = 922
754const WC_TEX_NEUTRAL: i64 = 128
755const P_ADV: i64 = 50 // +i = smart-object ADVERTISEMENTS (C1): packed
759const P_HISTAGE: i64 = 60 // DECLARED geomorphic stage (Strahler bands): 0 = mature/
766const P_TREEMAX: i64 = 59 // tree altitude ceiling (0 = the historic hardcoded 19)
767const P_TREESPEC: i64 = 61 // W2 SPECIES GENOME (packed, 0 = legacy 4-block stamp):
777const P_WARD: i64 = 58 // warden daytime hunt radius in BLOCKS (0 = the 12-block
781const P_OUTFIT: i64 = 57 // outfit mode: 0 = identity keeps everyone clothed;
786const P_CURI: i64 = 56 // curiosity threshold: a girl approaches the player only
795const P_BLDG: i64 = 62 // W3 settlement density: site-cell modulus (0 = none; the
797const P_BLDGSPEC: i64 = 63 // low 4 bits = archetype row in nx_indoorgen_data
798const P_ERODE: i64 = 64 // E1 TALUS EROSION BUDGET in relaxation ticks (0 = OFF).
804const P_ERTAL: i64 = 65 // DERIVED talus threshold, WC_ER_Q units. NEVER authored:
832const P_GARM: i64 = 70
833const GAR_N: i64 = 9
834const GAR_BIKINI_TOP: i64 = 1
835const GAR_BIKINI_BOT: i64 = 2
836const GAR_ONEPIECE: i64 = 3
837const GAR_SARONG: i64 = 4
838const GAR_SUNDRESS: i64 = 5
839const GAR_TEE: i64 = 6
840const GAR_SHORTS: i64 = 7
841const GAR_SKIRT: i64 = 8
842const GAR_DRESS: i64 = 9
843const GAR_COV_TOP: i64 = 1
844const GAR_COV_BOT: i64 = 2
845const GAR_COV_FULL: i64 = 3
846const GAR_CAT_SWIM: i64 = 0
847const GAR_CAT_COVER: i64 = 1
848const GAR_CAT_CASUAL: i64 = 2
849const GAR_CAT_EVENING: i64 = 3
850const GAR_CAT_NONE: i64 = 4 // what mobgarc reports for a girl wearing nothing
851const GAR_CAT_SH: i64 = 2
852const GAR_CAT_MASK: i64 = 7
853const GAR_HUE_SH: i64 = 8
854const GAR_HUE_MASK: i64 = 511
855const GAR_SPAN_SH: i64 = 17
856const GAR_SPAN_MASK: i64 = 63
857const GAR_SPAN_UNIT_DEG: i64 = 4
858const GAR_SAT_SH: i64 = 23
859const GAR_LIT_SH: i64 = 27
860const GAR_NIB_MASK: i64 = 15
861const GAR_TINT_STOPS: i64 = 4 // MG_OUTFIT_MASK + 1: two genome bits, four stops
862const GAR_SLOT_SH: i64 = 8 // outfit word = upper id << GAR_SLOT_SH | lower id
863const GAR_ID_MASK: i64 = 255
864const HSL_DEG_FULL: i64 = 360
865const HSL_SECTOR_DEG: i64 = 60
866const MG_BEACH_SH: i64 = 18 // the beachwear genome bits the MIXED beach breeds (P_OUTFIT)
867const MG_BEACH_MASK: i64 = 3
868const MOB_POSE_SLEEP: i64 = 2 // mob_pose's published sleep id (the pose door's contract)
869const B_WATER: i64 = 4 // the water block (wshade2's shimmer branch, the shore ramp)
870const WC_SPECN: i64 = 79 // spec words the engine owns: 69 -> 79 for the GE13b wardrobe
881const P_OCEAN: i64 = 66
892const P_WPIPE: i64 = 67
903const P_WPSCALE: i64 = 68
904const P_SURF: i64 = 69 // GE53 SURFACE SOURCE: 0 = the cell grid (all voxel, byte-identical to
911const WC_SURF_STEP_Q8: i64 = 64
912const WC_GAIT_BOB_Q8: i64 = 7 // thorax oscillation AMPLITUDE (~2.7cm, 5.5cm p2p --
921const WC_BREATH_TICKS: i64 = 257
932const WC_BREATH_Q8: i64 = 1
937const WC_BREATH_CUT_Q8: i64 = 24
938const WC_STEP_EASE_UP: i64 = 48 // mob Y climb rate Q8/tick (a 1-block rise ~ 5 ticks)
939const WC_NIGHT_X8: i64 = 5 // night begins at this eighth of the day (5/8)
941const EYE: i64 = 435 // eye height Q8 (~1.7 blocks)
942const SPEED: i64 = 40 // walk Q8 per tick
947const WC_PH_PER_TICK: i64 = 5 // the free-running advance MC_PH still uses for WANDER
948const WC_PH_ANG: i64 = 214 // angle-units per phase unit (the incumbent's drive scaling)
949const WC_NEED_GAIT: i64 = 3 // the needs row's spare slot, named now that it carries a value
958const WC_DDEG_HALFTURN: i64 = 1800 // decidegrees in IT_PI (a half turn): the ddeg -> it-unit scale
965const WC_STRIDE_Q8: i64 = 374
971const WC_PELVIS_ROT_DDEG: i64 = 52
980const WC_THORAX_ROT_DDEG: i64 = 146
984const WC_ELBOW_ROM_DDEG: i64 = 297
995const WC_TURN_PER_STRIDE: i64 = IT_PI/2
996const TURN: i64 = 140 // yaw it-units per tick (keyboard turn / legacy dir path)
997const PITCHV: i64 = 90 // pitch it-units per tick (R/F keyboard look)
998const PITCH_MAX: i64 = 5000
999const LOOKS: i64 = 6 // mouselook: it-units per accumulated look count
1000const JUMPV: i64 = 66 // jump takeoff velocity Q8/tick
1001const GRAV: i64 = 9 // gravity Q8/tick^2
1002const VTERM: i64 = 120 // terminal fall velocity Q8/tick -- ONE ruler for the player AND every mob
1010const WC_IMP_SCALE: i64 = SD_Q8/4
1011const MAXSTEPS: i64 = 110 // DDA cells per ray (view distance)
1012const REACH_STEPS: i64 = 20 // crosshair edit reach in DDA cells
1053const EJRN_KEY_MAX: i64 = 72057594037927935
1054const EJRN_TAG_MASK: i64 = 0-256
1267const WC_ER_Q: i64 = 256 // fixed point the pass runs in. World heights are
1271const WC_ER_STABLE_Q: i64 = WC_ER_Q / 4 // DERIVED, not tasted: an explicit 4-neighbour
1275const WC_ER_RATE_Q: i64 = WC_ER_STABLE_Q / 2 // WRITTEN AS THE ARITHMETIC: half the stability
1280const WC_ER_MAXK: i64 = 3 // STRUCTURAL, not a clamp: three unrolled levels
1285const WC_ER_FLAT: i64 = 0 - 1 // P_ERTAL sentinel: measured, and there is no relief
1550const WC_REVIEW_ARC: i64 = IT_PI/2
1589const S_MOVE_MODE: i64 = 51
1590const S_MOVE_GRAV_MM: i64 = 52
1591const S_MOVE_JUMP_MM: i64 = 53
1592const S_MOVE_WALK_MM: i64 = 54
1593const S_MOVE_TERM_MM: i64 = 55
1594const S_MOVE_STEP_Q8: i64 = 56
1595const S_MOVE_REPEAT: i64 = 57
1596const S_MOVE_VNUM: i64 = 58
1597const S_MOVE_RY: i64 = 59
1598const S_MOVE_RX: i64 = 60
1599const S_MOVE_RZ: i64 = 61
1600const S_MOVE_LAST_JUMP: i64 = 62
1601const S_MOVE_REV: i64 = 63
1602const WC_MOVE_HZ: i64 = 60
1603const WC_MOVE_Q8: i64 = 256
1604const WC_MOVE_MM: i64 = 1000
1605const WC_MOVE_DEN: i64 = WC_MOVE_MM*WC_MOVE_HZ*WC_MOVE_HZ
1606const WC_MOVE_HDEN: i64 = WATER_MAGIC_4096*WC_MOVE_MM*WC_MOVE_HZ
1608const WC_MOVE_SPEED_MAX_MM: i64 = WY*WC_MOVE_MM*WC_MOVE_HZ
1609const WC_MOVE_GRAV_MAX_MM: i64 = WC_MOVE_SPEED_MAX_MM*WC_MOVE_HZ
1610const WC_MOVE_RC_PROFILE: i64 = 0 - 81
1611const WC_MOVE_RC_ACTIVE: i64 = 0 - 82
2046const BLDG_SITE: i64 = 40 // site-cell stride, blocks
2047const IG_SCAN0: i64 = 10 // W3 solve: first candidate anchor offset inside the site cell
2048const IG_SCANSTEP: i64 = 10 // candidate grid step: 3x3 covers offsets 10/20/30; footprint
2052const IG_MAXSLOPE: i64 = 2 // pre-declared accept rule: corners may deviate <=2 blocks from
2056const IG_FOUND: i64 = 3 // foundation skirt courses below the floor (IG_MAXSLOPE + 1)
3365const MOB_R_Q8: i64 = 90

functions

1014func wst(base: i64) -> *i64 { return (base + O_ST) as *i64 }
1015func wsp(base: i64) -> *i64 { return (base + O_SPEC) as *i64 }
1016func wgp(base: i64) -> *i64 { return (base + O_GENP) as *i64 }
1017func mobp(base: i64) -> *i64 { return (base + O_MOBS) as *i64 }
1018func wfb(base: i64) -> *i64 { return (base + O_FB) as *i64 }
1019func wvx(base: i64) -> *u8 { return (base + O_VOX) as *u8 }
1020func winp(base: i64) -> *i64 { return (base + O_INPUT) as *i64 }
1021func wpack(r: i64, g: i64, b: i64) -> i64 { return r | (g << 8) | (b << 16) }
1022func wclamp(v: i64, lo: i64, hi: i64) -> i64 { if v < lo { return lo } if v > hi { return hi } return v }
1024func vin(x: i64, y: i64, z: i64) -> i64
1030func vget(base: i64, x: i64, y: i64, z: i64) -> i64
1035func vset(base: i64, x: i64, y: i64, z: i64, b: i64) -> i64
1048func ejp(base: i64) -> *i64 { return (base + O_EJRN) as *i64 }
1049func ej_key(ax: i64, ay: i64, az: i64) -> i64
1055func ej_key_representable(ax: i64, ay: i64, az: i64) -> i64
1062func ej_tag_matches(cur: i64, key: i64) -> i64
1066func ej_index_bucket(tag: i64) -> i64
1074func ej_batch_begin(base: i64, available_bytes: i64) -> *i64
1094func ej_index_get(base: i64, heads: *i64, ax: i64, ay: i64, az: i64) -> i64
1111func ej_index_put(base: i64, heads: *i64, ax: i64, ay: i64, az: i64, b: i64) -> i64
1141func ej_put(base: i64, ax: i64, ay: i64, az: i64, b: i64) -> i64
1148func ej_get(base: i64, ax: i64, ay: i64, az: i64) -> i64
1155func ej_overlay(base: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64) -> i64
1178func wc_edit(base: i64, x: i64, y: i64, z: i64, b: i64) -> i64
1188func vsolid(base: i64, x: i64, y: i64, z: i64) -> i64
1197func whash(x: i64, z: i64, sd: i64) -> i64
1205func wnoise(x: i64, z: i64, sc: i64, sd: i64) -> i64
1221func wheight_raw(base: i64, x: i64, z: i64, sd: i64) -> i64
1296func wheight_q(base: i64, x: i64, z: i64, sd: i64) -> i64
1307func wc_er_flux(d: i64, t: i64) -> i64
1317func wc_er_talus(base: i64, sd: i64) -> i64
1347func wc_er_arm(base: i64, sd: i64) -> i64
1357func wc_er1(base: i64, x: i64, z: i64, sd: i64, t: i64) -> i64
1366func wc_er2(base: i64, x: i64, z: i64, sd: i64, t: i64) -> i64
1375func wc_er3(base: i64, x: i64, z: i64, sd: i64, t: i64) -> i64
1388func wheight(base: i64, x: i64, z: i64, sd: i64) -> i64
1403func wheight_qe(base: i64, x: i64, z: i64, sd: i64) -> i64
1418func wsp_beach_ocean_q(sp: *i64, ax: i64, az: i64, hq: i64) -> i64
1431func hq_get(base: i64, x: i64, z: i64) -> i64
1439func hq_set(base: i64, x: i64, z: i64, v: i64) -> i64
1444func hq_off() -> i64 { return O_HQ }
1448func wc_surface_source(base: i64, pxq: i64, pzq: i64) -> i64
1465func wterrain(b: i64) -> i64
1477func wnoise3(x: i64, y: i64, z: i64, sc: i64, sd: i64) -> i64
1501func wc_wmax(base: i64) -> i64
1523func wsp_ocean_d(sp: *i64, ax: i64, az: i64) -> i64
1538func wsp_sea_yaw(sp: *i64) -> i64
1557func wsp_beach_ocean(sp: *i64, ax: i64, az: i64, h: i64) -> i64
1573func wc_player_position_clear(base: i64, x: i64, y: i64, z: i64) -> i64
1613func wc_move_reset(base: i64) -> i64
1620func wc_move_valid(mode: i64, grav: i64, launch: i64, walk: i64,
1635func wc_move_commit_validated(base: i64, mode: i64, grav: i64, launch: i64, walk: i64,
1646func wc_move_set(base: i64, mode: i64, grav: i64, launch: i64, walk: i64,
1658func wc_move_boot(base: i64, world: i64) -> i64
1664func wc_move_horizontal(base: i64, axis: i64, direction: i64) -> i64
1675func wc_move_vertical_request(base: i64, jump: i64) -> i64
1694func movement_profile_set(mode: i64, grav_mm_s2: i64, jump_mm_s: i64,
1698func movement_profile_field(field: i64) -> i64
1702func movement_tick_hz() -> i64 { return WC_MOVE_HZ }
1703func movement_velocity_denominator() -> i64 { return WC_MOVE_DEN }
1705func wc_player_recover(base: i64) -> i64
1731func player_position_clear() -> i64
1735func player_recover() -> i64 { return wc_player_recover(0) }
1738func wc_hq_column(base: i64, x: i64, z: i64, ax: i64, az: i64, sd: i64) -> i64
1743func wc_hq_restore(base: i64) -> i64
1758func gencol(base: i64, x: i64, z: i64, ax: i64, az: i64, sd: i64) -> i64
1795func vset_box(base: i64, x: i64, y: i64, z: i64, b: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64) -> i64
1817func wsp_palm_shape(base: i64, sp: *i64, tx: i64, tz: i64, h2: i64, th9: i64, cr9: i64,
1874func gentrees(base: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64, sd: i64) -> i64
2060func igfloor(a: i64, b: i64) -> i64
2065func ig_rotx(r: i64, x: i64, z: i64) -> i64
2071func ig_rotz(r: i64, x: i64, z: i64) -> i64
2077func genbuildings(base: i64, lx0: i64, lx1: i64, lz0: i64, lz1: i64, sd: i64) -> i64
2216func genworld(base: i64, sd: i64) -> i64
2239func wc_hq_shift(base: i64, dx: i64, dz: i64) -> i64
2262func wc_shift(base: i64, dx: i64, dz: i64) -> i64
2370func wray_surf(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64) -> i64
2445func wray2(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64, skipw: i64) -> i64
2472func wray3(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64, skipw: i64, skipt: i64) -> i64
2558func wray(base: i64, dx: i64, dy: i64, dz: i64, maxsteps: i64, out: *i64) -> i64
2563func wcol(base: i64, b: i64) -> i64
2571func sel_block(sel: i64) -> i64
2581func wface_l(face: i64) -> i64
2589func wsky(base: i64, syy: i64) -> i64
2613func wcloud(camx: i64, camy: i64, camz: i64, dx: i64, dy: i64, dz: i64, t: i64) -> i64
2627func wsky2(base: i64, syy: i64, px: i64, py: i64, sunx: i64, suny: i64, sunon: i64) -> i64
2652func wao(base: i64, cx2: i64, cy2b: i64, cz2: i64, face: i64, u: i64, v: i64) -> i64
2708func wshade2(base: i64, b0: i64, face: i64, steps: i64, syy: i64, hpx: i64, hpy: i64, hpz: i64, t2: i64, clx: i64, cly: i64, clz: i64) -> i64
2803func wc_spec(base: i64, v: i64) -> i64
3056func genmobs(base: i64, sd: i64) -> i64
3098func wc_spawn_bush(base: i64, forward: i64, lateral: i64, radius: i64, height: i64, material: i64) -> i64
3149func init_impl_v(base: i64, v: i64, seed: i64) -> i64
3265func init_impl(base: i64, seed: i64) -> i64 { return init_impl_v(base, 0, seed) }
3268func wc_respawn(base: i64) -> i64
3280func wground(base: i64, x: i64, z: i64) -> i64
3290func wc_contact_floor_below_q(base: i64, xq: i64, zq: i64, top: i64, ceiling: i64) -> i64
3317func wc_contact_floor_q(base: i64, xq: i64, zq: i64, top: i64) -> i64
3322func wstand(base: i64, nxq: i64, nzq: i64, cyq: i64) -> i64
3340func wstand_here(base: i64, xq: i64, zq: i64) -> i64
3366func mob_solid2(base: i64, x: i64, g: i64, z: i64) -> i64
3371func mob_clear_x(base: i64, nx: i64, nz: i64, g: i64) -> i64
3380func mob_clear_z(base: i64, nx: i64, nz: i64, g: i64) -> i64
3389func mob_fits(base: i64, x: i64, g: i64, z: i64) -> i64
3395func mob_ground(base: i64, x: i64, ytop: i64, z: i64) -> i64
3415func mob_step_gait(vyp: *i64, k: i64, cy0: i64, ng: i64) -> i64
3438func npc_pick(base: i64, fx: i64, fy: i64, fz: i64) -> i64
3469func cal_dayt(base: i64) -> i64
3475func cal_day(base: i64) -> i64
3481func cal_season(base: i64) -> i64
3487func cal_night(base: i64) -> i64
3493func cal_sunel(base: i64) -> i64
3502func cal_rain(base: i64) -> i64
3517func wc_weather_tick(base: i64) -> i64
3537func dg_bst(dg: i64, b: i64) -> i64 { return dg - ((dg >> 3) & 7)*8 + b*8 }
3544func wc_grow_set_indexed(base: i64, index: *i64, lx: i64, ly: i64, lz: i64, b: i64) -> i64
3552func wc_grow_set(base: i64, lx: i64, ly: i64, lz: i64, b: i64) -> i64
3558func wc_wet_near(base: i64, lx: i64, ly: i64, lz: i64) -> i64
3571func wc_farm_tick(base: i64) -> i64
3632func wc_soft_seat_all(base: i64) -> i64
3644func passp(base: i64) -> *i64 { return (base + O_PASS) as *i64 }
3645func wc_pass_ck(p: *i64) -> i64
3648func wc_party_count(base: i64) -> i64
3661func wc_pass_sync(base: i64) -> i64
3717func wc_pass_apply(base: i64) -> i64
3760func pass_level_of(base: i64) -> i64
3768func party_of(base: i64) -> i64
3797func mob_pose(base: i64, k: i64) -> i64
3805func mobpose(k: i64) -> i64 { return mob_pose(0, k) }
3822func wc_mob_in_water(base: i64, k: i64) -> i64
3828func wc_outfit(base: i64, k: i64) -> i64
3862func mob_outfit(base: i64, k: i64) -> i64
3868func mob_outfit_v1(base: i64, k: i64) -> i64
3882func wc_need_seed(base: i64) -> i64
3898func mindp(base: i64) -> *i64 { return (base + O_MIND) as *i64 }
3899func wc_mind_zero(base: i64) -> i64
3906func th_add(base: i64, k: i64, id: i64, mag: i64, ttl: i64) -> i64
3929func th_mood(base: i64, k: i64) -> i64
3944func go_add(base: i64, k: i64, subj: i64, pred: i64, conf: i64) -> i64
3967func go_newest(base: i64, k: i64) -> i64
3985func wc_ddeg(d: i64) -> i64 { return d*IT_PI/WC_DDEG_HALFTURN }
3988func wc_amp_ddeg(range_ddeg: i64) -> i64 { return wc_ddeg(range_ddeg)/2 }
4007func wc_stride_ang(g_q8: i64) -> i64 { return g_q8*2*IT_PI/WC_STRIDE_Q8 }
4009func wc_angwrap(d: i64) -> i64
4032func wc_hdg_budget(hdg: i64, dx: i64, dz: i64, budget: i64) -> i64
4054func wc_hdg_step(hdg: i64, dx: i64, dz: i64) -> i64
4058func wc_facing_step(hdg: i64, dx: i64, dz: i64, player_dx: i64, player_dz: i64, radius: i64, budget: i64) -> i64
4064func wc_hdg_of(base: i64, k: i64) -> i64 { let hp: *i64 = (base + O_MOBHDG) as *i64; return hp[k] }
4065func wc_set_facing_policy(base: i64, radius: i64, gain: i64) -> i64
4072func set_facing_policy(radius: i64, gain: i64) -> i64 { return wc_set_facing_policy(0,radius,gain) }
4073func mob_heading(k: i64) -> i64
4078func wc_mob_sph(base: i64, k: i64) -> i64
4090func wc_gp_pelvis(sph: i64) -> i64 { return wc_amp_ddeg(WC_PELVIS_ROT_DDEG)*it_sin4096(sph % (2*IT_PI))/WATER_MAGIC_4096 }
4091func wc_gp_thorax(sph: i64) -> i64 { return wc_amp_ddeg(WC_THORAX_ROT_DDEG)*it_sin4096(sph % (2*IT_PI))/WATER_MAGIC_4096 }
4092func wc_gp_leg(sph: i64) -> i64 { return it_sin4096(sph % (2*IT_PI))*(IT_PI/6)/WATER_MAGIC_4096 }
4093func wc_gp_arm(sph: i64) -> i64 { return it_sin4096(sph % (2*IT_PI))*(IT_PI/12)/WATER_MAGIC_4096 }
4096func wc_gp_elbow(sph: i64) -> i64 { return wc_ddeg(WC_ELBOW_ROM_DDEG)*(WATER_MAGIC_4096 - it_cos4096(sph % (2*IT_PI)))/(2*WATER_MAGIC_4096) }
4102func wc_mob_resident(base: i64, h: i64) -> i64
4110func mob_resident(k: i64) -> i64
4114func mob_tick(base: i64) -> i64
4679func beach_contact_cell_solid(base: i64, x: i64, y: i64, z: i64) -> i64
4685func beach_contact_union_cell(base: i64, body: *BeachContactBox, obstacle: *BeachContactBox, x: i64, y: i64, z: i64) -> i64
4705func beach_contact_world_sweep(base: i64, body: *BeachContactBox, obstacle: *BeachContactBox, result: *BeachContactResult, axis: i64, delta_q8: i64) -> i64
4751func wc_contact_body(base: i64) -> *BeachContactBox { return (base+O_CONTACT) as *BeachContactBox }
4752func wc_contact_obstacle(base: i64) -> *BeachContactBox { return (base+O_CONTACT+CONTACT_BOX_W