What is PathoGenic?

Welcome to PathoGenic! This is a program designed to simulate the progressive spread of multiple interacting "viral conditions" through a large population.

For example, it can model not only the exponential spread of a physical virus, but also the spread of ideas, beliefs and practices that can slow down - or accelerate - the transmission of that virus.

It can also be used to simulate the manipulation and influence of a population on a grand scale through the spread of ideas. You can simulate government actions and observe their impact on the population's behavior and condition.

Originally concieved during the 2020 Novel Coronavirus pandemic, the same mechanics can potentially be applied to a wide variety of societal, political, and epidemiological circumstances.

By clicking the "Edit Scenario" button you can modify all variables in the simulation and create a scenario as complex as you like. There is no online distribution system, but you can download your scenario onto your computer and upload it to reload it.

Important Info

As with all simulations, PathoGenic is a simplified model of real life. Some inaccuracies are to be expected.

Most importantly, remember the rule of simulations: Garbage In, Garbage Out. If you feed PathoGenic faulty data you can use it to demonstrate anything. As many of the numbers that go into an experiment are likely speculative, the result should not, on its own, be viewed as authoritative in any sense.

However, it CAN be used to test and refine theories into predictive models. If the results predicted by the engine reflect reality, it can provide evidence for (or disprove) the accuracy of the input data.

Play the PathoGenic Beta

Why PathoGenic was made

Statistical analysis of multi-faceted demographic issues is absolutely essential for understanding almost every political issue in the modern world, and while governments have access to powerful tools allowing them to run simulations and test various theoretical models, the average citizen (the average voter) does not.

This is a problem.

Never in modern history has this issue become more obvious than during the 2020 Novel Coronavirus pandemic. The spread of a virus through the global population is, comparatively speaking, one of the most straightforward and objective phenomena to model predictively. While by no means simple, it involves far fewer unknown variables than, say, the effects of immigration laws on a country's economy.

Unlike most demographic issues, where shifts tend to be gradual and rely on ambiguous and difficult-to-test variables like average skill levels, effects of culture on the psychology of a country, and memetics, the presence of a virus and correlated changes in hospitalization and death rates could be tested and recorded quite easily.

Everything from testing rates, lockdown periods and laws, vaccinations per day, the results of large-scale, placebo-controlled trials, and most importantly, the total mortality of a country in a given time period have been available to the general public - the only difficult part is sorting through the massive amounts of data available.

And that is where the problems start.

The average person does not have the time or interest in actually running through the numbers themselves, and even if they did, they lack the knowledge or tools to translate these numbers into theoretical models, let alone make predictions based on these models.

So they are pretty much at the mercy of whatever news outlet they happen to be getting their opinions from - each of which will be confounded by their own personal agendas. Even people who understood that the problem existed rarely actually understood it on an intuitive level.

Articles that present irrelevant numbers as important and ignore important ones can easily lead people into making bad decisions without even lying.

This is a huge problem that goes far beyond the pandemic itself. Every political issue, from economics to immigration to gun control to drug use to climate change involves the same kind of statistical analysis.

If the average voter can't even understand an issue when the numbers are straightforward and objective, what chance do they have of making good decisions when the variables are abstract and hard to quantify?

The importance of a model

All science begins with a theory. Some theories are simple, others more complex.

A common, simple theoretical model for predicting the results of a pandemic would include the speed at which the disease spreads through an uninfected population, the percentage of people it injures and kills, and the impact of immunity post-recovery. Given these particular values, it is possible to predict the expected impact of a disease over time.

Additional variables that can be added to the model include the impact of government restrictions on the transmission rate, the ability of hospitals to reduce the mortality rate, the total capacity of hospitals, the effectiveness of vaccination, the side effects of various countermeasures, and whether particular demographics are more or less susceptible to each existing variable.

All decision-making must incorporate as many variables as possible and predict the costs and benefits of each possible decision. They must also adjust their model if the predicted effects do not end up coming to fruition.

Without a well-described, internally-consistent theoretical model, it is not possible to do anything but guess, or simply trust the opinion of someone else. Which is what most people do. And then they become emotionally invested in those opinions.

The ideal simulator for common use

The goal of PathoGenic is twofold.

