On this page |
Overview ¶
Crowd simulations require a few different node networks to set up. Most of these have shelf tools that set up the networks for you.
-
A geometry network to define agent primitives.
-
A simulation network to run the crowd simulation.
Quick start ¶
It’s possible to use the Simulate shelf tool to get a “demo” crowd simulation quickly in one scene. This is useful for getting a feel for the different networks involved in crowd simulations.
-
Press ⌃ Ctrl + LMB on the
Simulate tool on the Crowds shelf tab. The tool will automatically build agents and a crowd source networks using the
mocapbiped1
character built into Houdini. -
If you have terrain geometry you want the agents to walk across, select it and click
Terrain on the Crowds shelf tab.
Define an agent ¶
Crowds assume your character is encapsulated as a digital asset or in an FBX file.
To... | Do this |
---|---|
Create an agent from a character using the shelf tool |
|
Set up an agent network manually |
|
Agent definition network ¶
This network is where you (or the shelf tools) add nodes to modify the agent primitive before simulation, such as adding layers, and adding collision and rotation information for ragdoll simulation.
|
Creates an agent primitive, and sets basic information such as its name, the current layer, and the current animation clip. |
|
|
Adds one or more animation clips to the agent definition. |
|
|
This node exists as a reference target for the simulation network to grab the agents using a |
|
|
Can write out the agent definition to disk and then in subsequent cooks read the definition from the cached files instead of the input. You can use this to speed up the agent definition network if cooking the character is slow. |
|
|
Sets up additional information on the agent, such as the names of important joints and specifies transforms to use for different limbs, so the solver knows how to do foot placement and other procedural changes. This is after the Agent Definition Cache node, because it’s always fast to compute so it doesn’t need to be cached. |
|
|
Marker for the end of the “cache-able” section of the agent definition. A convenient target for importing the final agent definition into other networks. |
Adding animation clips to an agent ¶
A clip is a bit of animation (for example, standing, walking, running) on a character. You can add clips to the agent definition, so the agent can perform different animations in different states.
To... | Do this |
---|---|
Set up animation sources |
Before you can add clips to an agent, you need to set up individual instances of the source character performing each animation. For example, say you have an agent based on The most convenient way to do this is if your character has embedded animation you can switch to using a pop-up menu on the character asset itself. Then you can simply create as many instances as you need and set the menu differently on each one. |
Add an animation clip to an agent using the shelf tool |
|
Add an animation clip to an agent manually |
|
Note
In previous versions of Houdini’s crowd system, where agent information was always baked to disk, you could have a single instance of your character, set it to play an animation clip, bake out that clip, edit the same instance to play a different clip, bake out that clip, and so on.
The current system is much more convenient and no longer requires baking files to disk. The system simply cooks the character information it needs directly in Houdini. However, this means you need separate instances of the character asset performing each animation clip, so the crowd system can cook them when necessary.
Create a crowd source ¶
To create a crowd, you need a crowd source network that creates a crowd of agent primitives. This network scatters points and then instances agent primitives onto the points.
-
On the Crowds shelf tab, click
Populate.
-
Select the agent setup object, then press Enter.
-
If you have terrain geometry, select it and press Enter, or just press Enter if you don’t have terrain.
(With no terrain geometry, the node will simply scatter agents across an area defined by parameters on the node).
Tip
You can edit the resulting network and use whatever SOPs you want to set up the points before copying agents onto them. For example, instead of scatting the points, you could use SOPs to set them up in ordered rows if that’s what you need.
Crowd source network ¶
|
Object merge |
These nodes “import” the agent primitive from a setup networks. |
|
This node copies agent primitives onto points. It has options for automatically scattering agents across a surface or within a defined area, as well as for randomizing their initial states. |
|
|
This node sets up the constraint networks between agent parts, for ragdoll simulation. |
|
|
|
This node merges the separate import → crowd source → constraints branches for each agent class in the simulation. Below this is a null node to act as a target for importing the agents into the crowd simulation DOP network. You can wire nodes you want to apply to all agents between these two nodes. |
|
|
This DOP IO node node imports the results of the DOP crowd simulation back into this object so it can be rendered. |
You can wire geometry into the second input of the crowd source node to control the scattering of agents.
-
If you wire in point geometry, it will create agents at those points.
If the input points have agent related attributes on them, the attributes will be copied onto the new agent primitives. This is a very effective way of manually or randomly specifying different starting conditions, looks, etc. across agents.
-
If you wire in surface geometry, it will use the dimensions of the of the surface as the area across which to randomly scatter a number of agents controlled by a parameter.
If the surface has a
density
attribute, the node will only create agents where the attribute is non-zero. -
If you don’t wire in any geometry, it will use its parameters to decide the area and number of agents to randomly scatter.
Create a crowd simulation ¶
The crowd source network generates agent primitives representing the individual agents in the crowd. To make the crowd move and execute behaviors, you need a crowd simulation network.
-
Select the crowd source object.
-
On the Crowds shelf tab, click
Simulate.
The tool will build a dynamics network the loads the crowd source and applies a few default behaviors. You can edit the nodes in this network to set up the crowd behaviors you want.
See dynamics network below for information on the general structure of this network.
DOP network ¶
The Simulate shelf tool creates the geometry network above as well as a simulation network with some sample nodes for simulating the crowd.
|
Each branch leading into the The state node is followed by behavior nodes specific to that state, between the state node and the You can wire behavior nodes after the The state name should correspond to an animation clip of the same name that agents will play while in that state. |
|
|
Each branch leading into the The trigger node(s) is/are followed by a (You can wire multiple Transition nodes between a trigger and the |
|
|
This is a |
|
|
Implements the crowd system. The solver has controls for several optional default behaviors that can apply to all agents, such as agent-to-agent collision avoidance, and terrain following. |
|
|
Crowd Object and POP solver |
These nodes are used by the particle (POP) foundation on which the crowd system is built. You will not usually need to modify these nodes. |
Tip
Houdini automatically color codes certain nodes to make it easier to keep them straight in the network editor (Crowd State pink, Crowd Trigger orange, Crowd Trigger Logic green). If you want to, you can change a node’s color after it is created.
Shelf tools ¶
The following tools are on the Crowds tab of the shelf.
|
Add an animation clip to an agent definition by referencing a character instance performing that animation. |
|
|
Set up simple collision geometry around an agent character’s skeleton. |
|
|
Set up joint rotation limits on an agent character, for use in ragdoll simulation. |
|
|
Create a network to scatter agents across the selected geometry, but do not create the simulation network. This may be useful for layout artists who don’t want to create a simulation. |
|
|
Paint density |
Paint density attributes on terrain geometry to control the random distribution of generated agents. |
|
Set up geometry and simulation networks with sample animated agents and sample behaviors. This is useful for setting up the networks quickly, and you can then modify them to suit your needs. |
|
|
Set the selected geometry as terrain for the current crowd simulation. |
|
|
Add the selected geometry as an obstacle for the current crowd simulation. |
|
|
Create a |
|
|
Have agents keep their head turned toward the selected object. |
|
|
Have agents chase the selected object. |
|
|
Create an attach cameras to the head transform of the selected agents. |