Expand description
Everything related to AI behavior and behavior trees.
Behavior trees are simple but very powerful mechanism to implement artificial intelligence for
games. The main concept is in its name. Tree is a set of connected nodes, where each node could
have single parent and zero or more children nodes. Execution path of the tree is defined by the
actions of the nodes. Behavior tree has a set of hard coded nodes as well as leaf nodes with
user-defined logic. Hard coded nodes are: Sequence, Selector, Leaf. Leaf is special - it has
custom method tick that can contain any logic you want.
For more info see:
Modules§
- composite
- Composite node is a container for children nodes. Composite node could be either
SequenceorSelector.Sequencenode will execute children nodes consecutively untilStatus::Failureis returned from any descendant node. In other wordsSequenceimplement AND logical function.Selectornode will execute children untilStatus::Successis returned from any descendant node. In other worldsSelectorimplement OR logical function. - inverter
- A node, that inverts its child state (
super::Status::Failurebecomessuper::Status::Successand vice versa,super::Status::Runningremains unchanged) - leaf
- Leaf is a “final” node of a behavior tree. It contains user-defined action which is able to mutate given context.
Structs§
- Behavior
Tree - See module docs.
- Root
Node - Root node of the tree.
Enums§
- Behavior
Node - Possible variations of behavior nodes.
- Status
- Status of execution of behavior tree node.
Traits§
- Behavior
- A trait for user-defined actions for behavior tree.