First, it should create a simulator for people to test their own predictive models for demographic issues. Users must be allowed to add in whatever variables they consider relevant, plug in the impact each variable has on every other variable, and run it.

One of the major reasons for this is because it must solve the "whataboutism" problem. Any pre-built simulator is going to provoke questions about variables not included in the initial build, such as the impact of particular demographic variables or testing inaccuracies. PathoGenic must solve this by allowing the users to add in whatever additional variables they consider important.

It must also be capable of handling very large populations. Many modern demographic issues involve one-in-a-thousand chances, which might not seem like much until you extrapolate their effects over a population of millions, at which point they become very significant. Small-scale simulations that can only handle up to a hundred people will not model these issues properly.

Finally, these models must be freely available to anyone running the simulator. If someone puts in a baseless assumption to create the results they want, this variable should be easily identified by critics.

The second purpose of PathoGenic is to turn these simulations into game scenarios. Playing a game based on demographics forces the user to analyze the data they are given and the results of their actions, in order to perform the actions needed to win.

This will force players to actually think about the data presented to them - a skill which can then be applied to real-life situations where statistical analysis is important.

This means that the simulation must be adjustable on-the-fly. The player must be given an interface that allows them to interact with the simulation as it runs.

In addition, the engine must run relatively fast. Nobody wants to play a game that takes several minutes to calculate each turn.

Finally, it must run on an ordinary computer. Not everyone has a building-sized supercomputer available. While a building-sized supercomputer could handle more complex simulations, this should be able to run adequate simulations for everyone.

The problems with existing simulators.

There are a few existing simulators for pandemics available online. Unfortunately, I have yet to find one that can handle the requirements for the project.

Online simulators tend to come in two varieties: mathematical graphs and live simulations.

The first kind uses a mathematical equation - generally pre-written - to model the expected results over time on a graph, given a particular set of values, such as the infection rate, mortality rate, and recovery time. These simulations are fast and can handle large populations, but they cannot be adjusted over time.

The second kind actually simulates each individual person. While this is the most accurate kind of simulation, the size of the population is limited heavily by the device it is running on. This approach could not model a population of millions on a regular computer.

In both cases, the simulation is generally pre-written, only allowing the user to adjust the values of each pre-defined variable. I have yet to find an online simulator that allows the user to completely create new variables from scratch.

How PathoGenic works (and caveats to this approach)

To solve these issues, PathoGenic uses a hybrid approach - treating groups of functionally identical people as single mathematical objects. Each object represents a population of individuals who all have the same set of traits, and uses a bunch of math to model how they would function if they were individuals.

This does leave PathoGenic with some peculiarities that should be addressed.

First, it treats every trait as either "on" or "off". A person is either infected or not; you cannot have a person who is half infected (unless you create a trait for "half infection"). This is not generally a core problem (just increase or decrease the impact of the trait until you have the right values), but it does mean that when plugging in the values one must be careful to compare apples to apples. I have seen many misleading articles which would use the term "injury" ambiguously, without taking into account the difference between minor and major injuries.

This also means that the PathoGenic engine has issues with traits that have long incubation time and low variability, for example, pregnancy, or government issued passes that expire after a set period of time. It can, however, handle log-normal distribution of symptom onset, which is how almost all illnesses and drugs work in reality, so that's not a huge issue. (When people talk about the "incubation time" for a disease, they mean "average incubation time"; the actual incubation time in a given case will vary.)

Second, it means that while its speed is not limited by population size, there is a soft limit on how complex a scenario can be before it starts to lag. Every independent trait roughly doubles the amount of calculations that must be performed since the simulation must divide each existing sub-population by whether or not they have the new trait; by the time there are around 10 traits the simulation will start having problems. (Mutually-incompatible traits do not cause as much of a strain since the simulation creates new sub-populations as they are needed.)

You CAN create simulations with arbitrary complexity, but you may need to let them run overnight.

Important note

This should go without saying, but like all simulations, the result of the prediction is dependant on the accuracy of this model itself. I can make a scenario about a zombie virus, that doesn't mean zombies are real.

If, however, you can demonstrate that the results of the simulation accurately reflect events in reality, it can serve as supporting evidence for your model.


