Logic:Dialog: NPC Dialog.Exit: Returns control to the most recent Update node.Proxy: Insert a sub behaviour tree.Update: Causes continual updating (execution) of the tree.

Actions:Attack: Attack the NPC's current target.ChangeState: Change the NPC's main state.Deactivate: Deactivate the NPC.Equip: Equip hands with items from inventory.Flee: Flee the NPC's current target.Follow: Follow the NPC's current target.Health: Increase or reduce current Health.Jump: Cause the NPC to jump.LookAt: Control what the NPC should look at.Message: Send information to other NPC's.Move: Move the NPC.Properties: Set various properties for the NPC.Script: Execute a script.StandStill: Cause the NPC to stop moving.SwingHand: Cause the NPC to swing a hand.Timer: Perform actions based on a timer.Wait: Wait for an amount of time before continuing.Wander: Wander around a defined area.

Behaviour Trees are used to control NPC behavior. Dialog Trees are used to control how NPC's interact/talk with players. Dialog Trees are actually just Behaviour Trees but tailored for dialog.

Behaviour/Dialog Trees are made up of Nodes. Each Node controls the NPCs behaviour in a specific way. Each node has a set of properties which exactly define that behaviour.

Each Node can have both siblings and children. On the Behaviour Tree Design screen, a Nodes children are positioned to the right of the (parent) Node, and the Nodes siblings are positioned below the Node.

The first (red) node is the Tree Root node. Every Tree has a Root node. It does not do anything except serve as the ultimate parent of all the nodes in the tree. The Root node has child nodes that form the tree, but cannot have sibling nodes. The Root node is the only node that cannot have siblings. The name of the Root node is the name of the Tree.

In the image above, the Root Node has three child nodes, IsVisible, IsTargeted and Wander. These three nodes are siblings (children of the same parent). Child nodes are always shown to the right of the parent. Sibling nodes are always shown below (or above) each other.

The Equip node shown to the right of IsVisible is the first child node of IsVisible. IsVisible has two children. Equip and Standstill. The Equip node has one child node Follow. Standstill has no children. Follow has no children and no siblings.

IsTargeted is a sibling of IsVisible and Wander. It has one child node Script, which also has one child node Message, and no siblings. Message has no children and no siblings.

Wander has no children.

Order of execution:

A Node is an execution point. The Node is executed and at the end of execution the Node has either a Success or Failure state.

When execution of a Behaviour or Dialog Tree begins, the first node to be executed is the first child node of the Root node. In the image above, that is the IsVisible node.

When the node execution completes, if the state is Success, the next Node to execute is the nodes first child node (node displayed on immediate right). If the Node has no children, execution of the Tree terminates. In the case of the IsVisible node above, the next node to execute would be the Equip node.

If the state is Failure, the next Node to execute is the nodes next sibling (node displayed immediately below). If the node has no siblings or is the last sibling, execution winds back to it's parent's next sibling. If the parent is the last sibling, execution winds back to it's parent's next sibling. If there are no more siblings of parents, execution of the Tree terminates. In the case of the IsVisible node above, the next node to execute would be the IsTargeted node.

So the full execution path of the Tree in the image above would be:

IsVisible is executed firstIf IsVisible succeeds Equip is executed next If Equip succeeds Follow is executed next Tree execution terminates If Equip fails Standstill is executed next Tree execution terminatesIf IsVisible fails IsTargeted is executed next If IsTargeted succeeds Script is executed next If Script succeeds Message is executed next Tree execution terminates if Script fails go to If IsTargeted fails If IsTargeted fails Wander is executed next Tree execution terminates

Alive: The NPC is alive and well.Dying: The NPC has died. The death throes animation will be played.Respawning: The NPC is spawning for the first time, or respawning from death.Despawning: The NPC is despawning. The despawn animation will be played.Sleeping: The NPC is sleeping.InActive: The NPC is no longer active and will be removed from the game world immediately.