Live data from Hacker News

Show HN: Lunar lander-type game with computational fluid dynamics

github.com

21–30 of 130 posts

Re: Show HN: Lunar lander-type game with computational fluid dynamics

#22
post #16

Genuinely interesting as a game, there's potential for interesting level designs. A hardcore mode would be rotating the ship instead of it always staying upright—like in Atari's version: http://moonlander.seb.ly/

Exactly. This is at the moment nothing more than a nice technical demonstration. Actually my initial code implemented already mechanics for rotations. But then I skipped this feature for this entry. I was afraid the game gets too hard for landing.

Re: Show HN: Lunar lander-type game with computational fluid dynamics

#24

Cool! 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.

On my computer the game runs at 40 FPS. So there is still room and I can increase the timestep if you want. This game simulates the Navier-Stokes equation on a grid of the size 256x128. Four times the size would already reduce the game to 10FPS or even more. Of course you can try to rewrite it to run on the GPU. An alternative would be to use so called Smoothed Particle Hydrodynamics. This is particle and not grid based. But this technique has other drawbacks.

Re: Show HN: Lunar lander-type game with computational fluid dynamics

#26
post #24

Cool! 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.

On my computer the game runs at 40 FPS. So there is still room and I can increase the timestep if you want. This game simulates the Navier-Stokes equation on a grid of the size 256x128. Four times the size would already reduce the game to 10FPS or even more. Of course you can try to rewrite it to run on the GPU. An alternative would be to use so called Smoothed Particle Hydrodynamics. This is particle and not grid ba…

I increased the timestep by a factor of two. Have fun

https://simulationcorner.net/js13kgame/

Re: Show HN: Lunar lander-type game with computational fluid dynamics

#29
post #12

Very nice. 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.

I suspect 3D fluid dynamics gets a lot slower a lot more quickly

One could get a decent experience with "2.5D" fluid dynamics.

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.

Re: Show HN: Lunar lander-type game with computational fluid dynamics

#30
post #24

Cool! 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.

On my computer the game runs at 40 FPS. So there is still room and I can increase the timestep if you want. This game simulates the Navier-Stokes equation on a grid of the size 256x128. Four times the size would already reduce the game to 10FPS or even more. Of course you can try to rewrite it to run on the GPU. An alternative would be to use so called Smoothed Particle Hydrodynamics. This is particle and not grid ba…

The problem with higher speeds were instabilities in the numerics. So I reduced the internal time step. Never tried to increase the speed again after solving a few of those problems.
Post reply on HN