Crowd simulation

On this page 7

Crowd simulation is the technique of animating large numbers of characters as autonomous agents that move, react and interact according to rules rather than individual hand animation. In simulation & effects for 3D graphics and animation, it fills stadiums, battlefields, city streets and flocks with hundreds to millions of individuals that each appear to make their own decisions.

A crowd system combines agent behavior, navigation and collision avoidance, and a library of motion clips that the agents play and blend. Unlike a particle system, every agent is a rigged character with a pose, so the main challenges are believable variety, stable foot contact and rendering cost at scale.

How crowd simulation drives individual agents

Each agent runs a perception, decision and action loop on every simulation step. It senses nearby agents, obstacles and goals within a limited radius, chooses a behavior such as walking, waiting or fleeing, and then selects or blends an animation clip that matches its new speed and direction. The body pose is written to the skeleton, and the skinned mesh or a proxy is drawn at that pose.

Behavior can be authored with state machines, behavior trees, fuzzy logic or simple steering rules. The classic boids model uses only separation, alignment and cohesion to create convincing flocks. Human crowds need more structure, so most systems add goals, paths and timing so that agents do not wander aimlessly. The table below lists the main building blocks of a production crowd system.

ComponentFunctionTypical implementation
Agent brainChooses actionsState machine or behavior tree
LocomotionMoves the agent over terrainMotion clips with blending
NavigationFinds paths to goalsNavigation mesh or flow field
AvoidancePrevents collisions between agentsVelocity obstacles or social forces
VariationPrevents visible clonesRandom meshes, textures and timing
Output layerHands results to renderingInstances, baked caches or agent points
Core components of a crowd system

Navigation splits into global path planning and local avoidance. Global planning finds a route through the environment, usually with an A-star search on a navigation mesh or a precomputed flow field. Local avoidance adjusts velocity every step so agents slip past each other without overlapping, which is where most of the visual realism of dense crowds comes from.

ModelPrincipleStrengthWeakness
Boids steeringThree local rulesVery cheap, natural flocksPoor for goal-driven humans
Social force modelAttractive and repulsive forcesRealistic pressure in dense crowdsJitter and oscillation
Velocity obstacles (ORCA)Choose collision-free velocitiesSmooth, stable avoidanceCan look too polite
Flow fieldsShared direction gridScales to huge crowdsLittle individual variation
Navigation mesh pathsGraph search over walkable areasAccurate routingNeeds local avoidance on top
Common avoidance and navigation models

Physical contact is a separate layer. When agents are struck by explosions or fall from walls, many systems switch them to ragdoll dynamics using rigid body simulation, then optionally blend back to animation. This switch between kinematic and dynamic states is common in battle scenes.

Motion clips, variation and level of detail

Agents rarely compute their poses from scratch; they play motion capture or keyframed clips stored in a library. A motion graph or clip tree defines which clips can follow each other and where the transitions are safe, and the system blends clips while correcting foot sliding with inverse kinematics. A typical library for a walking crowd contains dozens of walk, idle, turn and reaction clips at several speeds.

Variation is what makes a crowd look real. Productions randomize body proportions, clothing, textures, clip offsets and playback speed, so no two neighbors move in sync. To keep memory and render time manageable, crowds use level of detail (LOD): full meshes near the camera, simplified meshes in the middle distance and cards or impostors far away.

Distance bandRepresentationTypical savings
Hero foregroundFull rig, cloth and hairNone, highest quality
MidgroundReduced mesh, baked deformationLarge reduction in polygons
BackgroundLow-poly proxies via instancingShared geometry and textures
Far distanceSprites or impostor cardsNear-constant cost per agent
Level of detail strategy for crowd agents

Crowd simulation borrows ideas from particle systems, but each particle is replaced by a character with a skeleton and a behavior. It differs from procedural animation of a single character because the emphasis is on group dynamics, and from rigid body simulation because agents act on intent, not only on physical forces. Crowds are often combined with particle instancing to render the final geometry efficiently.

Practical setup and common problems

A practical crowd shot starts with layout and intent: where agents enter, where they go and which ones the camera will see closely. Artists then build the clip library, test behaviors with simple proxies, and only later switch to full geometry. Caching the simulation to disk is essential, because rendering and lighting must not depend on rerunning the simulation.

SymptomLikely causeFix
Foot slidingClip speed mismatches travel speedFoot locking with inverse kinematics
Visible clonesSame clip and timingRandomize offsets and variants
Jittering agentsAvoidance forces oscillateSmooth velocities, raise damping
Agents stuck at cornersPoor navigation meshRebuild mesh, add waypoints
Slow playbackFull rigs on every agentUse proxies and level of detail
Typical crowd problems and fixes

Put simply

Animating thousands of people by hand would take years. Crowd simulation lets the computer do it. Each digital person follows a few simple rules. Walk toward your goal. Do not bump into others. React when something happens nearby.

It works a bit like a school of fish. No fish leads the whole group, yet the school moves together. In a film crowd, every character also picks from a set of recorded movements, such as walking or cheering. Small random differences in clothing and timing make the crowd look natural instead of copied.

In practice

A visual effects team must fill a 60,000-seat stadium for a sports drama, but only 300 extras are available on set. The team films the extras in the lower stands and records about 120 motion capture clips of sitting, standing, clapping and celebrating.

In the crowd system, each seat becomes an agent with a randomized body, shirt color and reaction delay of 0 to 0.8 seconds. When the home team scores, a trigger spreads outward from the goal end, so the cheer ripples across the stands instead of starting everywhere at once. Seats near the camera use full meshes, while the upper tiers use instanced low-poly proxies. The final shots render overnight on the studio farm, and audiences see a full, lively stadium that was never there.