People innocently packed into the Love Parade 2010 venue just moments before a chaotic outbreak. Arne Müseler/CC BY-SA 3.0

Early Sunday morning on January 27, 2013, the band Gurizada Fandangueira was playing to a packed house at the Kiss nightclub in Santa Maria, Brazil. Hundreds of people, including many university students, were dancing to the group’s upbeat country pop music on the last weekend of Brazil’s summer break. The band shot sparkler columns up into the air, a dazzling display that audiences expected at every Gurizada Fandangueira show. But as one of the guitarists was getting ready for the sixth song of the set, he saw embers float down.

Flames quickly engulfed the acoustic foam insulation on the ceiling. Hot ash fell over the band members and dancers and the venue filled with thick smoke. The approximately 2,000 people inside the Kiss nightclub (1,000 over the building’s capacity) fled towards the only windowless exit. At first security guards thought patrons were trying to leave without paying and blocked exits, trapping victims inside.

Many patrons ran towards the restrooms. Some were following the flow of people and mistook the restrooms as exits, while others went to the small space to hide. Black smoke impaired vision. The narrow hallway that led to the exit became clogged. Pushing and shoving ensued. One person fell, causing another, and another.

The tragic scene investigators and survivors described was nightmarish and chaotic. Two hundred and forty-two people perished in the tragic Kiss nightclub fire, and another 630 were injured. When emergency responders arrived at the scene at 3 a.m., people said the Kiss nightclub looked “like a war zone.”

A memorial of flowers, photos, and notes for those lost in the fire lie outside of the scorched Kiss nightclub in Santa Maria, Brazil. Leandro LV/CC BY-SA 3.0

“There were lots of casualties and a lot of people who ran to the restrooms,” says computer scientist Sharad Sharma, who has created a simulation of the Kiss nightclub fire at the Bowie State University Virtual Reality Laboratory in Maryland. “According to the data, there were 180 victims [in the restroom] and it’s really surprising how 180 people can fit in a small space.”

Researchers investigate these kinds of disasters to understand when crowded events turn dangerous and why they spread. When studying crowds, many different factors come into play, from the behaviors of individuals, the social group behaviors, the disaster (if there is one), to the design of the space. Computer scientists try to incorporate all these variables in models of the movement patterns that ripple through the masses. Taking the information from past events, they also create virtual simulations and technologies in the hope of preventing future disasters.

Defining crowd disasters is complex. In large mass gatherings, the mere shifting of hundreds and thousands of bodies filed in the confines of a space can lead to confusion, and sometimes a disastrous crowd collapse. Whereas, in the case of the Kiss nightclub tragedy, the fire initiated an evacuation which sent hundreds fleeing towards the exit. Many were crushed and trampled in the evacuation process.

Crowds are not necessarily mindless, mob-like entities. James Cridland/CC BY 2.0

Many media outlets referred to what happened as a “mass panic” or a “stampede.” But such terms are not appropriate to the situation, according to John Drury, a social psychologist at the University of Sussex.

“People follow others when they perceive these others as relevant, so it is not mindless,” Drury says. “The problems come when the others don’t take the danger seriously enough. People more often die in emergencies through not evacuating quickly rather than through haste.”

Stampeding is a primitive, instinctive behavior of herd animals, and panic implies a rashness or irrationality in response to a real or perceived danger, Drury writes on his academic blog. But crowds shouldn’t be compared to unintentional, mindless mobs. Instead Drury refers to these events as progressive crowd collapses.

Cultural connections and social groups, such as being Chicago Cubs fans or sharing the same religion, can influence the behavior of a crowd, he explains. “Assuming that the crowd is simply made up of individuals who behave like particles or billiard balls in a mass doesn’t account for a number of features of crowds,” Drury and his colleague wrote in The Conversation. “Some physical crowds could contain many different psychological crowds, or groups with different social identities.”

Law enforcement assessing the crowds after the tragedy on the Bund in Shanghai. Konrad Lembcke/CC BY-ND 2.0

Computer scientists try to factor in the psychological variables. There are artificial intelligence and logic algorithms, such as the “fuzzy logic” model, that account for unpredictable factors and emotional behaviors, or “fuzzy” characteristics, such as stress, anger, and panic. Still, the variability of emotions remains a challenge to compute. In the Megacity collaborative virtual reality environment, Sharma was able to program different agents or roles with hostile, selfish, altruistic, and leadership behaviors. Users who participate in the scenarios can be assigned a behavior to help make the simulation more lifelike.

