Crowd simulation

Crowd simulation is the process of simulating the movement of a large number of entities or characters; this technique is now commonly used in 3D computer graphics for film. While simulating crowds, observed human behavior and interactions are taken into account to replicate collective behavior. It is a method of creating virtual cinematography.

The need for crowd simulation arises when a scene calls for more characters than can be practically animated using conventional systems, such as skeletons/bones. Simulating crowds offer the advantages of being cost effective as well as allow for total control of each simulated character or agent.

Animators typically create a library of motions, either for an entire character or for individual body parts. To simplify processing, these animations are sometimes baked as morphs. Alternately, the motions can be generated procedurally – i.e. choreographed automatically by software.

The actual movements and interactions of the crowd are typically implemented in one of two ways:

Particle motion

The characters are attached to point particles, which are then animated by simulating wind, gravity, attractions, and collisions. The particle method is usually inexpensive to implement, and can be done in most 3D software packages. However, this method is not very realistic because it is difficult to direct individual entities when necessary. Also, motion is generally limited to flat surfaces.

Crowd AI

A crowd simulation of Covent Garden, London, showing a crowd of pedestrian agents reacting to a street performer
Main article: Swarm intelligence

Individual entities in a crowd are also called agents. One of the problems in crowd simulation, is having the crowd behave in a realistic manner. In other words, having the agents in the crowd make "intelligent decisions." To solve this problem, agents are sometimes given artificial intelligence, which guides the entities based on one or more functions, such as sight, hearing, basic emotion, energy level or aggression level. Entities are given goals and then interact with each other just as members of a real crowd would. They are often programmed to respond to changes in their environment; for example, they may climb hills, jump over holes or scale ladders. This system is much more realistic than particle motion.

Algorithm by Patil and Van Den Berg

This algorithm was designed for relatively simplistic crowds, where each agent in the crowd only desires to get to its own goal destination while also avoiding obstacles.[1] This algorithm could be used for simulating a crowd in Times Square.

Patils algorithm's most important and distinctive feature is that it utilizes the concept of navigation fields for directing agents. This is different from a guidance field; a guidance field is an area around the agent in which the agent is capable of "seeing"/detecting information. Guidance fields are typically used for avoiding obstacles, dynamic obstacles (obstacles that move) in particular. Every agent possesses its own guidance field. A navigation field, on the other hand, is a vector field which calculates the minimum cost path for every agent so that every agent arrives at its own goal position.

The navigation field can only be used properly when a path exists from every free (non-obstacle) position in the environment to one of the goal positions. The navigation field is computed using coordinates of the static objects in the environment, goal positions for each agent, and the guidance field for each agent. In order to guarantee that every agent reaches its own goal the navigation field must be free of local minima, except for the presence of sinks at the specified goals.

