Quantum World

Quantum World

A simplistic simulation of quantum mechanics

Source Code: https://github.com/VatsaDev/QuantumWorld
Project: https://vatsadev.github.io/QuantumWorld/

Last month, I started working on a project, that I called Quantum World. If any of you have ever watched Kurzgesagt, you know they show amazing video game concepts/mockups in many of their videos, like the Dyson sphere video.

I thought about making my little simulation of the quantum realm, in a Kurzgesagt Isometric style.

Getting started

I first started by replicating my Phaser 3 boilerplate off Github: https://github.com/VatsaDev/phaser-boilerplate. After that, I took off to Figma and replicated a tile similar to the Kurzgesagt ones, then made it a full map in tiled. I chose a deep purple color to represent a true vacuum for the fundamental particles

After that, I added a simple physics group for my first particle, Gluons.

Fundamental particles

Most of the fundamental particles have similar properties in the simulation, they all start with a randomized velocity and are draggable, they collide with each other, except gluons and electrons, who interact with no one, but do overlap. Some particles, like Photons, Protons and Neutrons have gravity falling set to true and speed up as they move along, adding speed to the simulation if it slows down.

Challenges

The biggest challenge of them all was the 6 way overlap between quarks and gluons that allowed the formation of protons and neutrons. I honestly had no idea how to implement a 6-way overlap between three groups, so I hoped stack overflow would help me, and it did! Stack Overflow user Winner_Joiner came up with the solution of Quark-gluon-quark chains in a nested overlap detection, and I edit that to work for three groups, and now you can combine quarks and gluons to form protons and neutrons

Another issue I faced was that if you wanted to drag particles, you had to grab them, and many of your particles would be moving far too fast to click. So I implemented a simple stopping circle around the mouse, which easily lets you grab particles.

Future Updates?

I will probably be adding at least one more update to this project, implementing user feedback, implementing functions for the other quarks, adding Muons and Tau, some particle VFX on forming protons and neutrons, and maybe the ability to form the hydrogen atom.