code wiki / _hdl_build / nx_breeder_arena.nx
nx_breeder_arena.nx
buildroot/runtime/_hdl_build/nx_breeder_arena.nx
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
imports: nx_syscalls.nxnx_game_agent.nxnx_game_breed.nx
imported by: nx_breeder_arena_gate.nx
structs
| none |
consts
| 15 | const BA_W: i64 = 24 |
| 16 | const BA_H: i64 = 16 |
| 17 | const BA_MAXW: i64 = 6 // wild population cap |
| 18 | const BA_TICKS: i64 = 400 // run length cap |
| 19 | const BA_PLAYER_HP: i64 = 30 // three bad duels end the run (12+12+12 > 30) |
| 20 | const BA_LOSS_HP: i64 = 12 // cost of losing a duel |
| 21 | const BA_DUEL_CD: i64 = 6 // ticks before the same wild duels again |
| 22 | const BA_DEN_X: i64 = 3 |
| 23 | const BA_DEN_Y: i64 = 3 |
| 24 | const BA_NEED_CAPTURES: i64 = 2 |
| 30 | const BA_O_WILD: i64 = 16 |
| 31 | const BA_WSTRIDE: i64 = 4 |
functions
| 32 | func ba_words() -> i64 { return BA_O_WILD + BA_MAXW*BA_WSTRIDE } |
| 34 | func ba_world_build(wd: *i64) -> i64 |
| 48 | func ba_seed_wilds(wd: *i64, ar: *i64, rosW: *i64, G: *i64, seed: i64) -> i64 |
| 78 | func ba_nearest_wild(ar: *i64, G: *i64) -> i64 |
| 95 | func ba_wild_by_actor(G: *i64, ah: i64) -> i64 called by 1: ba_tick |
| 107 | func ba_duel_wild(wd: *i64, ar: *i64, rosP: *i64, rosW: *i64, G: *i64, w: i64, tbl: *i64, |
| 139 | func ba_fold(G: *i64, wd: *i64, ar: *i64, rosP: *i64) -> i64 |
| 148 | func ba_tick(wd: *i64, ar: *i64, rosP: *i64, rosW: *i64, G: *i64, tbl: *i64, scr: *i64, called by 2: ba_runmain calls 12: ba_nearest_wilden_getag_step_astarba_wild_by_actorba_duel_wilden_valid+6 |
| 228 | func ba_run(seed: i64, policy: i64, G: *i64, bt: *i64, btcap: i64, ev: *i64, evcap: i64) -> i64 |