On this page |
Overview ¶
Crowds are essentially animated characters attached to particles. The movement of the characters in a crowd simulation is based on an underlying particle simulation in DOPs.
In a crowd simulation, the characters are called agents, and at any given time, the agents are in a particular state, such as standing, walking, or running. Events can happen in a crowd simulation that change the state of the agent, for example, from walking to running. These events are called triggers.
To have a crowd mill about, you could have some agents in an “idle” state and some in a “walk” state. In the idle state, the underlying point that an agent is attached to would remain stationary. In the walk state, the underlying point would move. A trigger checks if each agent has been in its current state for longer than a certain period of time, and for every agent that satisfies that condition, a state transition is made between idle → walk or walk → idle.
Crowd simulations require both a geometry (SOP) network and a simulation (DOP) network:
-
A geometry (SOP) network is used to create and define the agents. The full power of Houdini’s SOP nodes can be used to create agent positions from existing models such as terrain.
-
A simulation (DOP) network is used to run the actual crowd simulation. The DOP crowd simulation network holds the logic that controls the movement of each particle (and in turn, the agent that is attached to it). Within the DOP network, agents can interact with other dynamic (DOPs) elements.
See setting up a crowd simulation for information on using the shelf tools and the network editor to create a basic crowd simulation.
Tip
If you want to jump right into learning how to create crowds, have a look at the Zombies for Everyone tutorial.
Concepts ¶
Agents are the “actors” of the crowd simulation, for example, individual people in a crowd scene. An agent is a character skeleton with skin geometry and animation. Each particle in a crowd simulation has an agent attached to it.
The “source” for a crowd simulation are the points in a geometry (SOP) network. Agents are copied onto these points, and the points represent the starting location of the agents in the simulation. If you don’t give the crowd simulation source points, the Crowd Source SOP node will randomly scatter a specified number of points over a given area.
Clips are bits of animation on an agent (such as “walk” or “run”) that is played when the agent is in a particular state.
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 an animation clip that is played for the agents in that state, and the behavior nodes that affect the movement of the underlying particles that the agents are attached to.
At each step in the crowd simulation, Houdini looks at every agent and checks a series of trigger conditions (for example, “distance to target > 2”). If a trigger applies, Houdini checks for a transition that is attached to the trigger to change the agent to a new state (for example, walk → run). Transitions can have a duration during which Houdini automatically blends the animation clips of the old and new states.
Houdini has many useful POP forces that you could use as behavior nodes to control the movement of the underlying particles that the agents are attached to. These “steering force” nodes are essentially particle forces with the added concept of weights, and they provide useful crowd behaviors such as “move toward a point” or “follow a path”. At any given moment, an agent could be affected by multiple forces (for example, both “follow this path” and “avoid obstacles”). The crowd solver deals with multiple forces by normalizing the weights (scaling them so they add up to 1), and then multiplying the individual forces by the normalized weights.
Along with the crowd steering force nodes, there are also default forces on the crowd solver that have the concept of weights.
You can specify static DOP objects for agents to avoid.
Houdini currently supports a single terrain object (a static RBD object). Agents will follow the terrain, with optional IK foot adaptation.