Particles with collisions?


#1

Another day of thinking about possible features :smiley: Imagine particles with collisions that can interact with environment and perform some actions on contact with collision objects, for example rain: droplets splashing and ending theirs lives on diverse surfaces. Or fire stopping at objects and triggering it to burn. Or, I think, simulating fluids with them. It all looks astonishing and improves immersion through a physics :smiley: I think it is possible in Unity. Is there a way to perform such actions in Defold? Or is there a feature about adding collisions to particles? If not, what you think would be possible, most optimal solutions? Creating collisions for every particles (game objects) sounds like almost eternal computing depending on amount or am I wrong? What do you think about performing some division strategy that is about batching some amount of particles and utilize one collision object for them? As I thoroughly searched Box2D allows some fluid simulations that, I think, is based on particles - what about it?


#2

You have to do it with GOs! But it is possible… if you have seen “meatball” shaders that is possible to do with sprites and render targets. So you could make “rain on screen” shader effect for sure for example. As long as your sprite render does not add a ton of extra draw calls then you are already getting similar performance as particlefx from batching all of the sprites into a single drawcall.


#3

Yeah, this would be pretty cool. I totally agree. I wonder though what would be required from a technical perspective and on what level you could design such a system. Would it be possible to build on top of Box2D? Would you need a totally custom system? Being able to do something like in Noita (https://twitter.com/NollaGames) would likely require a custom system and not an off-the-shelf solution.

There’s http://google.github.io/liquidfun/ that could perhaps be made into an extension?


#4

Yeah, something like Noita is a peek of possibilities with particles, imo :smiley: But there are simpler simulations like those fluids simulations I mentioned that seems to be based on “metaballs”, that were mentioned by @Pkeod, or even simpler without this shape influences by the other particles.
I’m not familiar with Box2D and Defold is my first adventure with physics, so I don’t think I’m able now to create such simulations, but if someone would be interested I could try to help :smiley: