7 ms·
Sandspiel – A falling sand game built in Rust and WebGL
- flaque 8y agoThis feels wayyy smoother than I remember this game being.
- deleted 8y ago[deleted]
- omani 8y agonothing happens on mobile
- sitzkrieg 8y agoWorking fine in Firefox Android
- hyperpallium 8y agoNot for me (android firefox). If webGL uses facilities not available on your GPU, it well doesn't work. That's likely it, and we've just not seeing the error message. e.g. my phone lacks float textures (i.e, to render-to-texture to output floating point calculations), so this fluid simulation doesn't work http://jamie-wong.com/2016/08/05/webgl-fluid-simulation/ http://jamie-wong.com/2016/08/05/webgl-fluid-simulation/ (not a guess; I've been through the source, reimplemented some in java)
- nixpulvis 8y agoFirefox on iOS checking in, all systems nominal.
- NextHendrix 8y agoI wasted hours on these types of games back in the flash era, people were constantly releasing new ones with more types of sand and various effects and combinations, its a shame that whole segment of internet history was deprecated along with flash, good times.
- hyperpallium 8y agoWell... castle crusher "became" angry birds... so we've got that going for us...
- deleted 8y ago[deleted]
- lostsock 8y agoI think you mean Crush the Castle :) https://en.wikipedia.org/wiki/Crush_the_Castle https://en.wikipedia.org/wiki/Crush_the_Castle
- minxomat 8y agoIt's not gone yet. One of my favorite places of this sort, andkon is still going strong after all these years. The toy category still has some of the sandbox stuff: http://andkon.com/arcade/other/toy.list http://andkon.com/arcade/other/toy.list
- glaberficken 8y agoCheck this out http://bluemaxima.org/flashpoint/ http://bluemaxima.org/flashpoint/ As long as we have the internet archive and a few awesome humans we will be fine =)
- Asooka 8y agoThis is amazing, thank you so much.
- avip 8y agoWind effect is beautiful and looks like a Julia set.
- the_other_guy 8y agoThis is the most satisfying thing I've ever seen on HN!
- glitchc 8y agoWorking in Safari on iOS 12
- lstodd 8y agoThis is great. I'm almost tempted to redo this with believable thermodynamics.
- nichochar 8y agolol the arrogance of your phrasing is weird. Just stick with the compliment, and then maybe: I think we could improve thermodynamics, not "I'm almost tempted", which sounds like "I'm a god, and could really outdo this but I'm not sure I have time since I'm SO important and busy".
- Retr0spectrum 8y agoDoesn't really come across as arrogance to me, just interest in the project.
- mannycalavera42 8y agosame
- geitir 8y agoThis is fun
- hyperpallium 8y agoIs it really a "game" if there's no goal or "win" condition? Or is it a "webtoy" or "simulation" (or... "sandbox". Think it's a sandbox).
- dleslie 8y agoSimCity
- danbolt 8y agoGames like SimCity, Animal Crossing, and Minecraft are good examples where the experience of "playing" isn't necessarily about translating the game from an "initial" state to "end" or "win" one. I think the parent comment makes a good point that if you do define games as the mentioned, this and a few other things certainly doesn't necessarily fit with the definition. Still, games are often a fill-in word for many interactive things that use a computer.
- kibwen 8y agoWhere it especially blurs the line is when the sandbox/toy is sufficiently advanced that one can invent their own games. For example, Garry's Mod is not a "game", but millions of hours have been spent playing games in it. Does the game need to impose the rules, or is it sufficient to allow the players to impose their own? If the former, then what of games that normally impose rules strictly, but include cheat codes that allow players to flexibly circumvent the rules and invent their own games? In practice, nearly every video game is all of a toy and a game and a toolkit for games and even a sport (any game can be speedrun!) simultaneously.
- hyperpallium 8y agoIf a user imposes their own rules, to make their own game, that would be a "game", just a user-defined one. Will this user-defined game need to have an objective (i.e. a win condition) to be a "game"? Or, is just making up rules, without any direction, purpose, objective or "win-condition", enough to make it a "game"?
- Tade0 8y agoYou can get some interesting effects if you put a grid of one-pixel cloners, make them clone gas and put some lava at the bottom.
- sj4nz 8y agoDrop oil on lava. The effect is worth it.
- lousken 8y agolarge size brush + seeds + flame + water is also interesting
- PavlovsCat 8y agohave you tried dust yet?
- solidsnack9000 8y agoDust and any kind of fire results in a pretty impressive explosion.
- bsg75 8y agoDust is volatile, and too much fun: https://sandspiel.club/#l9z7gueXwwTAHj6hI0Zh https://sandspiel.club/#l9z7gueXwwTAHj6hI0Zh
- jetrink 8y agoMake a lake of oil, set it aflame and then pour water on it. A small amount of water causes the burning oil to flare and spread. A large amount of water extinguishes the fire. Very cool!
- duncan-donuts 8y agoAlso try using dust instead of water!
- mindcrime 8y agoA small amount of water causes the burning oil to flare and spread. A large amount of water extinguishes the fire. Interestingly enough, while we've all been taught "never use water on an oil fire", this is actually pretty similar to real life. Generally speaking, using water on a flammable liquids fire will just spread the fire and make it worse. But if the fire is small enough and the application rate of the water is sufficient, you can sometimes extinguish such a fire with water. Note: do NOT take this as advice to ever try to extinguish a kitchen fire or something like that with water. When I talk about "application rate" above, I'm thinking of the 100+ gallons per minute you get from a 1-3/4" (or larger) handline from a fire engine. If your frying pan catches on fire, call 911 and then use a class B rated fire extinguisher, or smother the fire by putting a lid on the container. If you have any doubts whatsoever about your ability to extinguish the fire, exit the structure and let the fire department handle it.
- BenjiWiebe 8y agoFor an oil fire in the kitchen, use baking soda.
- mindcrime 8y agoBaking soda can work, but it can take quite a lot of it. Depending on how big the fire is, you might not have enough in your kitchen. It may also be packed away in a cabinet somewhere out of reach. Of course the same might be true of the fire extinguisher as well... :-(
- lousken 8y agoNot seeing vaporizing water when lava was put into it was a bit of a bummer, otherwise it's great
- dTal 8y agoA nice bit of web programming. The smoke effects look cool. Pity solids don't conduct heat - the first thing I always try and do in these is boil a pot of water. If you've never seen this kind of thing before, the canonical PC example is The Powder Toy, which is so amazing I wish there a 3D Minecraft-like version. But it's really CPU-heavy even in 2d.
- macawfish 8y agoFork it!
- dTal 8y agoI think the CPU load is just inherent to the type of program it is. It's running a fluid dynamics simulation, a thermal dynamics simulation, Newtonian gravity simulation, and discrete particle simulation all at once. If you made all that in 3D, you would have made an incredibly amazing game engine that no computer could possibly run.
- macawfish 8y agoOh, I meant to get solids conducting heat ;p
- make3 8y agoalso.. mites don't reproduce..
- deleted 8y ago[deleted]
- PavlovsCat 8y agohttps://sandspiel.club/#A6xPmAP4TSEpcwThAFSB https://sandspiel.club/#A6xPmAP4TSEpcwThAFSB erase the thingy to the right, and the planets on the left grow upwards again.
- PavlovsCat 8y agoflower pixel sort hurricane https://sandspiel.club/#7oUTxtqzUoLJTVuapqmc https://sandspiel.club/#7oUTxtqzUoLJTVuapqmc
- mlindner 8y agoMy current map set up, paused. https://imgur.com/71p1H8W https://imgur.com/71p1H8W
- pluma 8y agoTry setting a gas cloner on fire.
- napsterbr 8y agoBrings me back some good old memories from this game: https://dan-ball.jp/en/javagame/dust/ https://dan-ball.jp/en/javagame/dust/
- ullarah 8y agoThis is great, I love falling sand games. The only downfall is that the Pythagorean Cup didn't work? https://i.imgur.com/ejqBwR4.png https://i.imgur.com/ejqBwR4.png https://sandspiel.club/#cCZB5Un0exri2UajMjcu https://sandspiel.club/#cCZB5Un0exri2UajMjcu
- lhball 8y agoGot tired of all the phalic-volcanoes so I made something nice for you https://sandspiel.club/#2scDpZpyMACGp65FrkPT https://sandspiel.club/#2scDpZpyMACGp65FrkPT
- carbocation 8y agoWhat I enjoy about this one is that it's a beautiful scene... that immediately ignites when you press play :)
- city41 8y agoThousands of particles and the worst frame rate I saw on my iPhone 6 was 25fps. Impressive.
- jacobdp 8y agoAny source code for this? I'm learning rust right now and it would be really cool to see how this was made
- bytematic 8y agoIt's in the about section. Can't post the direct link from my phone, sorry!
- Impossible 8y agohttps://github.com/maxbittker/sandspiel https://github.com/maxbittker/sandspiel
- deleted 8y ago[deleted]
- Santosh83 8y agoWill activating WebRender improve framerates? Not that it needs improving anyway... just curious.
- ishitatsuyuki 8y agoWebRender is used for rendering DOM. However, as games use WebGL primarily it's unlikely WebRender will help in this case.
- pcwalton 8y agoWebRender is a mapping from CSS (and perhaps SVG and Canvas 2D in the future) to the GPU. But this game is already built on the GPU, so there's nothing for WR to do. :)
- itsjustme321 8y agoReminds me of The Powder Toy, which is great by the way, lots of fun!
- sorenjan 8y agoI wish fire or lava would make steam out of water, but I love the smoke effect. It was a really nice surprise when the rest of it was so low resolution, great combo.
- freehunter 8y agoMy wish is always to create a self-sustaining environment with clouds and rainfall but it never works...
- GistNoesis 8y agoHave you tried the "cloner" type ? I managed clouds that rain, using a cloner with ice above a cloner with fire. The cloner with fire make the ice melt which release some water which reduce the fire and help the plant grow. Once the plant below grow enough to reach the fire almost all the plant burn and the cycle begins again. You can then add mites which will eat the plants and reproduce and be almost destroyed by the cycling catastrophe yet survive thanks to the wanderers. Mites usually eat the bottom plants so sometimes for plants to start again from the ground you need to accumulate enough water to form a lake which will reach the preserved from the mites plants. Once the lake reach the plants it is consumed by them, and allow mites to have close to the ground food.
- Asooka 8y agoWind turns stone into sand though! Either make a tornado with your mouse, or a large dust explosion next to a mountain :P
- tokyodude 8y agoThis is a perfect example of why I'm still in Chrome. At least for me this runs at 60fps in Chrome on my Mac but 30-45 in Firefox. I see this often in animated sites.
- zzleeper 8y agoAnother data point: on Windows I get 60 fps on both Chrome and FF
- tokyodude 8y agoThat would arguably mean your machine is fast enough to get 60fps since the browser basically throttles to 60. So a slower machine would show the difference but an even faster machine would still show 60
- justwalt 8y agoIn my experience, FF performance is much better in Windows than in Mac or Linux, unfortunately.
- Keyframe 8y agoI get the exact opposite, interestingly enough.
- bredren 8y agoI like the smoke when you burn the fungus.
- mcnichol 8y agoThis was mesmerizing. Well done, thoroughly enjoyed it.
- mattdeboard 8y agoWeird, I was just looking at this today. Very cool project! I have a feature idea on my stack of ideas I hope to get to
- tapirl 8y agoWhat's the performance difference from a pure JavaScript version? Recently, I made a particle game which originally planned to be implemented with WASM. However, I decided to implement it with pure JS firstly. The result is some surprising that the JS version runs so smoothly that I think a WASM version is not essential any more.
- zaq_xsw 8y agoI'm interested in this too. The dev would probably have a good answer since they previously made a pure JS sand game too: https://github.com/MaxBittker/dust https://github.com/MaxBittker/dust
- hujun 8y agocreate some plants, and drop some seed on it
- chime 8y agoWow! This thread brings back some fond memories. Long ago, I came across a tiny Java applet linked on Fark to a Japanese forum post. Everyone loved it but I found it annoyingly small. It was barely 300px x 400px. I had been coding my senior thesis in Java and had recently learned how to use a Java decompiler. So I downloaded the applet, decompiled it, spent a few minutes figuring out exactly where the dimensions were setup, changed them to 960x640, compiled it all, and hosted it on my site: http://chir.ag/stuff/sand/ http://chir.ag/stuff/sand/ I'm always apprehensive about taking any credit for the Falling Sand Game because I DID NOT make it but I'm always glad to see it in the wild. First it was Fark, then a few months later Digg, then Reddit. At one point someone created a Wikipedia page linking to the enlarged version I was hosting, then it got deleted as not-notable, then someone wrote a song about FSG, then a hundred different versions of FSG popped up, many non-Java and functioning much better than the applet, then the Wikipedia page came back up. I've long stopped getting giddy emails from office slackers about how much time they waste on my site but even though I didn't really create this amazing game/toy/zen-garden, I feel lucky to have been a tiny part of the arcane pop-culture movement.
- drchickensalad 8y agoThis is easily one of the oldest and most enjoyable games I've played. Thanks for the work you've done!
- petepete 8y agoReminds me a lot of Cataclysm, a game I played loads on the Acorn Archimedes as a kid. Damn, the game's 27 years old. https://www.youtube.com/watch?v=3Byyz1Vlv8w https://www.youtube.com/watch?v=3Byyz1Vlv8w
- Freak_NL 8y agoMy, that brings back memories. I love how that video starts on the RiscOS (3?) desktop.
- faitswulff 8y ago
- anoncow 8y agoReally liked lava and fire. I don’t know why gravity doesn’t affect the blue stuff. Can you disable page swipe gestures on mobile chrome?
- jtsiskin 8y agoI get 1-2 FPS running this in Chrome on macOS Mojave.
- tokyodude 8y agoHmmm, I get 60 in Chrome on MacOS Mojave. I wonder what the difference is. Here's my about:gpu https://pastebin.com/kuf9bZjr https://pastebin.com/kuf9bZjr
- sgt 8y agoI'm getting good speeds but it seems terribly inefficient. Taking 60% CPU and now it's busy spinning up my fan. I have an i7 MBP.
- gigatexal 8y agoFun little game! 42FPS on my iPhone X, too. And best of all no excessive heat
- SlowRobotAhead 8y agoWeird, I am getting almost all 60fps on iphone8.
- EugeneOZ 8y agoremove some sand and it will be 60 fps. Other types of particles are less demanding.
- windlessstorm 8y agoSite is got down of big HN hug I guess
- Ezku 8y agoLove the performance, no trouble with 60fps. The swirly wind, fire, and smoke effects are beautiful! It’s also the only part here with which I would not know how to get started building, could anyone share their thoughts on the implementation?
- preommr 8y agoI was interested in this too so I took a dive in. The smoke effects are based on another project about Fluid simulation https://github.com/PavelDoGreat/WebGL-Fluid-Simulation https://github.com/PavelDoGreat/WebGL-Fluid-Simulation It also has a working demo with controls (it's collapsed by default I think, and kind of hard to see if you're not looking for it in the upper right hand corner). It's pretty astonishing how beautiful it is. As far as I can tell, the filters and the code isn't too complicated. I am just wondering how they got those values to begin with because that's where the real magic is. There are some references there as well. One of them links to a gpu gems page that I am pretty sure I've seen before that looks really similar to this. So it's really just incremental improvements from previous works. But this version looks a lot more polished.
- jl6 8y agoI remember watching Confetti Factory on After Dark, which I think of as a primitive precursor to this. Must have been very early 1990s. Any earlier examples?
- btschaegg 8y agoThis very strongly reminds me of a game called "Hydroxis" (or at least I think so) for the Amiga. You started with water pooling in some cavity in an otherwise static level and had to move it to a target location by means of enabling and disabling some blocking segments in the level. That was fun! I had remembered that one a decade or so ago and it turned out to be the single hardest thing I tried to find for my WinUAE collection :-(
- skykooler 8y agoThis is excellent fun. I'm kind of curious though as to why blowing wind at the dust ignites it?
- devilmoon 8y agoHoly shit, I remember playing something very similar to this for hours on end in the early 90s as a kid; it might have even been an early version of the powder toy (another user mentioned it), not entirely sure, but regardless this thread is making me go back down memory lane and now I'd love to get into the insides of a game like this one and understand how it works!
- Doxin 8y agoYou might have played one of Burning sand II, WXSand, or danbal. There's a fairly rich history of these games, but The Powder Toy basically ate everyones lunch at this point.
- ummonk 8y agoGrow some plants. Light a fire. Frantically try to put it out with water and watch helplessly as the plants grow due to water, providing more and more fuel for the growing flames, until you have an unstoppable conflagration on your hands. There must be some moral lesson to learn from this.
- KnightOfWords 8y agoPeople in flammable houses shouldn't complete the fire triangle?
- nablaoperator 8y agoReminds me of Clonk!
- pinoytvchannel 8y agoPinoy Channel tv the worldwide known stage for viewing Pinoy TV. Filipinos say in regards to this the center point of observing all Pinoy television programs of GMA system and ABS-CBN Pinoy tambayan station https://pinoy1tvhd.su/ https://pinoy1tvhd.su/
- Semaphor 8y agoLiterally unplayable, exploding gas goes through thick solid walls without even damaging the wall. Awesome game, I love the options :)
- gworf 8y agoThis is fun!
- choochootrain6 8y agoI've never played Powder Toy, but I do remember playing something called Powder Game. Are they related in some way?
- GolDDranks 8y agoThis brings to mind a game that many people here might enjoy once it gets released – Noita: a magical action roguelite where every pixel is physically simulated. https://store.steampowered.com/app/881100/Noita/ https://store.steampowered.com/app/881100/Noita/ (Disclosure: it's being developed by a bunch of my old co-workers.)
- glaberficken 8y agoMy big hope for this game is that it does not go the Spelunky way in terms of game design. In Spelunky you have all these toys that are fun to use, but the punishment for using them "wrong" just takes all the fun out of the game. I hope they can find a balance that allows you to take risks with the physics interactions without loosing your entire run.
- neves 8y agoDoes this game have any objective? I didn't get it.
- detaro 8y agono, it doesn't have an objective. It's a sandbox game.
- jasonkester 8y agoFun feature: on mobile, if you drop a bunch of lava on a bunch of fireworks, your phone gets hot. Nice work.
- ecabuk 8y agoLava cannot melt ice? :D
- t3hprogrammer 8y agoThis is awesome! A few years ago I built a more rudimentary version of a falling sand game with just Javascript and WebGL: http://ericleong.me/sand.js/ http://ericleong.me/sand.js/ I tried to embed the "scripting" language as a texture in WebGL to keep the implementation very fast (note that every pixel is a cell), but I think I worked myself into a corner. Source code here: https://github.com/ericleong/sand.js https://github.com/ericleong/sand.js
- johnisgood 8y agoI love fungus. It makes the plant grow. Pour some acid on it, it will regrow! On the other hand, fire is pretty destructive. You know what feature I miss? Fast-forwarding!
- jeffrallen 8y agoLava should make water turn to gas and blow up!
- nagyadam2092 8y agoA question to the creator: is the fungus growing respecting the rules of Conway's Game of Life? It seems very much like that. Very nice app!
- ddingus 8y agoI had fun with this. Great effects. Lava, lol. I got a lot going, 25fps Samsung Note 8, Power Saving Mode 32 fps Performance Mode
- gambler 8y agoIf you like this game, you might find this project interesting: http://tinlizzie.org/~ohshima/shadama2/live2017/ http://tinlizzie.org/~ohshima/shadama2/live2017/ http://tinlizzie.org/~ohshima/shadama2/ http://tinlizzie.org/~ohshima/shadama2/ It's a bit similar, but uses GPU and spawns millions of particles. On the other hand, it's less of a sandbox and more of a demo. You can write your own code in the browser too, but it's a bit tricky to program, because it compiles to shader language and it has some weird limitations.
- emilfihlman 8y agoThere's an off by one error on sides, fire and it's effects can go along the sides.
- techvella 8y agohttps://techvella.com/top-five-best-fps-gaming-mouse/ https://techvella.com/top-five-best-fps-gaming-mouse/
- phaedrus 8y agoSeveral years ago I wrote a falling sand game for the Parallax Propeller chip, which is an 8-core microcontroller. One core was needed to drive the video output, and I had up to 7 other cores running a simple ruleset: 1. If a sand pixel had an empty pixel below it, exchange them. 2. If more than two sand pixels are stacked but there's space to the side, kick one sand grain out to that side. These rules were enough to make the sand form simple hill shapes. All of the cores bash on the same shared memory array; rather than use locks or synchronization I just had each core start in a different column of the screen and all move left to right by columns - in theory there should be enough separation that they'd never conflict. However - and this is the part I thought interesting to post about - somehow after a few seconds or minutes the 7 cores would catch up with each other and start running in lockstep (effectively reducing the speed of the simulation to equivalent of 1 core). Barring a bug that was simply crashing cores, what I think was happening was that not every control flow path took the same number of cycles, so a core processing a column with a complex sand pattern might slow down and allow another core to catch up to it. Once two cores were operating on exactly the same data, they'd be doing the same deterministic logic on the same inputs and writing out the same result, effectively just duplicating the work in lockstep.
- shittyadmin 8y agoThe smoke and explosion effects are amazing, better than any other FSG I've tried. Very cool.
- sadjad 8y agoIt's weird, but I can't share the link on Twitter, and goo.gl shortlink doesn't work either. Does anyone have the same problem?
- miguelmota 8y agoThis is incredible. Runs flawlessly and surprisingly smooth
- spdustin 8y agoOnce I realized that pausing the FSG was a thing... https://sandspiel.club/#Mt35KuNUFTZW9ITyWDxe https://sandspiel.club/#Mt35KuNUFTZW9ITyWDxe
- Evidlo 8y agoFun, but a bit blurry.
- Kye 8y agoYou can create a little self-sustaining motion with a cloner covered in something that falls over a lake of acid. https://sandspiel.club/#IbQHF3edJmCy1dLJAWO8 https://sandspiel.club/#IbQHF3edJmCy1dLJAWO8
- mgoetzke 8y agoGreat ! Was just looking for something like this for a snow effect. I used to do something with falling snow on text for Christmas.
- ok-repl 8y agoI've always been fascinated by these simulations. Can anybody give a rough overview of how these (I guess?) fluid simulations work?
- profalseidol 8y agoIce can hold lava? btw, adding oil over lava produces a very cool smoke effect.