Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.
Image RemovedImage Added

UI Interaction

Please find below a list of mouse actions which can be performed in the node viewport.

  • Left mouse click on node: Select node (works with Shift and Ctrl modifiers)
  • Left mouse click on node+ drag: Select node and move
  • Left mouse click on viewport + drag: Select node with marquee  (works with Shift and Ctrl modifiers)
  • Right mouse click on viewport: show node list
  • Click on node port + drag + drop on another node port: create connection
  • Click on node port + drag + drop on viewport: show node list, if a valid node is selected from the list a new node is created and connected
  • Ctrl click on connected port + drag: Disconnect port (connections can be connected to another port)
  • Right click on connection: show menu for changing connection interpolation


Please find below a list of keyboard shortcuts:

  • f : frame graph
  • Shift + f:  frame selection
  • Backspace or Del : delete selected nodes
  • Ctrl + C: copy selected nodes
  • Ctrl + V: paste
  • Ctrl + Z: undo
  • Ctrl + Y: redo