Technical Details: The Meaning of terms in PathoGenic


A trait is an attribute that an individual person may or may not have.

Traits may be permanent or temporary, and may have one of several different effects, such as spreading traits to others or making a person more or less likely to be affected by another trait.

In PathoGenic, every trait is either "on" or "off". No person may have a "partial" trait.


In a disease scenario, traits may include infected, dead, immune, alert, quarantined, angry, denial, child, hospitalized, and vaccinated.


A vector is a virtual object representing the ability to "infect" a single person. You can imagine a vector as a viral particle floating randomly through the population.

Each vector may have a set of traits it may add, and a set of traits it may remove.

Each vector may also have one or more "Vector Types". Traits may make a person more or less susceptible to being infected by a particular vector typs.

Upon contact with a person, a vector will attempt to infect them. If successful, it will apply all trait-related effects associated with it.

If a vector tries to apply a trait that the person already has, or remove a trait they do not have, nothing will happen. Other trait applications and removals will still take effect.

If a vector contacts a person and fails to infect them, it will simply be destroyed.

All changes to traits in PathoGenic are mediated through vectors.

When two vectors encounter a single person at the same time, and one adds a trait while the other removes the same trait, the removal wins.


One example of a vector may be a physical virus, with vector type "virus", which adds the trait "infected" on contact. The traits "immune" or "alert" may make a person less likely to be infected by the vector type "virus".

Another example of a vector may be a government broadcast, which adds the trait "alert" on contact. The trait "denial" might make a person less likely to be infected by this vector.


A transmission releases vectors into the population, which will attempt to infect people at random.

Transmissions are created mostly by people with particular traits. For example, an "infected" person may transmit a "virus" vector each day which adds the "infected" trait.

Traits may make a person more or less likely to transmit vectors of a particular type.

Transmissions may also be created by government actions or events. More on this later.


Progression is similar to transmission, except it transmits the vector to the one who emitted them, instead of releasing them into the environment.

In every other sense, progress-type vectors function the same as other vectors. Traits may make a person more or less likely to create a progress vector of a particular type.


A person with the "infected" trait may have a chance of creating a progression vector that applies the trait "dead", and also have a chance of creating a progression vector that applies the trait "immune" and removes the trait "infected".

This will give them a daily chance of dying, a daily chance of recovering, and a chance that nothing will happen.


Vectors may have seeking behavior that makes them attracted to or repelled by people with particular traits.

Unlike infection resistance, a vector that is repelled by a person due to its seeking behavior will not be destroyed. It will continue to circulate until it encounters a person.

However, each vector will still attempt to infect one new person. If there are no preferred targets available, it will go for a less-preferred target.

The exception is if a vector has a 0% seek value for a particular trait. In this case, the vector will never attempt to infect a person with that trait, and if the vector cannot find a valid target, it will destroy itself.

Seeking behavior is only relevant for vectors released by transmissions.

Government Resources

Resources are simply numerical variables which are generally created by and used by government actions. Examples may include funding, drug doses, or hospital beds.

Resources may also be used as generic variables by custom events. They do not interact directly with the population.

Resources may be visible or hidden, and have multiple options for how they will be displayed on the graph.

Government Actions

Government actions allows the player to interact with the scenario in real-time.

Government actions take the form of sliders, checkboxes, and buttons for buying resources.

Most of the time, a government action consumes resources and either produces other resources or transmits vectors.


Unless you add phases to your scenario, all vectors will be created simultaneously. For many scenarios, this may cause unintended behavior.

A phase is a "step" in time when particular events happen. Each day, each phase runs one after another in order. Transmission and progression events associated with that phase will be created and infect their targets, then the next phase will run.


Events let you manipulate a lot of behaviors that are not handled by the base simulation. You can write your own conditional code which may have effects like displaying popups, changing resource values, and releasing vectors

Resources are very useful for complex events, since they basically function as free variables. They are also processed significantly faster than population traits. Whenever possible, I suggest using events and resources to handle calculations, using traits only when necessary.

If you want to increase a resource, you must include that resource on the second part of the equation. For example to increase funds by 10, you would have to set "funds" to "funds" + 10.

PathoGenic Controls


