Expand description
The shared behavior graph model: one serde-friendly data representation
every BehaviorInterpreter reads.
A behavior — a behavior tree, a node graph — is authored as a Graph: a
set of Nodes, each bound to a function (a statically-known id the
interpreter handles natively, or a module call routed by that same id —
exactly how arora-behavior-tree already treats its builtins and module
actions homogeneously), with typed slots (Io — inputs and outputs, told apart by
which Node list holds them) and links
(Link) wiring an output/port of one node into the input of another.
This module is only the data model. It does not tick anything and it does
not know how any particular interpreter walks the links — the behavior tree
reads them as argument/child edges; a node graph reads them as dataflow. Each
interpreter lowers this shared model into its own runtime form (see
arora-behavior-tree’s graph module for the tree lowering).
Edition happens through GraphDiff: a set of node/link additions and
removals (plus predetermined-key overrides). “Loading” a behavior is just
Graph::applying a diff onto an Graph::empty graph — which is why
BehaviorInterpreter::apply is the one
edition entry point.
Structs§
- Graph
- The shared behavior graph: nodes, the links between their slots, the named blackboard variables, and (for tree-shaped interpreters) the root node.
- Graph
Diff - An edit to a
Graph: what to add and remove. - Graph
Error - A graph edition failed to apply.
- Io
- A typed slot on a
Node— one entry ofNode::inputsorNode::outputs. Which of the two lists holds it is what makes it an input or an output; the slot itself carries no direction, so the two can never disagree. - Link
- A directed wire feeding one node input from a
LinkSource. - Node
- A node bound to a function, with its typed inputs/outputs and (optionally) ordered children.
- Port
- A reference to one slot on one node:
(node, port). Generalizes the behavior tree’sNodeParameterId.
Enums§
- Link
Source - Where the value feeding a
Link’s target comes from.