Nodes
what they are, how they work, and what to prepare with
The behavior tree consists entirely of nodes ("nods"), each of which can do something - press buttons, check conditions, and so on.
Success/Failure
All nodes return a status based on the execution results, which can be:
- Success - the button was pressed, the image was found, etc.
- Failure - the opposite happened - something couldn't be done (action not selected or condition not met).
- Running - the node has started working but has not finished yet. This occurs when the action the node performs takes some time, more than one tick. Typically, this means that the entire tree will wait until the node finishes its work, returning Success or Failure. A classic example is the Wait node, which simply delays the entire tree until the specified time has passed.
Types of Nodes
- Root - the root of the entire tree, containing general settings.
- Sequence - iterates through child nodes until it finds one that returns
Failure. - Selector - iterates through child nodes until it finds one that returns
Success. - Aura Is Active - allows specifying one or more auras that will serve as conditions for the node.
- Execute Aura - specifies an aura whose actions will be executed when the node is launched.
- Key Press - presses a key or key combination.
- Wait - pauses the execution of the tree for a specified time.
- Cooldown - prevents too frequent execution of a particular node.
- Inverter - inverts the state of the child node (
Success=>Failureand vice versa). - Force Failure - executes the child node but always returns
Failure. - Force Success - executes the child node but always returns
Success. - Until Success - executes the child node until it returns
Success. - Fixed Status - an auxiliary node that allows setting a fixed status that the node will return, helpful for debugging/configuration.
- Comment - allows writing comments on the logic directly in the tree.