Use the vertical slider next to the graph to change the height of the visual part of the graph.

Click on groups in the menu to open and close them.

Click on colored boxes to show or hide their corresponding lines on the graph.

Use sliders and checkboxes to control government actions.

Click on the "News" bar to display news, and click on news items to open them (when relevant).

When the news is visible on mobile, click the small graph to return to viewing the graph.

Scenario Creation Basics

To create a new scenario, click the "Create New Scenario" on the main menu. This will bring you to the Scenario Creator.

To run the scenario, click the "Start!" button.

If you have a scenario opened, you may return to the Scenario Creator by clicking the Menu button (the gear) and then clicking Edit Scenario.

You may download the scenario to your computer at any time, and reload it by clicking "Upload". There is no server-side storage currently, you must store all scenarios on your computer.

Creating a Site

A Site is a regional location in the PathoGenic engine (a country, a city, etc.). Currently a scenario should have exactly one site. (There may be multi-site support later).

To create a new Site, click on the Sites button and then click New. This is how you will always create objects in the PathoGenic Scenario Creator. You may edit, copy, and delete objects from any object list.

Let's create a large city of one million people. Set Population to 1000000. Ignore the other options for now.

Creating a virus

Let us create a simulation of a virus that spreads through the population.

To start, open the Traits menu and create a new Trait. Set its id as "infected" and its color to red. You may also give it a title; the difference between an ID and Title is that the id will be used internally and should not be changed. You may change the Title to make it appear with a different name in menus.

Now, return to your Site and double-click (or click the "E" button) to open it. Open the Initial Local Traits menu.

There are two menus here: Initial Populations and Additional Vectors. Initial populations are for demographic info, which we are not using yet. Additional Vectors lets you infect a specific number of people in the population using vectors.

Click Additional Vectors to create a new vector.

This vector should add the infected trait to whoever it touches, so click on the Apply button and select "infected" from the drop-down menu. Let us start by infecting 10 people; set Amount to 10.

You may now run the scenario. When you click the Play button, you should see that 10 people are infected.

Since the graph displays the entire population, this will appear as a red line at the very bottom of the graph, slide the slider on the right all the way to the bottom to see smaller numbers properly.

Making the virus spread

Return to the editor and go back to the Infected trait. Let us make infected people infect others.

Click on the Transmit submenu. This will allow people with the Infected trait to create new vectors. Create a new Transmit object and, as before, make it apply the Infected trait.

The Amount will determine the number of vectors each infected person produces per day. Each vector represents the ability to infect one person. So, if you set the Amount to 1, each infected person will try and infect one more person per day, and the number of infected will double every day.

Try it out and run the scenario. You should see that on the first day you have 10 infected, on the second you have 20, on the third you have 40, and so on.

After a little while though, you will see the total infected not quite doubling every day. This is because, in PathoGenic, each trait is either active or inactive, so people who are already infected will be touched by the virus, but their status will not change.

Eventually, the entire population will be infected.

Making the virus heal

Currently, everyone infected stays infected, which is unrealistic for most diseases. Let us give infected people the ability to recover.

Open the Infected trait again in the editor and open the Progress submenu. This allows the trait to add new traits to people who have that trait, or remove existing traits. To make an infection that heals, we will give it a chance of healing itself.

Add a Progress object, but this time, instead of Applying a trait, make it Remove the Infected trait. Give it a Probability of 0.5 - this will give each infected person a 50% chance of recovering every day.

Now run the scenario.

You should see that the number of infected increases more slowly, but something is off - instead of the number of infected peaking and then dropping off like with real epidemics, it climbs to infect about 50% of the population and just stays there. What happened?

There is an oversight in our simulation - an epidemic "peaks" because people who recover generally have immunity to being re-infected. In this model, people who recover immediately become susceptible again. So the disease never peaks.

Let's fix that.

Vector Types

In order to properly make immunity work, we will need to add an Immunity trait. However, to make the immunity trait work properly, we need to give the simulator a way to identify the vectors it is supposed to block against.

Open up the Vector Types menu and add a new object. Give it an ID of "virus".

Create another Vector Type and give it an ID of "recovery".

