Using Composite nodes – Selectors, Sequences, and Simple Parallel
Composite nodes form tree nodes inside the Behavior Tree, and contain more than one thing to execute within them. There are three types of Composite nodes:
Selectors: Go through children from left to right looking for a successful node. If a node fails, it tries the next one. When successful, the node is completed and we can go back up the tree.
Sequence: Execute from left to right, until a node fails. If the node is successful, do the next one. If the node fails, go back up the tree.
Simple Parallel: Single task (purple) in parallel with some subtree (gray).
Getting ready
Using composite nodes is fairly straightforward. You only need a Behavior Tree to get started with them.
How to do it…
Right-click anywhere on the blank space in your Behavior Tree diagram.
Select Composites | Selector or Composites | Sequence.
Selectors: Will execute all tasks in series until one succeeds
Sequence: Will execute all tasks in series until one fails
Append to the node a chain of Tasks or other Composite nodes, as desired.