The running time of computing the navigation field is O(m*n*log(mn)), where m × n is the grid dimension (similar to Dijkstra's algorithm). Thus, the algorithm is only dependent on the grid resolution and not dependent on the number of agents in the environment. However, this algorithm has a high memory cost.

Individual Behavior Modelling

One set of techniques for AI-based crowd simulation is to model crowd behavior by advanced simulation of individual agent motivations and decision-making. Generally, this means each agent is assigned some set of variables that measure various traits or statuses such as stress, personality, or different goals. This results in more realistic crowd behavior though may be more computationally intensive than simpler techniques.

Stress-based Model[2]

The behavior of crowds in high-stress situations can be modeled using General Adaptation Syndrome theory. Agent behavior is affected by various stressors from their environment categorized into four prototypes: time pressure, area pressure, positional stressors, and interpersonal stressors, each with associated mathematical models.

Time pressure refers to stressors related to a time limit in reaching a particular goal. An example would be a street crossing with a timed walk signal or boarding a train before the doors are closed. This prototype is modeled by the following formula:

where is the intensity of the time pressure as a function of the estimated time to reach the goal and a time constraint .

Area pressure refers to stessors as a result of an environmental condition. Examples would be noise or heat in an area. The intensity of this stressor is constant over a particular area and is modeled by the following formula:

where is the intensity of the area pressure, is the position of the agent in an area , and is a constant.

Positional stressors refer to stressors associated with a local source of stress. The intensity of this stressor increases as an agent approaches the source of the stress. An example would be a fire or a dynamic object such as an assailant. It can be modeled by the following formula:

where is the intensity of the positional stressor, is the position of the agent and is the position of the stressor. Alternatively, stressors that generate high stress over a large area (such as a fire) can be modeled using a Gaussian distribution with standard deviation :

Interpersonal stressors are stressors as a result of crowding by nearby agents. It can be modeled by the following formula:

where is the intensity of the interpersonal stressor, is the current number of neighbors within a unit space and is the preferred number of neighbors within a unit space for that particular agent.

The perceived stress follows Steven's Law and is modeled by the formula:

where is the perceived stress for a stress level , is a scale factor, and is an exponent depending on the stressor type.

An agent's stress response can be found with the following formula:

where is the stress response capped at a maximum value of and is the maximum rate at which an agent's stress response can change.

Examples of notable crowd AI simulation can be seen in New Line Cinema's The Lord of the Rings films, where AI armies of thousands of characters battle each other. This crowd simulation was done using Weta Digital's Massive software.


Crowd simulation can also refer to simulations based on group dynamics and crowd psychology, often in public safety planning. In this case, the focus is just the behavior of the crowd, and not the visual realism of the simulation. Crowds have been studied as a scientific interest since the end of the 19th Century. A lot of research has focused on the collective social behavior of people at social gatherings, assemblies, protests, rebellions, concerts, sporting events and religious ceremonies. Gaining insight into natural human behavior under varying types of stressful situations will allow better models to be created which can be used to develop crowd controlling strategies.

Emergency response teams such as policemen, the National Guard, military and even volunteers must undergo some type of crowd control training. Using researched principles of human behavior in crowds can give disaster training designers more elements to incorporate to create realistic simulated disasters. Crowd behavior can be observed during panic and non-panic conditions. When natural and unnatural events toss social ideals into a twisting chaotic bind, such as the events of 9/11 and hurricane Katrina, humanity's social capabilities are truly put to the test. Military programs are looking more towards simulated training, involving emergency responses, due to their cost effective technology as well as how effective the learning can be transferred to the real world. Many events that may start out controlled can have a twisting event that turns them into catastrophic situations, where decisions need to be made on the spot. It is these situations in which crowd dynamical understanding would play a vital role in reducing the potential for anarchy.

Modeling techniques of crowds vary from holistic or network approaches to understanding individualistic or behavioral aspects of each agent. For example, the Social Force Model describes a need for individuals to find a balance between social interaction and physical interaction. An approach that incorporates both aspects, and is able to adapt depending on the situation, would better describe natural human behavior, always incorporating some measure of unpredictability. With the use of multi-agent models understanding these complex behaviors has become a much more comprehensible task. With the use of this type of software, systems can now be tested under extreme conditions, and simulate conditions over long periods of time in the matter of seconds.

Modeling individual behaviors

Helbing proposed a model based on physics using a particle system and socio-psychological forces in order to describe human crowd behavior in panic situation, this is now called the Helbing Model. His work is based on how the average person would react in a certain situation. Although this is a good model, there are always different types of people present in the crowd and they each have their own individual characteristics as well as how they act in a group structure. For instance, one person may not react to a panic situation, while another may stops walking and interfere in the crowd dynamics as a whole. Furthermore, depending on the group structure, the individual action can change because the agent is part of a group, for example, returning to a dangerous place in order to rescue a member of that group. Helbing's model can be generalized incorporating individualism.

In order to tackle this problem, individuality should be assigned to each agent, allowing to deal with different types of behaviors. Another aspect to tackle this problem is the possibility to group people, forming these group causes people to change their behavior as a function of part of the group structure. Each agent (individual) can be defined according to the following parameters:

  1. Id - Agent identifier
  2. IdFamily - Identifier of the family. A family is a predefined group formed by agents who know each other
  3. DE - Dependence level of the agent which mimics the need for help. Values [0,1]
  4. AL - Altruism level representing the tendency to help other agents. Values [0,1]
  5. vi - Speed of the agent

To model the effect of the dependence parameter with individual agents, the equation is defined as:

vi = (1 - DE)vmax

When evaluating the speed of the agent, it is clear that if the value of the dependence factor, DE, is equal to one, then the person would be fully disabled making him unable to move. If the dependence factor is equal to zero, then the person is able to run at his max speed.

Group formation is related to the Altruism force which is implemented as an interaction force between two or more agents who are part of the same family. Mathematically, it is described as the following:

i = K x ΣALiDEj x |dij-dip| x eij

dij represents the distance between two agents with the origin at the position of the agent. dip is the distance vector point from the agents to the door's position p of the simulation environment. K is a constant. eij is the unitary vector with the origin at position i.

Consequently, the greater the parameter ALi of agenti, the bigger will be Fāi which points to the agentj and has the high level of DEj. When both agents are close enough to each other, the one with high DE (agentj in this example) adopts the value of agenti (DEj = DEi). This means that the evacuation ability of agenti is shared with agentj and both start moving together.

By using these applying these equations in model testing using a normally distributed population, the results are fairly similar to the Helbing Model.

The places where this would be helpful would be in an evacuation scenario. Take for example, an evacuation of a building in the case of a fire. Taking into account the characteristics of individual agents and their group performances, determining the outcome of how the crowd would exit the building is critically important in creating the layout of the building.[3]

Situation and Pluggable Character Architecture

There are many different case situations that come into play in crowd simulations. Many situations are based off of the environment of the simulation or the behavior of the group of local agents. These will indicate how the crowds will act in multiple complex scenarios while several different situations are being applied. A situation can be any circumstance that has typical local behaviors. We can categorize all situations into two different kinds.

Spatial situation is a situation that has a region where the environment affects the local agents. For instance, a crowd waiting in line for a ticket booth would be displaying a spatial situation. Other examples may be a bus stop or an ATM machine where characters act upon their environment. Therefore, we would consider 'bus stop' as the situation if the behavior of the agents are to be getting on or off a bus.

Non-Spatial situation has no region in the environment because this only involves the behavior of the crowd. The relationship of the local agents is an important factor to consider when determining behavior. An example would be a group of friends walking together. Typical behavior of characters that are friends would all move along with each other. This means that 'friendship' would be the situation among the typical behavior of walking together.

The structure of any situation is built upon four components, Behavior functions, Sensors, States, and Event Rules. Behavior functions represent what the characters behaviors are specific to the situation. Sensors are the sensing capability for agents to see and respond to events. States are the different motions and state transitions used only for the local behaviors. Event rule is the way to connect different events to their specific behaviors. While a character is being put into a situation, these four components are considered at the same time. For spatial situations, the components are added when the individual initially enters the environment that influences the character. For non-spatial situations, the character is affected only once the user assigns the situation to the character. The four components are removed when the agent is taken away from it's situations region or the situation itself is removed. The dynamic adding and removing of the situations lets us achieve scalable agents.

Real world applications

In 2006, the gaming company known as Nintendo released a console known as the Wii System. The Wii came equipped with crowd creation and simulation software called the Mii Channel. Using the Mii Channel users can design 3D caricatures of human beings called Miis. These Mii avatars can be used in several games which operate on the Wii console including Wii Sports and Wii Play. Inside the Mii Channel, the individual Mii agents are capable of moving around on their own. The movements of the agents are realistic; when a Mii changes position the joints of the Mii's legs change orientation to create the animation of walking. The AI behind the movement of the Mii agents does not appear to be very complex or intelligent.

See also

Crowd simulation software


  1. Patil, Sachin. "Directing Crowd Simulations Using Navigation Fields". IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHIC.
  2. "Interactive Simulation of Dynamic Crowd Behaviors using General Adaptation Syndrome Theory" (PDF). Retrieved 6 October 2016.

External links

This article is issued from Wikipedia - version of the 12/2/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.