Now, go back to the Infected Trait, open the Transmissions sub-menu, and open the +infected transmission you added before. Click the Vector Types button and add "virus". This will identify this particular vector as a virus.

Do the same with the -infected under the Progress sub-menu, but give it the vector type of "recovery".

It is generally a good idea to give all Transmissions and Progress vectors at least one vector type. Only vectors with vector types can be affected by other traits.

Adding Immunity

Add a new trait, and give it an ID of "immune". Color it blue.

We want the immunity trait to modify the chance of re-infection, so open up the Infected Mod sub-menu and add a new object.

Select "virus" from the Modify Vector Type Effectiveness and set the multiplier to 0. This means that when a virus attempts to infect a person with the Immune trait, its chance of infecting will be multiplied by 0 - meaning it will never infect a person who is immune.

Now, we want to make sure that whenever a person recovers from the virus, they become immune. Go back to the Infected trait and open up the recovery progress event. Make this same event that removes the Infected trait also add the Immune trait.

Go and run the scenario. You should see the number of people immune rise as they recover, and as the number of susceptible people in the population decreases, the number of newly infected will decrease until eventually the virus goes extinct. The disease will hit a peak and then drop off, like in a real epidemic.

Adding Mortality

Adding mortality to the simulation is fairly simple. As far as the simulation is concerned, death is just another trait that a person may possess, and may be added in the same way as any other trait.

Add a new trait with the ID of "dead", and color it dark red.

Add a new vector type with the id of "death".

Now, add a new Progress event to the Infected trait. This event should apply the Dead trait, remove the Infected and Immune traits, have a Vector Type of death, and have a probability of 0.1 - meaning that a person has a 10% chance of dying every day they are infected (a fairly deadly disease).

You can now run the scenario and see how the disease spreads through a population and kills around 150,000 people before it disappears.

Adding Doctors

Let's simulate some doctors to try and keep people from dying.

Add another trait, and call it "doctor".

Now, how to simulate doctors under the rules of the PathoGenic engine? Remember, a trait can be anything, and a vector is nothing but the ability to transmit that trait.

The premise here is, we will make a "treated" trait that reduces the probability of infection progressing to death. Then, we can create a vector allowing doctors to transmit that trait to the infected.

First, let's create the "treated" trait and color it green. To simplify and test this model, we will make the doctors perfectly effective: people will not die on the same day they are being attended to by a doctor. Give the Treated trait a Progress Mod that multiplies death-type vectors by 0.

Treatment should only make an impact for one day. To make the Treated trait go away, give it a Progress event that removes the trait Treated with a probability of 1. This means it will have a 100% chance of destroying itself each day.

Now, create a new vector type, and call it "treatment".

Then, add a Transmit event to the doctors. Make it add the Treated trait using the "treatment" vector. Let us assume that a doctor can treat 50 patients per day; give it an Amount of 50.

Finally, we must add the doctors to the city. Go to Sites and add 1000 doctors. You may do this through Additional Vectors.

Now, try running the scenario.

Well, that didn't work at all. The number of people dying barely decreased. Not only that, but on the graph, it looks like the number of people being treated was higher than the number who were sick, at least at first. What happened?

Debugging with Omniscient Mode

This is where things will get more complicated, so it's important to learn about the debugging tool. To start, click on the All-Seeing-Eye icon (that's the one in the triangle) while running the scenario to activate Omniscient Mode.

This will show you all of the sub-populations active in your scenario. After running it for a bit, you may notice that the number of people with the "treated" trait greatly outnumbers people with the infected.treated trait.

Well, of course - we didn't tell the doctors that they are only supposed to be treating infected people. They are trying to treat everyone equally, meaning that the majority of sick people weren't getting any treatment.

To fix this, we need to use Seek behavior.

Making treatment focus on the sick

Seek behavior lets vectors prioritize people with certain traits over others. Often, you will want to make vectors ignore people who have (or lack) particular traits.

Go to the "treatment" vector type and open the Seek sub-menu. Add a Seek behavior, set it to "Lacks Traits: infected" and set the multiplier to 0. This will make treatment vectors ignore anyone who is not infected.

Now run the scenario again. You should see doctors acting more logically, but they don't seem to be saving quite as many people as they should. You may notice that only a certain percentage of the infected people are being treated - usually only about half - even when there should be enough doctors.

