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.
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.
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.
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.
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.
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¶
- Start-Debug Nodes
- Filter Nodes
- Composite Nodes
- Decorators
- States
- State properties
- State Operation
- Check State
- Model Variable Operation
- Check Model Variable
- Check Frame Number
- Check On Nav Mesh
- Check Agent Model
- Check Action Tag
- Check Mesh Variation
- Check Agent Factory
- Check Collision Impact
- Check Grid Position
- Set Speed Vector
- Acceleration
- Is Countdown Elapsed
- Randomize Countdown
- Targets
- Navigate
- Avoid
- Movement
- Animation
- Collisions
- Group Nodes