Справка Houdini на русском Crowd simulations

Crowd animation clips

How to associate animation with agents in certain states.

On this page

Overview

Clips are bits of animation that an agent replays when in a certain state. Houdini will look for an animation clip with the same name as the state and apply it to any agents in that state.

Even while agents are running pre-made animation, the simulation can add procedural changes on top, for terrain adaptation, "look at", and so on. You can also transition from animation to ragdoll simulation.

Houdini requires that you "bake out" the animation to files on disk for performance. Each time you add or change a clip, you should go to this node and re-save the animations to disk.

How it works

The Agent render node "renders" a piece of character animation out to files on disk containing the animated geometry and character skeleton data. The render node associates the files with the combination of the name of the agent and the name of the clip. The Crowd Source nodes in the agent geometry network associates agent primitives with a set of clips through the agent name. An agent in a certain state will loop an animation clip with the same name as the state.

The render node writes the files to, and the crowd nodes read the files from, a cache directory. The default cache directory is ${HIP}/agents/, which stores the clips in an agents subdirectory next to the scene file. If you change the cache directory, you need to also change it in any Crowd Source nodes in the agent geometry network that load the clips. (If you do this, you might want to use channel references between the nodes to make sure they stay synchronized.)

Adding an animation clip

The crowd system assumes characters are contained in an asset or subnetwork.

  1. Load and select the character node (asset or subnet) containing the animation you want to bake out.

  2. In the Crowds shelf, click Bake Agent. This creates a agent_bake render subnet at the object level if it doesn’t already exist, creates a new Agent render node inside for this clip, and selects it.

  3. In the parameter editor, set the Agent name to the name of the character this animation is for (for example, knight). Set the Clip name to a name of the clip (for example, charge).

Re-baking animation after changes

  1. Select the character baking render subnetwork. In the parameter editor, click Render to render all the character baking nodes inside. (If this is very slow, you can go into the render subnetwork and individually render the node only for the characters that have changed.)

  2. After you bake out any new clips, select the any Crowd Source nodes that use the character in the crowd geometry network. In the parameter editor, click then Source tab, then click Reload.

Tips and notes

  • The Crowd Solver in the simulation network has controls for how the solver re-times animation to better match agent movement.

See also

Crowd simulations

Getting started

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.

  • Clips

    How to associate animation with agents in certain states.

  • Triggers

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

Next steps

  • Foot planting

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

  • Transition graphs

  • Attributes

    Useful attributes for reading in triggers, or that you can set to affect behavior.

  • Sensors

    How to make agents behave differently based on their virtual senses.

  • Diversity

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

  • Weights

    How the Houdini crowd solver decides which behaviors to apply to an agent at each time step.

  • Terrain

    How to specify terrain geometry for agents to walk across.

  • Obstacles

    How to set up obstacles for agents to avoid.

  • Dynamics interaction

    Tips on setting up interaction between agents and other types of dynamics.

  • Ragdoll simulation

  • Adding direction

    How to assert manual control over different aspects of the crowd simulation.

  • Fuzzy Logic

  • Caches

    Tips for efficiently caching and loading crowd sims.