Inspiration
The Inspiration for this project comes from this video. I thought it was super cool how algorithms could be used to visualize the actual infection process of coronavirus, so I decided to create something based on that idea.
What it does
The project is a simulation of the spread of viruses. The "people" are boids, or drone-like artificial intelligence agents. They act according to three movement principles(as mentioned later), and move in a flock-like behavior to simulate natural human interactions. The user has control over factors like rate of infection, speed of infection, survivability, and more, which have fascinating outcomes on the final simulation. The project is available via WebGL(runnable in-browser) and soon as a downloadable apk.
How we built it
The project is created in Unity, via the C# language. I found resources for implementing the actual AI for the boids here and here. The virus part of the project I came up with entirely on my own, although I learned about Unity UI with this series. This project took a total around 30 hours to make(rip sleeping schedule).
Challenges we ran into
The AI was hands-down the hardest part of the entire project. I ran into countless bugs, and even after it was working correctly, it was difficult to calibrate the alignment cohesion and separation factors. Another obstacle I faced was rotating the boid. Initially, I tried to implement mathematically the movement dampening and rotations, but the movement turned out to be jerky and really, really, confusing. Eventually, this problem was solved when I discovered unity's default transform.up and Vector2.SmoothDamp functions. Finally, there were about 2 hours spent on debugging pretty dumb bugs on Unity UI. They were eventually fixed with (too) many debug.logs.
Accomplishments that we're proud of
The accomplishment I'm most proud of is implementing the AI. It was the first time I had implemented AI without just using a library. Another accomplishment I'm happy about it getting the UI to work, because it was the first time I used some features of Unity UI.
What we learned
The number one, most important thing I learned during this hackathon is don't procrastinate. You're only procrastinating when you sleep. Apart from that, I learned about Unity UI and how boids are implemented in Unity. Finally, I learned that sometimes, when you run into bugs, it's important to not get fixated. There was one bug I was stuck on for 1 hour, and after eating dinner I debugged it in 5 minutes.
What's next for Using Boids to Simulate Virus Infection
There are many ways to expand upon this project. Some immediate things include fixing up the UI, improving the movement AI, and overall improving the project appearance. Long-term, I plan on implementing more features, such as immunity after first infection, death, effects of social distancing, natural immunity, UI for boid movement, and more... Additionally, I aim to make the simulation more accessible by publishing it for free on the google play store.
Log in or sign up for Devpost to join the conversation.