Skip to main content

Module tree

Module tree 

Source
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§

BehaviorTree
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.
DecoratorState
Mutable state owned by a Decorator node.
SubtreeRegistry
A named registry that maps string keys to reusable subtree factories.
TreeBuilder
Fluent builder for assembling BehaviorNode trees.

Enums§

BehaviorNode
The complete behavior tree node type.
BlackboardValue
All value types storable on a Blackboard.
DecoratorKind
The flavour of behavior a decorator applies to its single child.
NodeStatus
The three-valued result every behavior-tree node returns each tick.
ParallelPolicy
Controls how a BehaviorNode::Parallel node 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.