Total Miner Forums
Total Miner => Total Miner Discussion => Guides => Topic started by: Craig on January 03, 2016, 09:44:59 AM
-
This topic will document each behaviour node.
General Behaviour Tree Help (http://totalminerforums.net/index.php?topic=15740.msg165953#msg165953)
Logic:
Dialog (http://totalminerforums.net/index.php?topic=15740.msg165954#msg165954): NPC Dialog.
Exit (http://totalminerforums.net/index.php?topic=15740.msg165955#msg165955): Returns control to the most recent Update node.
Proxy (http://totalminerforums.net/index.php?topic=15740.msg165956#msg165956): Insert a sub behaviour tree.
Update (http://totalminerforums.net/index.php?topic=15740.msg165957#msg165957): Causes continual updating (execution) of the tree.
Actions:
Attack (http://totalminerforums.net/index.php?topic=15740.msg165958#msg165958): Attack the NPC's current target.
ChangeState (http://totalminerforums.net/index.php?topic=15740.msg165959#msg165959): Change the NPC's main state.
Deactivate (http://totalminerforums.net/index.php?topic=15740.msg165960#msg165960): Deactivate the NPC.
Equip (http://totalminerforums.net/index.php?topic=15740.msg165961#msg165961): Equip hands with items from inventory.
Flee (http://totalminerforums.net/index.php?topic=15740.msg165962#msg165962): Flee the NPC's current target.
Follow (http://totalminerforums.net/index.php?topic=15740.msg165963#msg165963): Follow the NPC's current target.
Health (http://totalminerforums.net/index.php?topic=15740.msg165964#msg165964): Increase or reduce current Health.
Jump (http://totalminerforums.net/index.php?topic=15740.msg165965#msg165965): Cause the NPC to jump.
LookAt (http://totalminerforums.net/index.php?topic=15740.msg165966#msg165966): Control what the NPC should look at.
Message (http://totalminerforums.net/index.php?topic=15740.msg165967#msg165967): Send information to other NPC's.
Move (http://totalminerforums.net/index.php?topic=15740.msg165968#msg165968): Move the NPC.
Properties (http://totalminerforums.net/index.php?topic=15740.msg165969#msg165969): Set various properties for the NPC.
Script (http://totalminerforums.net/index.php?topic=15740.msg165970#msg165970): Execute a script.
StandStill (http://totalminerforums.net/index.php?topic=15740.msg165971#msg165971): Cause the NPC to stop moving.
SwingHand (http://totalminerforums.net/index.php?topic=15740.msg165972#msg165972): Cause the NPC to swing a hand.
Timer (http://totalminerforums.net/index.php?topic=15740.msg165973#msg165973): Perform actions based on a timer.
Wait (http://totalminerforums.net/index.php?topic=15740.msg165974#msg165974): Wait for an amount of time before continuing.
Wander (http://totalminerforums.net/index.php?topic=15740.msg165975#msg165975): Wander around a defined area.
Conditionals:
FindTarget (http://totalminerforums.net/index.php?topic=15740.msg165976#msg165976): Find a specific target.
HasHistory (http://totalminerforums.net/index.php?topic=15740.msg165977#msg165977): Query (player) history.
IsAge (http://totalminerforums.net/index.php?topic=15740.msg165978#msg165978): Query age.
IsBlock (http://totalminerforums.net/index.php?topic=15740.msg165979#msg165979): Query what block is at a location.
IsDistance (http://totalminerforums.net/index.php?topic=15740.msg165980#msg165980): Query distance.
IsEquipped (http://totalminerforums.net/index.php?topic=15740.msg165981#msg165981): Query if specific items are currently equipped.
IsHealth (http://totalminerforums.net/index.php?topic=15740.msg165982#msg165982): Query health.
IsInZone (http://totalminerforums.net/index.php?topic=15740.msg165983#msg165983): Query if inside a zone.
IsRandom (http://totalminerforums.net/index.php?topic=15740.msg165984#msg165984): Perform actions based on randomness.
IsTargeted (http://totalminerforums.net/index.php?topic=15740.msg165985#msg165985): Query if the NPC is currently targeted.
IsVisible (http://totalminerforums.net/index.php?topic=15740.msg165986#msg165986): Query what other NPC's or players are visible.
-
General Behaviour / Dialog Tree Help
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.
(http://i64.tinypic.com/24vk8lf.png)
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 first
If 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 terminates
If 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
tbc..
-
Dialog: NPC Dialog.
Used to create of conditional multi-branched dialog with NPCs.
Properties:
Text: The dialog text. This is some dialog the NPC will say to you or you will say to the NPC.
-
Exit: Returns control to the most recent Update node.
-
Proxy: Insert a sub behaviour tree.
-
Update: Causes continual updating (execution) of the tree.
-
Attack: Attack the current target.
By default, the NPC will move within strike range before striking.
Properties:
Exclude Types: Actor types the NPC should not attack.
-
ChangeState: Change the NPC's main state.
Properties:
NewState: The state to change the NPC into.
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.
-
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.
-
FindTarget: Find a specific target.
-
HasHistory: Query history.
-
IsAge: Query age.
-
IsBlock: Query what block is at a location.
-
IsDistance: Query distance.
-
IsEquipped: Query if specific items are currently equipped.
-
IsHealth: Query health.
-
IsInZone: Query if inside a zone.
-
IsRandom: Perform actions based on randomness.
-
IsTargeted: Query if the NPC is currently targeted.
-
IsVisible: Query what other NPC's or players are visible