Simulating Plague Infection in a Strategy Game

Simulating Plague Infection in a Strategy Game

Simulating Plague Infection in a Strategy Game. Approximating probabilities from a turn-based strategy game with the binomial distribution.

Probabilities can be hard to calculate, especially in complex scenarios. One way to get around this is to turn probabilistic situations into code. By running this code many times, one can approximate the probability of a certain outcome without having to derive it directly. This is a simulation, and it’s very useful when tackling a wealth of problems.

A friend recently came to me with such a problem. Inspired while under lockdown, he was designing a mod for a turn-based strategy game which introduced disease as a game mechanic. The premise was that traders (characters in-game) travelling along a fixed route had a small chance of getting the plague with every turn they spent travelling. Once infected, they’d spread the disease to the next city they arrived in. Afterwards, they’d recover and set off on their travels again.

If you’ve ever played a game from the Civilization franchise, or anything similar, you might have a mental image of what this could look like.

On each turn in this scenario, one of two things will happen to the trader; they will either become infected, or stay healthy. If the probability of infection also stays the same throughout the length of the trader’s journey, the infection variable is therefore binomial. A binomial random variable contains the number of successes (in our case, infections) within n trials (turns in a trader’s journey) in a situation with a binary outcome.

statistics r gaming data-science simulation

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Data Cleaning in R for Data Science

A data scientist/analyst in the making needs to format and clean data before being able to perform any kind of exploratory data analysis.

50 Data Science Jobs That Opened Just Last Week

Data Science and Analytics market evolves to adapt to the constantly changing economic and business environments. Our latest survey report suggests that as the overall Data Science and Analytics market evolves to adapt to the constantly changing economic and business environments, data scientists and AI practitioners should be aware of the skills and tools that the broader community is working on. A good grip in these skills will further help data science enthusiasts to get the best jobs that various industries in their data science functions are offering.

Statistics for Data Science

Statistics for Data Science and Machine Learning Engineer. I’ll try to teach you just enough to be dangerous, and pique your interest just enough that you’ll go off and learn more.

Data Science Course in Dallas

Become a data analysis expert using the R programming language in this [data science]( "data science") certification training in Dallas, TX. You will master data...

Applications Of Data Science On 3D Imagery Data

The agenda of the talk included an introduction to 3D data, its applications and case studies, 3D data alignment and more.