What is the issue here?

How Order of Events works

You may have noticed that we haven't really given any rules for what order events happen in. Every day, the infection spreads, some of the infected die, some recover, and the doctors try and treat some - but what order are these effects applied?

The PathoGenic simulation has 3 stages each phase (which, up until now, is each day).

  1. All people create their vectors based on the traits they have. This includes both Transmit and Progress vectors.
  2. All vectors find their targets and infect them at the same time. Progress vectors always try and infect the person who created them. The vectors do not interact with each other at this time.
  3. All changes from the infections are applied. If the same person is infected by a vector that adds a trait and another that removes the trait, removal wins.

Until the doctors got involved, this worked out well enough - infected people released their viruses, then either died, recovered, or neither. If someone tried to die and recover on the same day, they would die, because the "recovery" vector would remove the Infected trait and add the Immune trait, and the "death" vector would add the Dead trait and remove the Immune trait - so they would wind up dead. If they were infected and recovered or died on the same day, the Infected trait would be removed. A bit messy, but functional.

But the "treatment" vectors don't know to seek out a person who was infected on the same day they were created, because they do not yet have the Infected trait during the seeking step. So people are only treated the day after they are infected, at the earliest.

More importantly, if a treatment vector attaches to an infected person on the same day that person triggered a progress vector for death, they are not protected from death until after the death vector has already affected them. So they get the Dead and Treated traits at the same time - meaning they are dead (and also being treated, but that doesn't help much).

We need to fix this.

Adding Phases

To ensure that doctors always provide treatment to infected patients before they die, we will want the order of events to happen as follows:

  1. The infection spreads
  2. Doctors give treatment to whoever is infected
  3. Untreated patients have a chance to die
  4. Surviving patients have a chance to recover

To do this, open up the Phases menu and create four Phases: "infection", "treatment", "death", and "recovery".

Now, go to the Infected trait and apply the correct phase to each of its Transmit and Progress events.

So, the transmit event that adds Infected should be in the "infection" phase, the progress event that removes infection and adds immunity should be in the "recovery" phase, and the one that applies Dead should be in the "death" phase.

You will also need to move the treatment Transmit event in the Doctor trait to the "treatment" phase.

All events not assigned a phase (like the removal of treatment) will happen at the beginning of a day, before the other phases.

Now try and run it again.

The disease doesn't seem to be spreading anymore.

By splitting up the phases, we have created an unintended consequence - since infection doubles the number of infected, and the recovery phase causes half of the infected to recover, and now recovery happens after infection now, it balances it out and the disease never spreads.

This kind of thing tends to happen when splitting events into phases. You may need to adjust your scenarios to make things work as intended.

Let's re-adjust by setting the recovery probability to 0.25 and the death probability to 0.05.

Now things work as intended - all infected people are given treatment, and none of them die until the doctors can no longer handle them.

You may also want to remove the Doctor trait during the death event, to prevent dead doctors from treating people.

Adding Government Restrictions

Government Actions allows the user to control the scenario. Let us create an action that adds restrictions to the population in order to slow down the transmission of the virus.

Open the Government Actions menu and add a new action. Call it "restrictions". Let us make it a sliding scale that goes from 0 to 100. Set the Max to 100 and the Control Type to Slider.

All Government Actions work by producing vectors - for this one, we will apply a "restricted" trait that reduces the chances of either spreading or being infected by the virus. Let us create a new Trait called "restricted".

To start, create a new Trait, called "restricted", and give it a Transmit Mod that multiplies Transmission events of the vector type "virus" by 0, and an Infect Mod that multiplies infection by transmitted viruses by 0. Since we want the Trait to disappear at the beginning of each day, give it a Progress event that removes itself with a probability of 1 as well.

Then, add a new Vector Type, called "restrictions".

We will also need to create a new phase, which occurs before the "infect" phase. If restrictions are added at the same phase they are removed, people who were restricted on the previous day will be unaffected by the restrictions applied on the current day - but they will still have the Progress event that remove the restrictions from them. This will prevent the same person from being restricted two days in a row, which is not what we want.

So, create a "restrictions" phase and put it before the "infect" phase.

Finally, go back to the restriction Government Action, and make it transmit a vector of type "restrictions" that applies the Restricted trait, in the "restrictions" phase.

Determining the Amount can be a bit tricky. The actual amount of vectors produced each day will be the player-selected value (a number from 0 to 100), multiplied by the Amount selected. If the "Broadcast" checkbox is clicked, the vectors will be multiplied by the total population - meaning that, if the current value multiplied by the Amount is 1, all people in the site will be infected. If it is 0.5, half of the people will be.

Let us make it so that the amount selected will affect that particular percentage of the population. Set Amount to 0.01 (since 0.01 * 100 is 1) and select the Broadcast option. When the value is 100, all people in the city should be affected.

Now run the scenario.

By moving the Restrictions slider back and forth, you can adjust the effective infection rate of the virus and try to keep it low enough to avoid overwhelming the doctors, preventing deaths.

Adding a Cost

To prevent the player from simply using whatever government actions they want, you may create a resource that the action consumes.

Open the Government Resources menu, then create a resource. Call it "economic health".

There are many different display options available for government resources. You can display it as a simple number, or as a percentage (with 1 as 100% by default). You may also show it as a fraction, using another resource as the denominator. It can be displayed as a value on the graph, or as a percentage, which will make it a dotted line that always occupies a certain height on the graph and does not change when you move the graph height slider.

Let's use it as a percentage. Set the initial value to 1 and both the display type and the graph type to Percentage.

Next, go to the Restrictions panel, and add a Cost. Set the resource to economic health. The cost will be multiplied by the current value of the action, and each percentage point is 0.01, so to make it drop by 1% each day when at full restrictions, set the cost to -0.0001.

But what about...

This is by no means a true-to-life scenario. Few diseases spread this quickly, few are this deadly, most do not convey 100% immunity, and treatment is rarely 100% effective. However, by modifying these variables, it is possible to model many existing diseases.

You can also use this tutorial as a springboard for adding more systems, as we have demonstrated most of the principles involved in creating a scenario using the PathoGenic engine.

What happens if we add a multi-stage illness, for example - if an infected person can progress to a more severe stage of the illness, but can infect others even at earlier stages? What if certain demographics are more vulnerable to the effects of the disease, or more prone to spreading it? What if we add vaccination into the mix, conveying immunity without the disease - and what if it comes with side effects? What if there are people spreading ideas that impact the way others interact with the virus?

By this point, you should understand the system well enough to construct your own scenarios and model all kinds of epidemics on a basic level.

But if you want to do more, read on.

Working with Events

PathoGenic includes an in-depth event-based system which allows you to incorporate custom behaviors into a scenario. Custom events have numerous possible effects and will trigger whenever their specified conditions are met.

Events may trigger a specific number of times, or you may let them try and trigger every day by setting their "Times event can fire" value to -1.

Each event has a set of conditions, and will fire when one of those conditions (or several, if they include the "required" option) is met. A condition compares two values and checks if one is greater than, less than, or equal to the other.

If an event's condition is true, it will run a number of results. These results may display news items for flavor, transmit vectors, set the value of a government resource, show and hide parts of the user interface, and trigger the scenario's victory or failure conditions.

Government resources are particularly useful for custom events. A government resource doubles up as a simple numeric variable, which means that events can use them to store data. You may hide them from the UI by clicking the "hidden" checkbox.

I strongly suggest using events and resources to handle values whenever possible, rather than traits. Adding traits significantly increases the complexity of a scenario and produces lag if you are using too many of them, while events and resources are handled much faster.

For example, in most of my scenarios, I will use events to handle hospitalization, storing hospital capacity as a resource and producing treatment vectors based on the amount of hospital beds, rather than using doctors-as-traits, as in the tutorial. Although this means that doctors will not get sick and die since they are abstracted, it frees up an extra trait to add more complexity elsewhere.

Note that, when determining a value in an event, order-of-operations is not respected. Instead, each value starts at 0 and each step has a value added, subtracted, multiplied or divided on top of the current value. So if, for example, you want to add 1 to economic health, you will need to set the resource "economic health" to {economic health + 1}.

You may print any government resource's value in a news event by surrounding the variable id in {curly brackets}.