Composite Nodes may contain as many children as required. They are mainly used to run a sequence of behaviors. Different composite nodes fire their children in different ways.
Return to the Behavior tree page.
| Node Name
|
Node Type
|
Description
|
| sequence |
 |
Runs its children from top to bottom in sequence until one of them fails. Returns success if and only if every one of its children also return success. If a child yields, the node as a whole yields, and will resume at the yielded child.
|
| selector |
 |
Runs its children from top to bottom in sequence until one of them succeeds. Returns failure if and only if every one of its children also return failure. If a child yields, the node as a whole yields, and will resume at the yielded child.
|
| randomize |
 |
Picks a random child node and runs it. Returns the result of the chosen node. If the chosen child yields, the node as a whole yields, and will resume with the yielded child.
|
| dynamic |
 |
Runs its children from top to bottom in sequence, ignoring failures and yielding at the first child that yields. Any children below the yielded child are not run during this update interval. On each update interval, it re-runs the children from top to the yielded child in sequence. If none of those children yield or succeed, it then resumes the yielded child. If that child does not yield again or succeed, it then runs any remaining children in sequence. If any child succeeds, the node as a whole succeeds, and any children after that are terminated. The node fails if and only if all children fail in a single update interval.
|
| parallel |
 |
Accepts 2 optional parameters: "fail" and "success". By default, each is set to -1, which is treated as equivalent to the count of the node's children. The node will run every child from top to bottom in sequence during every update interval. If a child had yielded, it will be resumed. The node keeps count of how many of its children have returned success or failure in each update interval. When the number of successes in a single update interval reaches the "success" argument, the node as a whole stops and returns success. Likewise, when the number of failures in a single update interval reaches the "fail" argument, the node as a whole stops and returns failure. If neither condition is met, the node yields. When the node returns success or failure, any remaining children are terminated.
|
Quick Navigation