Houdini 17.0 Crowd simulations

Crowd agent states

About agent states, the virtual "mood" of each agent which controls the agent’s animation and which behaviors it runs.

On this page

Overview

At any given time, every agent is in a certain state, for example "walk", "idle", "attack", or "run_to_goal". The state encapsulates behavior nodes. These nodes affect the agent primitive, such as moving it around or changing its attributes. How the forces inside the state are actually applied to agents in that state depends on weights.

Houdini animates agents in a given state using an animation clip with the same name as the state.

After each state, you can add particle DOP nodes to move agents in the state.

Houdini includes many "steering force" nodes that implement useful crowd behaviors such as "move toward a point" and "follow a path". These are very similar to DOP particle nodes, and in fact you can use particle forces to affect agents as well, although plain particle forces do not have the concept of weights.

Add a new state

  1. In the simulation network, create a new Crowd State node and wire it into the merge_states node.

  2. With the state node selected, in the parameter editor, set the State name parameter. This must correspond to the name of an animation clip. For example, agents will run the walk animation clip while in the walk state.

Adding behavior to a state

Create a node to influence the agent behavior (see below) and wire it into the simulation network:

  • Put it between a state node and the merge to have it apply only in that state.

  • Put it after the merge (between the merge and the solver) to have it apply to all agents in all states.

Note that no matter which way you wire it, you can use the Group parameter on a behavior node to limit it to a certain group or groups of agents.

You can have multiple behaviors in a state, multiple behaviors after the merge, and there are also behaviors built into the crowd solver that apply to all agents. The solver combines all the applicable forces using weights.

Movement behaviors

Houdini includes several useful POP forces created to work with crowds. Nodes of this types have names starting with "POP Steer".

These "steering" forces are essentially particle forces with the added concept of a weights. You can use them with regular particles by setting their Output parameter to "POP force".

You can also use regular particle simulation forces (for example, the POP Wind node) as behavior nodes. However, because those forces don’t have Weight parameters, the solver will add them directly instead of normalizing them with other forces.

Using the Path shelf tool

  1. Select the path curve.

  2. On the Crowds shelf tab, click the Path tool.

This tool creates the POP Steer Path node to make all agents follow the path. If you want only agents in a certain state to follow the path, you need to rewire the POP Steer Path node. See the simulation network overview and states and behaviors.

For more information on path following, see the help for the POP Steer Path node.

Using the Look At shelf tool

This tool simply wires an Agent Look At DOP into the current crowd network to make agents look at an object (either in one state or all states).

  1. Select the object you want agents to look at.

  2. On the Crowds shelf tab, click the Look At tool.

  3. In the dialog box, enter the name of a state, or enter nothing to have the agents look at the object in all states.

Default agent behaviors on the solver

The Crowd Solver node has certain optional default behaviors, such as collision avoidance, that may apply to all agents regardless of state.

  • The solver constrains agents from turning or moving too fast while reacting to forces, to keep movement looking realistic.

  • The solver has optional default behaviors to keep agents from running into each other, and to avoid obstacles.

  • The solver has options to make agents "stick" to a terrain object, and to adapt foot bone placement to terrain.

Changing attributes inside a state

The "steering" behaviors are focussed on applying force to the agent particles to move them around. You can also change attributes on the agent using a POP Wrangle DOP as a behavior node.

For example, if you want to change an agent’s maximum turn rate when it’s in a certain state, use an Attribute Wrangle DOP inside the state 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 with "Agent" in the title are useful for working with agents.

Crowd simulations

Getting started

  • Basics

    An overview of Houdini crowd simulation concepts.

  • Setup

    How to set up and edit a crowd simulation.

The moving parts

  • Agents

    About agents, the moving "actors" that make up a crowd simulation.

  • States

    About agent states, the virtual "mood" of each agent which controls the agent’s animation and which behaviors it runs.

  • Triggers

    How to specify conditions that cause agents to change from one state to another.

  • Caches

    Tips for efficiently caching and loading crowd sims.

Behavior

Appearance

  • Diversity

    How to create a more realistic crowd by making agents look and act differently.

  • Attaching cloth

    You can add and constrain vellum cloth as part of agent shape geometry, and then simulate the cloth based on agent movements.

Terrain

  • Foot planting

    How to set up agents to adapt their animation to terrain and prevent skating.

  • Terrain

    How to specify terrain geometry for agents to walk across.

  • Obstacles

    How to set up obstacles for agents to avoid.