NPCEntity small brain: perception + order execution #4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The plan
The NPCEntity small brain is execution only: it takes an order and figures out HOW to carry it out — navmesh pathing, line-of-sight checks, stuck handling, basic logic. It never decides what to do. This issue builds the HOW. It depends on the order-vocabulary issue: the brain executes the settled vocabulary, and no order type gets built here that the vocabulary does not contain.
Current state
addons/daisy/src/npc_entity.gdhas the seams but not the implementation:receive_orderstores an order and setsSTATE_EXECUTING;complete_orderandreport_stuckflip the state;perceive_sight/perceive_hearingbuild a knowledge entry and hand it upward;diemarks the NPC dead and clears its order. There is no movement, no navmesh, no real sensing, and no arrival condition — an order never completes on its own.What changes
Build the execution layer, in order:
idle,executing,done,stuck). Define the transitions: what movesexecutingtodone— arrival within a threshold? interaction complete? target lost? What moves it tostuck, and what does the brain do then — retry once, repath, or report immediately? The Commander re-plans onstuck; the brain must not spin forever.move_toorder produces a navmesh path and the NPC follows it. Needs a test scene with a navmesh — the simulation-scenarios issue provides the scenes; this issue defines what the brain needs from them. Repath when the path is blocked; report stuck when no path exists.move_toacross a navmesh scene and completes; a blocked NPC reports stuck; a target outside sight rules produces no entry; a body is "found" only under the settled conditions.What done looks like
An NPC walks a
move_toto completion, reports stuck when it cannot, perceives only what its sensing rules allow, and finds bodies only under the settled conditions — each proven by a test. The order-execution states transition per the settled machine, and the design doc's small-brain section matches the implementation.Open questions
interactexecute as — walk to, then a channel? What interrupts it?