Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

Other than the simulation itself (which is very cool) I just loved the lightning system. These are literally proper textures created with just shaders (afaict). I would've loved to see a simulation speed controller though, water takes a bit to properly settle :D Also, thanks for sharing the source code I can even make sense of it for the most part lol Joking aside, the code base is well organized; and the simulation is very elegant for something I'd have assumed to be much more complicated and sort of just "brute forcing" physics calculations type of thing. Thanks a lot for the game!

Thank you so much! I'm glad you enjoyed it.

Yes, the shading is entirely procedural. I give each cell a random number each simulation step, which is used as a seed for the randomness in the pixel shader. That shader samples a bunch of points up in a cone shape to check if they're occupied for "directional lighting", and some in a circle for checking for emission (lava and fire). Rather expensive, but a modern GPU can breeze through it anyways.

For simulation speed, I agree, but would've required some more optimized code. I could only push about a 2.5x tick rate before clogging my CPU. It's all single-threaded, (and embarassingly parallelizable) there's probably many easy wins to take still, but jams!

Specifically about water, one thing I think would help, would be to have the cells have a velocity property, so that momentum solves "piles of things" faster, rather than hoping for each layer of particles to effectively resolve one by one.

About the simulation code, that's one of the things I like about falling sand! Simple, combination-based logic causes interesting large-scale patterns. I definitely didn't come up with the idea, cellular automata and similar are a classic computer science topic.