Houdini 16.5 Crowd simulations

Caches

Tips for efficiently caching and loading crowd sims.

On this page

Reducing File Size

When saving a set of agent primitives to disk, their shared agent definition(s) are also embedded in the geometry file so that the agents can be reconstructed when the file is loaded.

Each component of the agent definition can be marked as an external reference to a file on disk. This occurs when, for example, when the Agent SOP’s Input parameter is set to Disk, or when using the Agent Clip SOP to load animation clips from disk. In such cases, only the path to that file will be stored in the geometry file when saving out the agent definition (similar to a packed disk primitive), which significantly reduces the size of the geometry files when saving a sequence of frames. Otherwise, the contents of that component (such as the clip or shape library) will be embedded in the geometry file in the same manner as a packed geometry primitive.

Tip

Set the Agent ROP’s Source parameter to Agent Primitive to write out the agent definition of an existing agent primitive to disk.

Loading File Caches

When loading agents from a geometry file, the agent definition and any of its externally referenced files will also be read from disk.

If the agent definition does not contain external references, this may reduce performance when loading a sequence of files. In addition to having to load larger files, having a separate copy of the agent definition in each file may cause slower viewport performance since the agent definition will appear to change each frame.

If the agent definition components are external references, Houdini is able to avoid reloading the agent definition files on each frame to improve performance. Houdini maintains a reference-counted cache of agent definition files, so entries will be removed when no agent primitive in memory references those files. This means that it is recommended to set the File SOP’s Cache Frames parameter to at least 1. Otherwise, there can be unnecessary flushing and reloading of the agent definition files when the File SOP’s geometry is cleared before loading the next file in the sequence.

Tip

For equivalent performance to viewing a cached sim from a DOP network, set the File SOP’s Cache Frames parameter to the number of simulation frames.

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.