Hacker News new | ask | show | jobs
by hopfog 136 days ago
As a fan of both Neal and R74n this was an unexpected collaboration!

I can highly recommend building your own falling sand simulator. It's really fun to see how such simple rules create emergent behaviors. Sand pixels try to move down, then diagonally down. Water does the same, then tries sideways.

Me messing around with it eventually resulted in a game I'm now working on full time (think Noita meets Factorio): https://store.steampowered.com/app/2764460/Sandustry/

4 comments

This is an old R74n project that has been moved, not a real collab.
Out of curiosity: Do you use a high level language (like C#) or do you have low level optimizations on (e.g. assembly level)? I imagine that there has to be some kind of map that keeps track of which pixels are "active" and need to be updated, but I wonder how do that efficiently.
Actually even higher level than that: it's all JavaScript, but it relies heavily on multithreading (see the linked Noita talk, which uses the same model). But basically:

The world is divided into chunks and the threads are processing them simultaneously in an even-odd checker pattern to avoid race conditions. When all pixels settle in a chunk it falls asleep and can be skipped altogether until an active pixel enters and wakes it up again.

this doesn't answer any questions about this game, but I found this GDC talk about Noita pretty interesting: https://www.youtube.com/watch?v=prXuyMCgbTc
Yes, that talk has been instrumental for my game. Highly recommended!
how is working with hooded horse?
Awesome. I wasn't planning on signing with a publisher but now I'm really happy that I did.
Scammer get scammed
This looks really cool. I'd love to read your dev blog if there is one?