Particle System Features?

Hello!

I needed a 2D Game Engine with a particle system that features:

  • Particle collision
  • Sub Emitters
  • Changing color / size / speed over time, but not merely “size”. I need to stretch the particles’ along the X and/or Y axis freely.
    So far I’m using Unity with the PhantomParticle asset, but I found the performance of that set to leave something to be desired. Does anyone out there know if Defold’s particle system got me covered? So far I’ve only found particle systems that change the particle size uniformly :frowning:

Defold’s built in particle system doesn’t allow what you want.

What’s your use case? Bullets? You could code whatever you are wanting to do directly.

Bullets yeah, but also explosion effects, portals, trails, etc.

All the effects seen in this video use those techniques heavily:

Notice the explosion effects on the enemies? they are made by circle-shaped stretched particles stretched along the Y axis and with random rotation, which are un-stretched back to normal shape during their lifetime. The leveling up effect (at 1:21) is done using the same technique in reverse.

The bullets have 2 sub-emitters, one for the glow, and another for the trail.

Making these kinds of effects in Defold would be possible, but you would need to code some things yourself. You could mix some normal Defold particles with custom coded objects either with their own personal scripts or (better) handled by a bullet manager which can then reuse objects and define the behavior of bullets over time. You could do simple collision detection hand coded based on positions in the manager, or use the Defold built in box2d collision system. Many options possible, but it is possible to do what you want with some extra work.

I agree to what pkeod wrote.
You can achieve a lot without using particles for everything.

For example, your bullets can be normal gameobjects. You can then attach the glow- and trail particle systems to that object and they will follow it and should behave like the sub-emitters you mentioned.

Using gameobjects instead of particles will also allow for collisions between them. My current game runs much more bullets, effects and enemies compared to the video without performance issues even on mobile while using zero particles.

The only thing of the mentioned ones which could be hard to achieve with defold is probably the non-uniform particle scaling. I haven’t used the particle system so far, so i can’t tell if this is supported.

But if not (i suggest just trying it) you can either achieve this effect with some coding like pkeod suggested, or by creating a few flipbook-animations instead of a particle system which could give enough illusion of randomness.

But i guess the most time-saving advice i can give you is to think if you really need exactly this type of effect. When you need the stretching for explosions only there should be hundreds of other techniques to achieve cool ones.

One method which could be sufficient is to simply create your particle pre-stretched and look if you really need the over-time unstretching. Or if it looks good enough to scale this pre-stretched particle uniformly while fading it’s alpha to zero.