code wiki / _hdl_build / nx_char_ai.nx

nx_char_ai.nx

buildroot/runtime/_hdl_build/nx_char_ai.nx

2111 B55 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic char
docsdependenciesstructsconstsfunctions

about

nx_char_ai.nx -- G-R2: sovereign CHARACTER-AI primitives (P5 generative pillar). Two classic, data- driven game-AI engines, pure integer logic: BEHAVIOR TREE: nodes = SEQ / SEL / COND / ACT over a blackboard bitmask; bt_tick returns OK/FAIL and writes the chosen action. SEQ = all-children-must-succeed; SEL = first-success-wins (priority). FSM: a transition table; fsm_step(state,event) -> next state (stays if no transition). These drive NPC decisions deterministically -> reproducible, testable AI. 100% sovereign. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_char_ai.nx nx_char_ai_gate.nx nx_minigame_capstone_gate.nx

imports: nx_syscalls.nx

imported by: nx_char_ai_gate.nxnx_minigame_capstone_gate.nx

structs

none

consts

9const BT_FAIL: i64 = 0
10const BT_OK: i64 = 1
11const NT_SEQ: i64 = 0
12const NT_SEL: i64 = 1
13const NT_COND: i64 = 2
14const NT_ACT: i64 = 3
15const BT_K: i64 = 4 // max children per composite node

functions

19func bt_tick(ty: *i64, a0: *i64, nk: *i64, kids: *i64, node: i64, bb: i64, action_out: *i64) -> i64
51func fsm_step(trans: *i64, nev: i64, state: i64, event: i64) -> i64
called by 1: main