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.
| Component | Function | Typical implementation |
|---|---|---|
| Agent brain | Chooses actions | State machine or behavior tree |
| Locomotion | Moves the agent over terrain | Motion clips with blending |
| Navigation | Finds paths to goals | Navigation mesh or flow field |
| Avoidance | Prevents collisions between agents | Velocity obstacles or social forces |
| Variation | Prevents visible clones | Random meshes, textures and timing |
| Output layer | Hands results to rendering | Instances, baked caches or agent points |
Navigation and collision avoidance models
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.
| Model | Principle | Strength | Weakness |
|---|---|---|---|
| Boids steering | Three local rules | Very cheap, natural flocks | Poor for goal-driven humans |
| Social force model | Attractive and repulsive forces | Realistic pressure in dense crowds | Jitter and oscillation |
| Velocity obstacles (ORCA) | Choose collision-free velocities | Smooth, stable avoidance | Can look too polite |
| Flow fields | Shared direction grid | Scales to huge crowds | Little individual variation |
| Navigation mesh paths | Graph search over walkable areas | Accurate routing | Needs local avoidance on top |
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 band | Representation | Typical savings |
|---|---|---|
| Hero foreground | Full rig, cloth and hair | None, highest quality |
| Midground | Reduced mesh, baked deformation | Large reduction in polygons |
| Background | Low-poly proxies via instancing | Shared geometry and textures |
| Far distance | Sprites or impostor cards | Near-constant cost per agent |
Crowd simulation compared with related effects
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.
| Symptom | Likely cause | Fix |
|---|---|---|
| Foot sliding | Clip speed mismatches travel speed | Foot locking with inverse kinematics |
| Visible clones | Same clip and timing | Randomize offsets and variants |
| Jittering agents | Avoidance forces oscillate | Smooth velocities, raise damping |
| Agents stuck at corners | Poor navigation mesh | Rebuild mesh, add waypoints |
| Slow playback | Full rigs on every agent | Use proxies and level of detail |
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.