It’s a nightmare scenario—a nuclear strike on a populated area. Unfortunately, the threat of such an attack seems more tangible lately, as nuclear powers openly sabre-rattle, missile alerts are mistakenly sent to huge populations, and the Doomsday clock ticks ominously closer to midnight.

While one hopes that these escalating tensions never spill over into nuclear warfare, scientists at the Biocomplexity Institute of Virginia Tech are figuring out the best disaster response in case they do. Under the direction of the US Defense Threat Reduction Agency, a subgroup of the Department of Defense, the institute has developed a computational framework called the Comprehensive National Incident Management System (CNIMS) to simulate catastrophes.

Of course, these models are grim—hundreds of thousands of fatalities are projected in CNIMS simulations of a nuclear strike on K Street in Washington DC. But the data is essential to optimize the best emergency strategies to help survivors, which are represented in the models as a “synthetic population.” (The yellow cloud below represents radiation flow from the blast).

Like some hyper-accurate version of a Sims world, these models are generated from traditional demographic sources, like census records, in addition to much newer and flashier data sourced from social media and mobile communication. Indeed, in recent years, scientists have increasingly relied on smartphones as “behavioral data-collection tools,” according to a 2016 study in Perspectives on Psychological Science.

“Smart-phone sensing methods make use of these behavioral records by implementing on-the-phone software apps that passively collect data from the native mobile sensors and system logs that come already embedded in the device,” the study notes.

Examining this information helps scientists predict what types of people would be impacted in various population centers based on commuter peaks, tourism patterns, population density, frequency of social interactions, and other factors that can be mined from smartphone data. This is all vital to understanding how important survival information might spread in the fallout of a nuclear attack.

“There are some consistent themes that come out from these studies,” said Samarth Swarup, a research assistant professor at the Biocomplexity Institute, in a video explainer about these simulations. “People look for family members, and try to reacquaint as a group. People will shelter in place if they are informed about the dangers of leaving. People will aid and assist one another—a lot of immediate search and rescue is actually carried out by survivors, rather than emergency responders.”

These findings suggest that one of the most impactful responses to a nuclear attack would be setting up interim communication networks to empower people to help each other until rescue services access them. Cellular and data hubs, perhaps strapped to balloons or drones, could create an emergency system of information dispersal so that people can locate themselves and others, tune in to instructions and updates, and seek shelter from radiation.

Read More: The Nuclear War Movie That Traumatized a Generation Is Back

The Biocomplexity Institute is one of many research centers developing advanced disaster models using data from smartphone and social media. Last year, for instance, the Center for Social Complexity simulated a scenario of a nuclear strike on New York City, with the help of smartphone modeling. That research found that one of the first impulses people experience after a catastrophe is to connect to their social network to confirm their own status, and inquire about their loved ones, further highlighting the need to rapidly establish an emergency communication system.

These simulations of human behavior in the aftermath of a nuclear attack will only get more complex as computing capabilities increases and new data sources are introduced. Fortune favors the prepared, of course, but all the same, let’s hope these models will remain theoretical.