VIRUSEPIDEMIC

The Virus Simulation

Simualtion the Spread

In order to simulate the spread of a virus, we have to keep track of the proximities between citizens. In the module focused by the player, Unity’s physics engine can be used to do so. Outside the focused module, things are a bit more complicated:
Every time a citizen leaves a module, we must iterate over all citizens they could have infected or could have been infected by. Given that at any given time there are approximately n citizens present in a module and in every time interval there are m citizens leaving the module, we will have to keep track of O(n * m) interactions. This workload, however, is unbearable on the main thread of the game. To reduce this workload the main thread regularly creates a copy of the n-sized list with people present in the module (as well as their module entry times). While a separate thread now works with this copy and does the O(n * m) complexity work, the main thread’s workload is reduced to O(n). Lost updates happen when a citizen enters and leaves the same module within the time frame between two copies. The separate thread essentially will not know that this citizen was ever present in the module. Such lost updates are negligible, however, as the chance of getting infected in this short amount of time is very low. We approximate infections by assuming that every citizen is equally likely to have passed by a specific other citizen while traversing the module.
While citizens are in buildings, their script is deactivated (just like when they travel through non-focused modules). In principle the same approach as with the non-focused modules is used for infection tracking within buildings. The only difference is that we don’t assume the chances of contact between citizens to be evenly distributed, but instead differentiate between two modes. In a restaurant, for instance, this mode depends on whether the citizens in question sit at the same table or not, in offices on whether they work in the same room, in homes on whether they live in the same household etc.

Virus Infection Modifiers

Various factors modify the risk of a person catching the virus from an infected person in proximity:

  • Exposure time;
  • Distance;
  • Symptoms of the infected;
  • Does the infected wear a mask?
  • Is the person at risk vaccinated?
  • Has the person at risk recently recovered from the virus and hence has a stronger immune response?
    If yes, how many days ago?
  • What is the relation between the person at risk and the infected? Are they family, friends, or not?

Once a person is infected, they will advance once a day on the state diagram shown below. A product of multiplicative modifiers m influences the chance of worsening/recovery. The chance of transitioning from fever to RTI Light (Respiratory Tract Infection) x depends on how lethal the virus is set to be. After entering the recovery state, a person will transition every day to the next lighter symptom until they reach the symptom “None”. After those y days, the person is fully recovered. For instance, someone entering the recovery state from the fever state will have to spend y=3 days recovering.
The multiplicative modifiers determining m are:

  • How strong of an immune system does the person have?
  • Is the person vaccinated?
  • Has the person recently recovered from the virus? If yes, how many days ago?


Picture of a City