+5 votes

Hi!

I would like to develop a physic-based game which requires fluid simulations (flows). I might be wrong but I didn't find an explicit way to use fluids in the documentation.

Since Godot has its own physic engine but is open source, here are the two approaches I can think of:

  • Create a large number of collision shapes (e.g. triangular) and use the Godot's embedded physic engine. There is a risk to have performance issue if too many shapes are used.
  • Use a physic engine dedicated to fluid simulations (liquidfun, a box2d extension). It would be added as a custom C++ module. In that case, two physic engines would be integrated to Godot.

If you have any suggestion, please don't hesitate!

in Engine by (17 points)

3 Answers

0 votes
by (208 points)

Thank you for the link, didn't know it (I'm quite new to game development in general). I will try this method. I need particles to be quite small to allow them to flow through pipes and therefore a quite large number of them. Hope the performances will stay good.

0 votes

If you think that worth the effort, try to add Box2D (somebody already added Bullet and is being discussed to include it in future versions), Box seems to lack of some features, you should talk with core devs about that (IRC).

May be easier to try to adapt liquidfun to the current physics engine.

Depending on the mechanics of your game, you could opt for another approach, like polygon based elements(maybe just areas, joining and separating shapes), using shaders to simulate the visual part.

ps: something like this may (or may not) be planned for 3.1, try to talk to devs, maybe you can join them.

by (7,860 points)
0 votes

While this question is a little old, I thought might just leave this here in case others see this.
https://godotengine.org/asset-library/asset/226
It's a demo project I made of Smooth Particle Hydrodynamics based Water: SPHater
It runs on purely gdscript though so there's definitely some untapped performance here.

by (3,871 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.