Particle Playground

From 15-10-2024 to present

This is my first real attempt at writing an interactive real-time multimaterial 2D particle physics simulation. This is a cool way to say physics sandbox game. It's based on position based dynamics and smoothed particle hydrodynamics. The simulation runs entirely on the CPU.

Inspired by OE-Cake! and The Powder Toy, I've always wanted to create a hybrid of the two. A sandbox game that simulates hundreds of thousands of particles interacting in real-time, in such a way where players are encouraged to create something interesting.

As a child I spent lots of time inside these games trying to make powerful bombs, creating & destroying boats and buildings, and being amazed at smarter people building working computers. That's what I want to replicate.

Unfortunately, the choice to make this a CPU simulation was a mistake. It's multithreaded, but I can already see that I will reach the performance ceiling much sooner than I would if this was running on the GPU. The project is a perfect match for it, so I will try again later.

Videos of the project in reverse chronological order

position-based-fluid-showcase.mp4
pbd-mass-density.mp4
pbd-two-way.mp4
pbd-my-sand-is-wrong.mp4
pbd-brush.mp4
pbd-oil.mp4
pbd-pretty-2.mp4
pbd-pretty.mp4
pbd-weird-vortices-2.mp4
pbf-constraint.mp4
weird vortices.mp4
position-based-fluid-2.mp4
pbd.mp4

Dependencies

Walgelijk
Game engine
Present