code wiki / _hdl_build / nx_breeder_arena.nx

nx_breeder_arena.nx

buildroot/runtime/_hdl_build/nx_breeder_arena.nx

11105 B273 linesdepth 5pulls 13 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_breeder_arena.nx -- THE COMPOSED PLAYABLE LOOP (ws=game-interact rung 4): Palworld's shape from our certified parts, nothing else. One tick of the world is: player moves (nx_game_actor: collision + bump) -> each wild THINKS (nx_game_agent: patrol/LOS/ A*-chase/attack/flee) -> contact resolves as a DUEL (nx_game_breed -> nx_creature_battle) -> a crushing win DOMINATES -> she SUBMITS -> brd_capture (exact genes, nx_game_companion roster) -> two companions at the DEN -> brd_breed -> BIRTH (provable inheritance) = the WIN. Lose a duel and the player BLEEDS (BA_LOSS_HP); at zero the run is LOST -- genre-honest, losable. The engine is the sovereign truth the JS last-mile must byte-match (frontier/drift doctrine). All tuning numbers are named DATA consts here, never inline. LIB, no main. license_tier: ORIGINAL

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_game_agent.nx nx_game_breed.nx nx_breeder_arena.nx nx_breeder_arena_gate.nx

imports: nx_syscalls.nxnx_game_agent.nxnx_game_breed.nx

imported by: nx_breeder_arena_gate.nx

structs

none

consts

15const BA_W: i64 = 24
16const BA_H: i64 = 16
17const BA_MAXW: i64 = 6 // wild population cap
18const BA_TICKS: i64 = 400 // run length cap
19const BA_PLAYER_HP: i64 = 30 // three bad duels end the run (12+12+12 > 30)
20const BA_LOSS_HP: i64 = 12 // cost of losing a duel
21const BA_DUEL_CD: i64 = 6 // ticks before the same wild duels again
22const BA_DEN_X: i64 = 3
23const BA_DEN_Y: i64 = 3
24const BA_NEED_CAPTURES: i64 = 2
30const BA_O_WILD: i64 = 16
31const BA_WSTRIDE: i64 = 4

functions

32func ba_words() -> i64 { return BA_O_WILD + BA_MAXW*BA_WSTRIDE }
called by 3: ba_runnewGmain
34func ba_world_build(wd: *i64) -> i64
called by 2: ba_runmain calls 2: wd_initwd_set_wall
48func ba_seed_wilds(wd: *i64, ar: *i64, rosW: *i64, G: *i64, seed: i64) -> i64
78func ba_nearest_wild(ar: *i64, G: *i64) -> i64
called by 1: ba_tick calls 2: en_validac_dist2
95func ba_wild_by_actor(G: *i64, ah: i64) -> i64
called by 1: ba_tick
107func ba_duel_wild(wd: *i64, ar: *i64, rosP: *i64, rosW: *i64, G: *i64, w: i64, tbl: *i64,
139func ba_fold(G: *i64, wd: *i64, ar: *i64, rosP: *i64) -> i64
called by 1: ba_tick calls 2: ac_cken_count
148func ba_tick(wd: *i64, ar: *i64, rosP: *i64, rosW: *i64, G: *i64, tbl: *i64, scr: *i64,
228func ba_run(seed: i64, policy: i64, G: *i64, bt: *i64, btcap: i64, ev: *i64, evcap: i64) -> i64