Skip navigation
I've integrated fluids into my physics engine.
0:00 / 0:39

I've integrated fluids into my physics engine.

Zolden

@ZoldenGames12K followers

Visit on X
2,622 likesDownloadOriginal post

119,205 views

I've integrated fluids into my physics engine. Fluids are made of the same particles as solid matter, but computed differently. Phase change is seamless, matter melts and hardens back on temperature change. It runs fast, and world size limits are wider than any game would need.

73 Comments

Comments from the original post on X (Twitter)

  • Rendezvous Extraordinaire's profile picture

    @CharlieBal48142

    You have rediscovered Clonk (and… well, I’m grateful for that)

    22 likes

  • Zolden's profile picture

    @ZoldenGames

    I'm actually enchanted by Clonk design and mechanics and the game I'll be making might be heavily inspired by it. Though, it's not decided for sure.

    25 likes

  • Rendezvous Extraordinaire's profile picture

    @CharlieBal48142

    Please do!

    1 like

  • Bananaft's profile picture

    @Bananaft

    Finally someone will make that stupid mobile game ad about lava, gold and water a reality.

    12 likes

  • Tabot's profile picture

    @Torusaurus1

    Noita 2 confirmed?

    6 likes

  • Michal Pawlowski (Squeezed Hamster)'s profile picture

    @HamsterOnCokeX

    Is it your own engine or it runs inside a regular game engine? It's absolutely amazing.

    5 likes

  • Zolden's profile picture

    @ZoldenGames

    It runs inside Unity. Thank you!

    9 likes

  • Michal Pawlowski (Squeezed Hamster)'s profile picture

    @HamsterOnCokeX

    Is this something you're planning to release as a plugin? I'd pay quite a lot to have access to this kind of technology. Ideas for games that utilises this just kills my imagination everyday I see it 👀🥹🥰

    1 like

  • Zolden's profile picture

    @ZoldenGames

    I might release it, yes. After I make a game with it. There's so much to improve until it's really useful and convenient to make games with.

    3 likes

  • Michal Pawlowski (Squeezed Hamster)'s profile picture

    @HamsterOnCokeX

    Yeah I totally get you. And How's the simulario going? Are you planning to release Beta / demo? It clicks right buttons in me head, can't wait to give it a go 🙈

    1 like

  • Zolden's profile picture

    @ZoldenGames

    Simulario has been in R&D phase for many months, and finally I've implemented all physics features I needed. I'm currently finalizing the physics, to move to rendering for a few improvements, and then will go straight to implementing actual game design.

    1 like

  • Michal Pawlowski (Squeezed Hamster)'s profile picture

    @HamsterOnCokeX

    Sweet. I hope it will go smooth from now on. Keep us posted 🔥

    1 like

  • Jonas Tyroller's profile picture

    @JonasTyroller

    Veeery satsifying to watch already.

    4 likes

  • Alex's profile picture

    @iurkxq

    Looks awesome! Is it still Lennard-Jones or is it completely different kind of simulation? By the way do you use the standard 12-6 Lennard-Jones potential, or some simplified version of it, like just some linear attraction–repulsion (which technically isn’t Lennard-Jones)?

    4 likes

  • Zolden's profile picture

    @ZoldenGames

    It's a blend between solid material (LJ), and PIC/FLIP fluid simulation. LJ is 13-7. I don't remember why I chose it and not the default 12-6. Using linear attraction-repulsion wouldn't let particles form such stable and solid material. Though, even LJ is not ideal for 2d. It was made for 3D simulations after all.

    6 likes

  • Alex's profile picture

    @iurkxq

    Wow! I was sure you were using the term “Lennard-Jones” loosely. I was under the impression it was too stiff with such large exponents for real-time simulations. I also thought you were using springs to make materials solid. How many sim steps/iterations per frame do you run?

    3 likes

  • Zolden's profile picture

    @ZoldenGames

    16 a frame, dt is really small. But it works solid 150 fps on my 3090

    2 likes

  • Alex's profile picture

    @iurkxq

    16 is smaller than I expected, but I guess that’s because it’s running unconstrained at 150 fps? So basically we can say that "effective" iteration count per frame on 60 fps display/video is 40 (16 x 150 / 60)? i.e. dt should be 1/150/16 = 1/60/40 = 0.0004166666667

    1 like

  • Zolden's profile picture

    @ZoldenGames

    Almost correct, dt is 0.0002. When I make it 0.0004, simulation explodes

    1 like

  • proc0's profile picture

    @engineseer

    Is the physics really running on GPU (as your bio suggests?). Looks amazing.

    3 likes