“Some researchers argue that there is no panic in models because it’s too difficult to quantify panic,” says Jian Ma, an evacuation dynamics and pedestrian traffic researcher at Southwest Jiaotong University in China. “Without a definition or a computation, you cannot say that panic induced this mass fleeing.”

Ma instead describes the “spread of panic” as a spread and flux in pressure. When crowds reach a critical density, a certain amount of force, push, or a fall can cause a domino effect, he says. This spread of movement causes different kinds of patterns within the crowd.

The narrow tunnel that was packed with people during the 2010 Love Parade in Germany. kaʁstn/CC BY-SA 3.0

In 2014, hundreds of thousands of people were shuffling on a small ramp at Chen Yi Square on the Bund riverfront in Shanghai to get a good view of the New Year’s Eve light show. So many people were crammed on the narrow passageway that linked the upper and lower levels of the deck that they were at a standstill. Yet, those with obscured views continued to push forward, causing a problematic counter flow movement.

As the density of people continued to build, the counter flow behavior triggered the crowd collapse, says Ma. Thirty-six died and 50 were injured.

“This situation is quite common in other disasters,” Ma says. “It’s very important to control the flow direction and to avoid counter flow situations.”

The ramp in Chen Yi Square that was at the root of the New Year’s Eve disaster has since been remodeled, Ma says. The passage is much wider and slopes in a more optimal fashion.

The small staircase ramp shown near the bottom of the photo was the sight of the disaster at the Bund riverfront. It has since been reconstructed. Mulligan/Stu/CC BY 2.0

Often times people cannot see how much congestion there is at the head of the crowd, Drury writes. People also commonly try to escape from the place in which they entered. This can cause clogging at the doors, a kind of heart pumping, push-and-pull behavior, Sharma explains. In the case of a fire, evacuees may not see through the smoke or be able to get to the exit closest to them.

In Germany, 21 people died of suffocation at the Love Parade musical festival in 2010. Ma obtained the video footage of the crowd mobbed inside a compact tunnel—the only passageway into the venue. The underpass had been closed by police who said there were already 1.4 million attendees inside, which left the people stuck in the tunnel with nowhere to turn. Over loudspeakers, people inside the festival were instructed to exit, which caused even more congestion.

There were as many as 11 people crammed into a square meter, unleashing a kind of “special earthquake” in the frozen crowd, Ma explains. The pressure release caused a “crowd turbulent flow movement”, which is much like a stop-and-go traffic wave. There hasn’t been another Love Parade festival since the horrific event.

A screenshot of the Kiss nightclub simulation by the Virtual Reality Lab at Bowie State University. Sharad Sharma/Bowie State University Virtual Reality Laboratory

“There are some design features that make successful evacuation more likely,” says Drury. “Knowing the building layout and fire exits is also important.” However, this can be a challenge if those exits are obstructed from view. To help people in real-time, Sharma and his research lab have been working on an augmented reality phone app that pinpoints a person on a floor map of the building, guiding them to the best possible exit.

The team ran a test with the blueprint of Bowie State University’s library and used Wi-Fi bay stations to help triangulate a person’s location. The app is placed in front of a marker that projects the floorplan and visually shows the exits. Sharma hopes the lab can further develop the app so that they can find where everyone is in a building and provide escape routes. “If you have a known location of all the people, you can give users specific instructions on what exit to take, what exit not to take, and how to respond to the situation,” he says.

Other real-time crowd management tools have been deployed during mass religious gatherings. In response to the 2015 crush during the pilgrimage to Mecca in Saudi Arabia, this year the Saudi Ministry of Hajj gave pilgrims electronic bracelets with individual tracking GPS and vibrating alert systems to inform when they should slow down. Additionally, Sharma’s Oculus Rift and Samsung Gear VR virtual reality simulations of subways, airplanes, college campuses, and urban environments are being further developed to serve as training grounds for emergency responders.

While they may be painful to relive, researchers take the data from these catastrophic events to try to prevent them from happening again—spinning alternate scenarios to be better prepared for the unexpected future. Simulating evacuation situations in a virtual space gives more flexibility, and provides more opportunities to grab better data.

“Humans and the factors of these events are so unpredictable,” says Sharma. In these studies “you can come up with these lessons from different behaviors and learn how to prevent chaos.”