In this trying time, it is very unfortunate to see the multitude of misinformation online surrounding the SARS-COV-2 coronavirus and the policies to contain it, ranging from injection of unauthorized drugs to anti-lockdown protests. Nonetheless, accurate mathematical models by researchers prove the importance of these strict measures imposed by the government, such as mass testing, quarantine and lockdown orders. In light of this, we developed a customizable game incorporating realistic simulations allowing players to independently understand the effect of these measures on the spread of COVID-19, namely mass testing, quarantine and societal lockdown. Furthermore, with the budget constraints and the interactive nature of the game, this fast-paced strategy game is also a source of entertainment to help us kill some time, while alleviating our stress and anxiety in this global lockdown era.

What it does

A mobile/desktop game where the player(the "government") tries to contain the spread of the virus given limited resources. The game is initiated with a single character infected. Uninfected characters staying within a certain radius from the infected character for a certain period of time has a certain probability of being infected. The player's actions include: testing characters for whether they carry the virus, isolating players/groups, etc. All player actions come at a cost. The player's aim is to keep the total infections/deaths below a certain number using a limited budget.

The game begins with all the characters set into motion uninfected. Then, the first infected character, patient zero, is randomly selected. However, there will be a delay between the infection of patient zero and its detection by our player, due to the initial incubation period. During this period, the virus can transmit between characters by the following mechanism

If an uninfected character comes within a certain transmission radius, there will be a probability that the uninfected character will be infected. If this character becomes infected, it will in turn become a virus carrier.

At the same time, an infected character also experiences a probability per unit time of recovering. If recovered, he then becomes immune to the virus. On the flip side, there's also a probability of the infected character dying, in which case he would just be removed from the game and the death count will be updated.

To contain the spread of this virus the player needs to make decisions, which in turn costs money. The game begins with an initial budget. To mimic economic output, this value is designed to increase over time. With this currency, the player can choose to perform any of the 3 available actions: Mass testing, quarantine and lockdown. Each of these actions has its own cost, and if the player has insufficient currency for an action, the game will prevent he/she from choosing that particular action.

If a character has only been infected for a duration shorter than the incubation period, the game will continue displaying its status as uninfected, but it can go around infecting other characters. The testing action on the bottom left helps the player by conducting a mass testing to reveal all infected characters, including those in the incubation period. This costs $500. After determining the virus carriers, the player would want to isolate these characters at a cost of $100 per character using the quarantine action. A quarantined character will only be returned to the game after a minimum amount of time only if it has recovered. Characters can still die in quarantine. The lockdown action, which costs a hefty $5000, freezes the characters in place for a fixed period of time for the player to quickly make necessary actions such as testing and quarantine, but infections can still spread during lockdowns.

How we built it

For the prototype, as a simple python program utilizing the game-design package PyGame and GUI package PyGame-GUI, our game features a retro minimalistic design to provide an easily navigable user interface.

By simulating the motion of each character, we keep a real-time track of infected and uninfected characters. Uninfected characters within a certain distance from uninfected characters experience a probability per unit time of being infected. At each frame, newly infected characters are identified, infected characters are checked for death and recovery. Then, arrays describing the status of characters, such as duration since being infected, duration in quarantine, dead/susceptible/recovered are updated correspondingly. Player input obtained through pygame interface is then used to make necessary adjustments to the state of the game.

Challenges we ran into

Since this is our first time collaborating on a coding project on GitHub, the collaboration process turned out to be rather chaotic in the beginning as each of us tried to commit changes to the same file separately/ (Turns out it doesn’t work as well as google docs...) Additionally, game design collaboration online can be quite a problem, given the limitations of game design packages that are usable for everyone. While large-scale game design software such as Unity will produce a much more polished product, installing the software for all users and sharing files through such platforms will in turn be tough.

Although we were initially ambitious at the brainstorming stage, we quickly realised that time was extremely limited and we could not possibly implement all the features that we had in mind. Therefore, we had to choose the most important features that we want to implement in order to finish the basic prototype of the game.

Accomplishments that we’re proud of

For all that said, the game eventually included many realistic features, such as immunity after recovery, probabilistic transmission, incubation period with asymptomatic spread, and random movement of character, yet at the same time proved to be challenging and fun but not impossible when we played it ourselves.

What we learned

From the trial rounds that we ran, it was obvious that societal lockdown will not be effective if the vectors of infection still stay within the general population. Therefore, any lockdown or social distancing measures must be accompanied with active quarantine effort to separate the infected with the susceptible population in order to break the chain of transmission.

Furthermore, we realized that changing the incubation period (with asymptomatic spread) will drastically change the course of virus transmission: without asymptomatic spread, quarantining effort is much more effective as we can effectively remove the virus source from the population. This is perhaps one of the main reasons why COVID-19 pandemic is at a much larger scale than SARS or MERS.

What's next for Corona in a Box by yfc

To spice the game up, there are a few potential features worth mentioning that have yet to be included into our prototype. Firstly, a contact tracing action can be implemented, which allows the player to find everyone who has entered the infection radius of any infected person before. The player then has the option to quarantine all these previous contacts.

We can also implement a 'social distancing' option which ensures a minimum distance between each person to decrease the chance of transmission. Other parameters such as masks and personal protective equipment (PPE) can also be added to vary the probability of transmission.

Additionally, we can also implement multiple clusters along with inter-cluster movement to better simulate daily commutes or even international travel. In fact, we can split the clusters into work, home, school, and hospitals for a more accurate simulation.

Existing parameters, namely the death probability, infection probability, recovery probability, can also be made dependent on more parameters. For example, we can track a hospital capacity parameter and give players the option to expand it at some cost. This is rather critical in mitigation of COVID-19 as the fatality rate varies drastically among different countries from 0.1% to 15% (among tested cases) due to the overwhelming healthcare system.

We can also introduce population demographics which determine the susceptibility of the in-game characters, such as age and pre-existing conditions, both notable risks in the case of COVID-19.

With all these potential in mind, we can hope to expand our prototype into a stimulating and engaging game with varying difficulty levels and clustering landscapes that at the same allows the players to gain independent insight into the effectiveness of control measures through the various parameters introduced in our game, Corona in a Box by yfc.

Built With

Share this project: