Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Behaviour trees let user define conditional behaviours for your simulation. With behaviour trees you can define both simple and complex behaviours depending on the occurring of certain conditions.
The Atoms UI has a behaviour tree editor where you create behaviour tree graphs. For a full list of nodes, please check this page.

Behaviour tree differ from state machines as each node is considered as task rather than a state, each task/node will either iterated through child nodes, verify certain conditions, perform actions on the agents or the blackboard, etc.
A Behaviour tree is graphically represented as a directed tree in which the nodes are classified as root, decorators, composite and behaviours.

Behaviour trees work alongside Blackboards which can be nested. Blackboards store data (Blackboard keys) the Behaviour tree needs to know in order to make informed decisions. For instance, depending on the value of a specific key, you might process different branches of the behaviour tree.
A Behaviour Tree will always have a Blackboard.  In Atoms, a parent blackboard can optionally be created on the Behaviour Tree module to send data to the Behaviour Tree to take decisions depending on the scene content.

It's important to know Atoms creates a Behaviour Tree and Blackboard per agent, but from within a Behaviour Tree users can edit other agents belonging to the same simulation.


Nodes

Nodes can return tree values during the tree execution: Running, Success or Failure. 
Depending on the return value of each node and the tree logic, the tree will run in a certain way.

Each node has parameters and the value of these parameters can be linked to a blackboard key of the same type. This is the way in which nodes can pass data to other nodes in the same tree.

You will find the following nodes in a Behaviour Tree:

  • Root Node: The Root node is actually a decorator, but it acts as the start point of the graph.
  • Composite Nodes: Composite nodes work with multiple children and execute them in a specific order based on the composite functionality.
    The children of a composite node are always evaluated from top to bottom (nodes are ordered based on their position Y value in the graph, no matter how their connections are visually displayed inside the graph).
  • Decorator Nodes: Decorator nodes have one child. Decorators provide extra functionality to the child, check conditions, etc.
  • Behaviour Nodes: Behaviour nodes do not have any child and act as end of points on the graph. A behaviour node are used for setting agent metadatas or blackboard keys, although they cover several other functionalities.

Blackboard

Blackboards can contain any number of keys which be of different types.

Users can specify default values for each keys and these values can be edited during the simulation.

Keys can be linked to agent metadatas:

  • None, the key is not attached to an agent metadata and it is a simple blackboard key
  • Link, the key is linked with an agent metadata having the same name of this key
  • Cache, the value of the agent metadata having the same name as this key is cached before the computation of all agents trees. In this way, even if you edit a metadata you will still be able to access its original value during a single frame evaluation.
  • No labels