On this page |
Overview ¶
At any given time, every agent is in a particular state, such as “walk”, “idle”, “attack”, or “run_to_goal”. A state is defined by:
-
The animation clip that is played for the agents in that state.
-
Behavior nodes that affect the movement of the underlying particles that the agents are attached to.
-
Nodes that affect the agent’s pose and animation, such as the
Agent Look At DOP (adjusts the agent’s pose) and the
Agent Clip Layer DOP (blends another animation clip with the base animation).
For example, in a “run” state, an animation clip of an agent running is played. Without a behavior node, the agents would run in place. If a behavior node like the POP Steer Separate DOP is used, the agents would run away from each other.
In a crowd simulation network, an agent’s animation is defined in a Crowd State DOP, and the nodes modifying the agent’s behavior and pose are wired in after the Crowd State DOP. The crowd solver updates the agent’s position/orientation (driven by steering forces) and pose (driven by animation clips) at the end of the substep, so the ordering of the behavior and animation nodes usually don’t matter since their effects are not immediately applied to the agent.
In the example below, the behavior nodes are blue and the pose-modifying node is yellow:

Adding states ¶
The name of a state, along with its associated animation clip, is defined by the Crowd State DOP.
-
In a crowd simulation network, merge multiple Crowd State DOPs using a
Merge DOP, then wire the Merge DOP into the
crowd solver:
Crowd State DOP nodes in the crowd simulation network -
By default, the Crowd State DOP’s Clip Name parameter is set to
$OS
, which sets the animation clip that the state plays to the name of the Crowd State DOP. For example, if you rename the Crowd State DOP towalk
, then agents in the “walk” state play the animation clip namedwalk
. If you want to have a state name that differs from the name of the animation clip, directly set the animation clip name in the Clip Name parameter.
Note
Along with the animation clip settings, other ragdoll-related settings are also defined in the Crowd State DOP.
Adding behaviors to a state ¶
Behavior nodes influence the movement of the underlying particles that the agents are attached to. Wire behavior nodes into the crowd simulation network after the Crowd State DOP as follows:
-
To apply the behavior only to the agents in a particular state, put the behavior node between the Crowd State DOP and Merge DOP.
-
To apply the behavior to the agents in all states, put the behavior node after the Merge DOP and before the crowd solver.
In the network below, the behavior nodes are in blue. The POP Steer Wander behavior only applies to agents in the walk state, and the POP Steer Separate behavior applies to agents in all states:

Note
Regardless of whether the behavior node is wired before or after the Merge DOP, you can use the Group parameter on a behavior node to limit the behavior to a certain group of agents.
You can have multiple behaviors apply to a state and multiple behaviors after merging the states. There are also behaviors built into the crowd solver that apply to all agents. The crowd solver combines the effects of all the behaviors using weights.
Movement behaviors ¶
Houdini has several POP forces that you could use as behavior nodes to control the movement of the underlying particles that the agents are attached to. Nodes of this type have names starting with “POP Steer”. These “steering” forces are essentially particle forces with the added concept of weights, which determine how the crowd solver deals with multiple forces on the agents.
-
POP Steer Align makes an agent turn to align with nearby agents or other agents in its field of view.
-
POP Steer Avoid makes an agent avoid nearby agents.
-
POP Steer Cohesion makes agents move toward each other.
-
POP Steer Obstacle makes agents avoid static objects.
-
POP Steer Path makes agents follow a path curve.
-
POP Steer Seek makes agents move toward a point.
-
POP Steer Separate makes agents move away from each other.
-
POP Steer Wander makes agents move around randomly.
-
POP Steer Custom allows users to use a VOP network to calculate a force vector.
You can use the above steering forces with regular particles by setting the steering force’s Output Attribute parameter to POP force. You can also use regular particle simulation forces (for example, the POP Wind DOP) as behavior nodes. The regular particle simulation forces don’t have Weight parameters, however, so the crowd solver will simply add these forces to the other forces on the agent instead of first normalizing them.
Default agent behaviors on the crowd solver ¶
The Crowd Solver DOP has some optional default behaviors that may apply to all agents regardless of the state they are in, including:
-
Keeping agents from turning or moving too quickly when reacting to forces. This helps the agent movement look more realistic.
-
Optional default behaviors for avoiding obstacles and keeping agents from running into each other.
-
Options for making agents “stick” to a terrain object and adapt foot bone placement to the terrain.
Modifying agent animation and poses ¶
The following nodes can be used to adjust the agent’s pose and animation:
-
The
Agent Clip Layer DOP layers additional animation clips onto an agent.
-
The
Agent Arcing Clip Layer DOP blends between a set of animation clips based on the agent’s turn rate.
-
The
Agent Look At DOP defines a target that an agent can turn its head to look at.
These nodes are wired into the crowd simulation network after the Crowd State DOP, and can be placed before or after the behavior nodes:

See layering animation clips for more information on the agent clip layer nodes.
Using shelf tools ¶
Path shelf tool ¶
The Path shelf tool creates a POP Steer Path DOP node to make agents in the selected state follow a path curve.
-
Select the path curve.
-
On the Crowds shelf tab, click the
Path tool.
-
From the dialog box, select the state (or all states) in which you want the agents to follow the path.
-
If you select a particular state, the POP Steer Path node will be wired between the state node and the
merge_states
node. -
If you select all states, the POP Steer Path node will be wired after the
merge_states
node.
-
Look At shelf tool ¶
The Look At shelf tool wires an Agent Look At DOP into the crowd network to make the agents look at an object.
-
Select the object you want agents to look at.
-
On the Crowds shelf tab, click the
Look At tool.
-
From the dialog box, select the state (or all states) in which you want the agents to look at the object.
-
If you select a particular state, the Agent Look At node will be wired between the state node and the
merge_states
node. -
If you select all states, the Agent Look At node will be wired after the
merge_states
node.
-
Customizing behaviors ¶
Changing the attributes inside a state ¶
The “steering” behavior nodes apply forces to move the underlying particles that the agents are attached to. You can also use a POP Wrangle DOP as a behavior node to change the attributes on an agent.
For example, if you want to change an agent’s maximum turn rate when it is in a certain state, use a POP Wrangle DOP after the state node with a script such as:
f@maxturnrate = 15;
Custom steer force VOP network ¶
You can use the POP Steer Custom DOP to define a new steering behavior. It contains a VOP network you can use to add to or change the current force on the agent particle.
VOPs names that include “Agent” are useful for working with agents.