code wiki / _hdl_build / nx_char_ai.nx
nx_char_ai.nx
buildroot/runtime/_hdl_build/nx_char_ai.nx
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
imports: nx_syscalls.nx
imported by: nx_char_ai_gate.nxnx_minigame_capstone_gate.nx
structs
| none |
consts
| 9 | const BT_FAIL: i64 = 0 |
| 10 | const BT_OK: i64 = 1 |
| 11 | const NT_SEQ: i64 = 0 |
| 12 | const NT_SEL: i64 = 1 |
| 13 | const NT_COND: i64 = 2 |
| 14 | const NT_ACT: i64 = 3 |
| 15 | const BT_K: i64 = 4 // max children per composite node |
functions
| 19 | func bt_tick(ty: *i64, a0: *i64, nk: *i64, kids: *i64, node: i64, bb: i64, action_out: *i64) -> i64 |
| 51 | func fsm_step(trans: *i64, nev: i64, state: i64, event: i64) -> i64 called by 1: main |