Wow! 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/
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.
This usually solves for weird, deprecations, and routes around profoundly unfriendly browser barriers, which, sadly and admittedly are required from a security standpoint for most clueless users.
I prefer using Eclipse over IntelliJ CE, because Eclipse settings for static libraries that aren't handled by source control are a bit more concrete. IntelliJ CE is well-suited for many professional coding activities, but buries some commonly used, yet clunky settings that are right on the surface with Eclipse. Namely JRE/JDK choices, and build path settings for static jar files.
On the other hand, you might need to know a bit about Java, to do this. For most HN users, and even many gamers, this is generally not too much of a problem.
[6] It's a bit sad that all the links to Digg, Reddit, and MSNBC are broken now. And I totally forgot about the traffic behemoth that delicious was! Here's a fixed version of the Reddit link, at least the page is up, even if the URL changed: https://www.reddit.com/r/reddit.com/comments/21509/
Fantastic!
For those wondering how such a program was printed (and then had to be typed by hand from the magazine), here's a scan cap of the page in question https://imgur.com/a/Mng21o3
I was playing Sandspiel and it was bringing back vaguely positive memories of a similar game but I couldn't remember what it was or when I played it, then I saw your comment, opened falling sand game and instantly remembered the game. I must have spent so much time playing this when I was younger, it's great to have a working version again.
A 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.
Are you sure? I tried watching a few different setups for a while and the water level never seemed to change. Even applying fire directly to water doesn't have an effect.
Most falling sand game implementations are sequential, so parallelizing the simulation using a margolus neighborhood (https://en.wikipedia.org/wiki/Block_cellular_automaton) or double buffer could greatly improve performance. Most falling sand games tend to not be pure cellular automata, and some are implemented as particle systems with particle in cell grid collision instead of CA, but particle and fluid sims are easy to parallelize. I haven't seen a falling sand game (2D or 3D) that runs entirely on the GPU, and my goal was to do that, eventually ending up with some complex Claybook (https://www.claybookgame.com/) style engine.
I 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.
The Powder Toy wouldn't simulate the vacuum required for it to work. It'd get closer than most other falling sand games if you turn on water equalisation though.
Several 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.
I 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.
It'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
What'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.
I'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
This 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.
My 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.
This 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 :-(
Grow 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.
Make 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!
A 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.
Baking 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... :-(
I 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.
Have 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.
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.
This 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/
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.
This 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.
That 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
Love 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?
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.
Holy 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!
You 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.
lol 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".
I 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?
WebRender 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. :)
Not 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/ (not a guess; I've been through the source, reimplemented some in java)
It is unfortunate that you're downvoted. At one point, there was an article on HN discussing games, including what made a "game" a "game" — and one of the article's requirements was that there must exist some risk of losing. Otherwise, you're just messing around or following predefined steps towards an end, but there is no challenge. Not that that can't entertain, but plenty of things entertain that aren't games. (E.g., a movie.)
The article also discussed some weird things that existed outside of the definition that the article arrived at, such as ClickerHeros and similar "grinding" "games".
(I wish I could find a link to it. Perhaps someone else here remembers and can find it…)
Not unfortunate at all; arguing definitions is rarely useful or interesting, and "game" has dozens of worthy contenders that disagree with GP and with the article you read.
E g.: Sid Meier's famous definition: "a series of interesting decisions". (But what would he know?)
Says "arguing definitions is rarely useful"; argues a definition usefully. :-)
FWIW I asked the question because I'm designing a simulation "game" without explicit win-conditions, but I'm concerned it won't be very engaging without them. e.g. Minecraft added monsters (to survive the night), and the enderverse.
Don't get me wrong, the question of whether this or that game is better with or without win conditions is perfectly interesting. It's just the raw "is it a game or not?" that's not useful. It's like asking whether comic books are books - the answer is "yes under some definitions, no under others", simple as that.
For the case of your game[0] specifically, one option is to expose game stats that the player can form their own challenges around. E.g. if the game UI shows how many times you've jumped, that implicitly lets the player form "do X without jumping more than Y times" sorts of challenges, etc. Or the more formal way to do it is like e.g. Minecraft achievements - there's no "win condition" for putting a saddle on a pig or whatever, but the mere fact that there's a piece of UI tracking whether you've done it or not, creates a challenge by itself.
I've thought about that - and it's not that big a jump to have a GUI that allows a user to specify a win condition (and locations to traverse, other conditions etc). Then, the user can share it online. I haven't played GTA V online, but I think it does something like that.
But actually, I don't want those sort of win-conditions for this particular game, not even DIY stats. It's just an immersive simulation. Guess I'm just not too sure it WILL be immersive or engaging - even for me to play! Just have to see, I guess.
Taking your lead, I suppose if a movie can be immersive, why not a "game" which has no win-condition? But the moment I say that, I immediately realize that movies do have "win-conditions" - just of the protagonist, not the viewer/player. Goals, stakes, motivation, obstacles are all important narrative components.
Can you have an immersive movie without narrative? Sort of maybe, some experimental/arthouse, but they aren't very popular (and arguably do have some kind of narrative).
You're probably right about definitions, but they do inevitably lead to the components of a game/non-game, and whether they are engaging, and what makes them engaging... and they're easy to ask.
Many games don't have win states or shouldn't have win states. More people need to listen to what Sid Meier has said on this. That HN article was written by someone who did not know what they were talking about.
Yes, rules are needed for a game. But is it enough?
e.g. there are rules to writing a syntactically correct program; ways to drive a car; use a GUI. Does that make them games?
If a user can make a game out of them, what do they add, to make it into a "game"? Is the thing added an objective of some kind (i.e. a win condition)?
That's why I added that a game is something you "play".
I'd suggest that in order to make something into a game, the user is adding "playfulness", which is pretty subjective and may or may not include a simple goal.
In an open game or fun simulation, the player is going to be coming up with their own goals or roles of play. Or maybe they will just be going with a simple open ended goal of curious exploration.
Games 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.
Where 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.
I guess it's all just semantic but by that logic anything is a game. I can make a game from dinner. "who finishes first", "who can balance the most peas on their fork". "how many bites can you eat while balancing your chair on 2 legs" But that doesn't make "dinner" itself a game.
But whatever, people use words the way they use them. For example RPG, based on the logic of how the word is used, has almost meaning. Zelda is often called an RPG but it's got almost zero in common with say FF7 and more in common with Ratchet and Clack. And the word Role Playing Game. Well, by that logic any racing game is an RPG. I'm playing the role of a race car driver. Or FPS, I'm playing the role of a soilder. Or flight sim, I'm playing the role of a pilot. Or God Sim, playing the role of a god. RPG in actual use seems to mean "game about character with sword" at best.
The latest atrocity is "roguelike" which is applied to any game that has randomly generated levels. For example Galax-Z is called "roguelike" even though it's basically Asteroids.
The word "game" people use it interchangeably with anything you can fiddle with interactively on a computer and see some graphics change even though that describes photoshop and ms paint as well.
If Animal Crossing and The Sims are games, then so is a doll house or a bit of play dough.
I subscribe to Chris Crawford's definition. Games are competitions between multiple players and they must be able to interfere with each other. A painting, a toy, a puzzle, a race, are all not games. The difference between taking a stroll while carrying a ball and playing a game is keeping score.
The most controversial result of that is that God of War and Dark Souls are actually puzzles, and not games, and although it's unintuitive upon reflection it rings true to me.
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/
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.