Add behavior to your agents

To add behavior to your agents you first have to create a Crowd Sim Node Tree. In the CrowdSim Node Editor press New

Note

CrowdSim3D uses behavior trees for adding logic to the agents. See https://en.wikipedia.org/wiki/Behavior_tree_(artificial_intelligence,_robotics_and_control) for more information and https://www.youtube.com/watch?v=YCMvUCxzWz8 for an overview of behavior trees.

Overview

The Crowd Sim Node Editor contains various nodes to build up your behavior tree. Together they control the behavior of the simulation. Behavior is the start node.

../../_images/node-behavior.png

At the output socket of the behavior node other nodes can be added. During execution per frame the node tree will be executed. Each node can be in one of the next states:

  • Not executed: This can happen when a Composite Nodes node won’t select all sub trees to execute.

    ../../_images/node-conditional.png
  • Success: The node execution has been completed successfully. Each node has its own definition if it is successfully executed. For example the Target Navigation node will be successfully executed when it is within reach of its target. Otherwise it will be in its running state.

    ../../_images/node-target-navigate.png
  • Failure: The node execution has been completed, but failed. This could happen when a test fails. For example the Check Agent Model will be in fail state for agents that aren’t of the selected model/character.

    ../../_images/node-check-agent-model.png
  • Running: The node execution takes multiple frames and have not been completed. An example is the Move node that will be running for the number of frames that are set in the node. Only the last frame will result in its success state.

    ../../_images/node-move.png

Note

When using the debugger it is possible to look at the state of each node for each frame in the animation for each agent. See Debugger for more information how to use it.

Nodes

Quickstart Templates