Show HN: Lunar lander-type game with computational fluid dynamics
github.com
github.com
Does someone know more games then the two I mentioned in the README (Plasma Pong and Pixeljunk Shooter) with more or less realistic fluid dynamics?
> Does someone know more games then the two I mentioned in the README (Plasma Pong and Pixeljunk Shooter) with more or less realistic fluid dynamics?
A friend of mine, Thomas ten Cate, tried but eventually shelved a project to make a fluid-dynamics based game tha he called Archimedes[0]. Before he moved on to other projects he blogged about it[1]. Does that count?
There’s always the classic Liquid War:
How did you find these games?
It also seems like the physics is off. Like you're flying through molasses. There's just a lot of damping.
Finally, I think it would be more fun if the <--> rotated the ship for thrust vector control, instead of triggering lateral thrusters with no torque.
Can't remember the name...
Back in 2013 I e-mailed the original developers with some WebGL fluid dynamics demos, and asked if they'd be interested in porting Ichor to WebGL, and they were, but it died down soon after.
The Ichor source is on GitHub as well, although it doesn't have a license.
https://github.com/luqui/ichor
It would be so awesome to have this game ported to WebGL, or even just to GPU in general.
Has anyone made fluid dynamics sailing game yet?
You would need only two controls, trim and rudder (direction instead rudder might be easier to comprehend). Wrong trim and point of sail could broache or even capsize the boat. Oh, and you could add not just the winds but the sea currents and waves also.
Now I'm salivating.
You would have 3 separate 2d layers for wind, sea currents and then wave layer. The waves don't have to follow the wind, but they they could have specular reflection from the land. It would make sailing in complex archipelago or narrow choke points more realistic.
and I'll lose out of surfing!
Two 2-d planes, one for current and one for wind, and a bit of creative fakery to model sail and keel dynamics.
This could play nicely with some tuning.
I could have sworn in the developer's touch arcade interview that he mentioned having a CFD sim for this game.
I encourage you to add it to the science-based games list https://github.com/stared/science-based-games-list
Nice to hear that, BTW.
For this game - any idea to expand it? I finished 8 levels in one go, and it seems that there is a lot of potential for even more challenging currents, whirlpools, floating pieces, etc.
(Side note: mechanic-wise this game reminds me of UGH!: https://classicreload.com/ugh.html)
So at the moment my motivation for this game is to add more realistic physics for the ship (turns instead of right and left) and a level editor to learn Vue. Then just look at the other comments. You see a lot of great ideas.
But building a 13k game next year based on the Voxel Space Engine is also in my head :-)
As a side note, I am learning Vue.js right now (my motivation: brining deep learning to the browser, with nice, modular interfaces: https://inbrowser.ai/).
you should try to decouple physics simulation from your rendering code. (i.e. pass a constant/fixed dt to your simulation step). simulation should not depend on framerate.
That is, two run-throughs with very slightly different delta-t's will give different outcomes.
Also, sometimes adding an official name for each map somehow make the game look better. Nice game, I must try again because I lost all my ships in the "volcano" level.
Edit:
Putting the light to show the vertical speed in the landing pad may make more sense in universe.
Also, the buildings look very similar to the old gorilla.bas game :).
It would be nice to be able to disable the simulation in the introduction and final screen, so I can keep the page open to play later, without using too much battery.
When I designed the buildings I thought actually about "Save New York" on the C64.
"pad 5 please"
"Space Taxi" added a bit more depth to the lunar lander concept by adding multiple pads and various vector fields for gravity to act in. Some game modes would accelerate you not downwards but instead towards the center of the map, away from it or around the center in a circle some way. Quite the brain-teaser for my kid brain back then that hadn't previously been exposed to physics/maths like that.
A hardcore mode would be rotating the ship instead of it always staying upright—like in Atari's version: http://moonlander.seb.ly/
Note that this is different from the sailing suggestion below, which has all kinds of three dimensional aspects to. Purely thinking about e.g. docking where all the controls you have is thrust and rudder.
One of my favourite games growing up was Thrust on the BBC Model B. Had directional velocity and towing mechanics, which was pretty good for the time.
The D thrust gets stuck on if you press it once, and randomly the W comes on and gets stuck too.
Also, after the first ship, every additional ship starts with W and D thrusts on, permanently.
No issues in Chrome.
https://github.com/s-macke/Interplanetary-Postal-Service/#fl...
Particle-based methods like Smoothed Particle Hydrodynamics (SPH) are simpler to implement and are more intuitive than grid-based methods, but they're also harder to analyze mathematically. SPH is the method used by PixelJunk Shooter. "Fluid Simulation for Video Games" by Michael Gourlay is mostly about a different fluid technique (vortons), but does include SPH. [2]
[1]: https://www.cs.ubc.ca/~rbridson/fluidsimulation/
[2]: https://software.intel.com/en-us/articles/fluid-simulation-f...
[1] https://www.amazon.com/HTML5-Games-Novice-Ninja-Create/dp/09...
I like the idea of having to examine wind streams to plot your way through the map. This is an awesome tech demo, would be keen to see something more polished & fleshed-out.
Regarding usability: I keep getting confused by the controls: indicating where you want to go vs which thruster to use. Back in yonder days I used to play Lunar Lander on Windows (https://en.wikipedia.org/wiki/Lunar_Lander_(video_game_genre...) but there the controls indicate which rocket you're firing: down for going up, left for going right, etc.
https://github.com/s-macke/Interplanetary-Postal-Service/blo...
I guess you can read an explanation on a similar problem here: https://en.wikipedia.org/wiki/Fast_inverse_square_root
Also, like some people suggested, it'd be nice to have an option for running the game at a higher speed.
Can it run faster? This might need more roomy levels and stronger thrust, but faster speed would mean more feedback for a better feel of the physics.
Lander used to be the first game I would program when I got a new computer as a kid. I remember writing it for the TI-99/4A, Commodore 64, and the Amiga 500 (in Modula 2). Your game brings fond memories of those simpler times.
Amazing what you can do these days with the tremendous speed of computation available on modern hardware, even with the js13k constraints.
For the sake of optics I use wrong boundary conditions for the colored part of the fluid (transport equation).
The right solution would be to copy the density[]-grids and apply the wrong boundary conditions on them and then draw the image with it.
Good fun, otherwise.
It doesn't always happen for me. Here, I had to play through the game several times before I could get the bug to trigger.
Similar but to be solved programmatically is the codingame.com marslander.
https://www.codingame.com/training/expert/mars-lander-episod...
Good luck on the 2018 js13kgames competition!
I think your experience has more to do with laptops being much slower than desktops than anything do with how poor chrome is. As for "optimized enough", seems like the whole point was to put non-trivial physics in the game, and not to cheat.
This game uses fluid dynamics calculated in real time, i don't think its designed to be super optimized but rather super true to physics. Most of the time game optimization involves cheaping some of the complex calculations to be less accurate but still "good enough" see https://en.wikipedia.org/wiki/Fast_inverse_square_root for an example.
In other words you'll run into this issue any time you do anything taxing for more than 10 minutes on a mac book.
Great demo. I'd love to see this fleshed out. I think a lot of the older games had seriously good playability and deserve to be revisited.
I would recommend that in a future version the craft is actually rotated by the "air" too for extra challenge, perhaps having rockets that rotate left and right and make the downward facing rocket more powerful to compensate.
On a more technical note, I wonder if you could use a Lattice-Boltzman-based flow simulation instead of classical CFD. Could be faster depending on "grid" size.
Great, great job!
I had a blast and really enjoyed the game. :)
Any tips of what am I doing wrong?
I realized that on Chrome all the graphics were weird. No colors on the home page, I couldn't see the windows at the buildings. Maybe there is something not rendering right in Chrome.
I use Chrome Version 60.0.3112.113 (Official Build) (64-bit) on Fedora 25