Expand description
Behavior Tree core — nodes, blackboard, tick engine, and tree builder.
§Design
Every node returns NodeStatus on each tick() call. The tree walks
from the root, short-circuiting Sequences on Failure and Selectors on
Success. Parallel nodes run all children each tick and aggregate results
according to their policy. Decorators wrap a single child and modify its
return value or control how often it runs.
The Blackboard is a typed key-value store shared by all nodes in a
tree. It is passed by mutable reference into every tick call so nodes can
read sensor data, write intermediate results, and communicate.
The TreeBuilder provides a fluent API for assembling trees without
manually constructing the BehaviorNode enum. Subtrees can be stored
and reused by name via SubtreeRegistry.
Structs§
- Behavior
Tree - The top-level behavior tree that owns a root node, a blackboard, and an optional subtree registry.
- Blackboard
- A typed key-value store shared by all nodes in a behavior tree.
- Decorator
State - Mutable state owned by a
Decoratornode. - Subtree
Registry - A named registry that maps string keys to reusable subtree factories.
- Tree
Builder - Fluent builder for assembling
BehaviorNodetrees.
Enums§
- Behavior
Node - The complete behavior tree node type.
- Blackboard
Value - All value types storable on a
Blackboard. - Decorator
Kind - The flavour of behavior a decorator applies to its single child.
- Node
Status - The three-valued result every behavior-tree node returns each tick.
- Parallel
Policy - Controls how a
BehaviorNode::Parallelnode determines its own status.
Functions§
- cooldown
- Wrap a node in a Cooldown decorator.
- invert
- Wrap a node in an Invert decorator.
- leaf
- Create a simple leaf node from a closure.
- parallel
- Create a Parallel node from a list of children.
- repeat
- Wrap a node in a Repeat(n) decorator.
- selector
- Create a Selector node from a list of children.
- sequence
- Create a Sequence node from a list of children.
- timeout
- Wrap a node in a Timeout decorator.