r/unity_tutorials • • Apr 15 '20

πŸŒπŸ”¬ Simulating Epidemics with Unity ● Complete Tutorial & Code

69 Upvotes

11 comments sorted by

5

u/GideonGriebenow Apr 15 '20

Have you seen 3Blue1Brown’s version of simulating an epidemic?

3

u/AlanZucconi Apr 15 '20

I did!

I liked the video in the tutorial!

2

u/KiritoAsunaYui2022 Apr 15 '20

Now show social distancing

2

u/AlanZucconi Apr 15 '20

I actually am, in the third part of the tutorial! 🀣 I also show how many people are being infected, as a function of how well lock down is implemented!

1

u/KiritoAsunaYui2022 Apr 16 '20

Haha I would only assume that you would move to social distancing. Excited to see that visual, keep up the good work dude!

2

u/AlanZucconi Apr 16 '20

Thank you! I expect the next post to be released in a couple of weeks (although is already available on patreon)

4

u/AlanZucconi Apr 15 '20

Hi everyone!

Two weeks ago I started a new series about epidemics, and how they can be simulated in Unity. I think this is a very important topic, because it can get people interested in a subject that is likely to save a lot of lives, in the near future.

The video you see here comes from an epidemic simulation made in Unity using the SIR model. There are quite a few games that play around the idea of how a disease can spread across the world. But simulations like this are more than just toys. They can actually be used to study diseases, and to plan for interventions.

There are three posts in the series, and the first two are already available. The second one, Simulating Epidemics, is the one with the C# code to make this simulator.

In the video, you can also see a cool chart that appears in the inspector. I had fun making my own personal library for plotting things in the inspector by simply using custom C# attributes (such as [LinePlot] public List<float> Data;).

I sincerely hope this series of articles will not only give you the tools to better understand the terminology and numbers surrounding the current pandemics. I ultimately hope it will inspire more passionate developers to proactive study and research the fascinating field of epidemiology.

πŸ§”πŸ»

5

u/burgunfaust Apr 15 '20

I've noticed that you are charging on patreon in order to download the advertised c# code. That makes this an asset much more than a tutorial.

3

u/AlanZucconi Apr 15 '20

Not really, no. The tutorial is still there, with all the code necessary to run it. It covers everything, from the Mathematics to the code. The packet is there if you prefer not to re-do it yourself.

1

u/DocRockhead Apr 16 '20

And here we see a horse, lead to water, refusing to drink.

2

u/Drunkerino Apr 15 '20

did this myself a couple of weeks ago, very fun short project