4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.82k stars 848 forks source link

Extend Particle system with additional emitter/spawn types #639

Closed zatsme closed 6 years ago

zatsme commented 6 years ago

Suggestion to add to trello

At the moment particles in GDevelop are a bit limited. I suggest expanding it to allow for more emitter/spawn types, line/box, circle/oval, ring etc. Just the line/box one would allow effects like rain, snow, transport beam etc More advanced things are also available in the form of opensource JS libraries which might make the job of adding this to GDevelop easier?! https://pixijs.io/pixi-particles-editor/ can show you examples of the emitter/spawn types.

4ian commented 6 years ago

I've added https://trello.com/c/nxSQFK2T/158-extend-particle-system-with-additional-emitter-spawn-types but I'm a bit curious: have you been limited/unable to do an effect because of something that is not available right now?

Lines are already available in fact: image

The textured option allow to choose an image which virtually help to create any effect too :)

More advanced things are also available in the form of opensource JS libraries which might make the job of adding this to GDevelop easier?! https://pixijs.io/pixi-particles-editor/ can show you examples of the emitter/spawn types.

In fact, particles are already based on pixi-particles (thanks to the work of @Lizard-13!) ;) https://github.com/4ian/GDevelop/blob/master/Extensions/ParticleSystem/particleemitterobject-pixi-renderer.js#L149

Help to add more option is welcome of course :)

(Closing this as it is added to the roadmap, the discussion can continue here though)

zatsme commented 6 years ago

Yes, I did think it was pixi-particles :)

What I'm talking about is the type of emitter or spawn... We only have all particles coming from a point, whereas most systems have other options... line being one of them, allowing you to put the line at the top of the screen for example and having it spawn rain, or snow. or a circle spawn/emitter so you can easilly create something like the ring of fire (mad people on motorbikes love these :) )

In the file above from line 78 you have:-

    spawnType: "circle",
    spawnCircle: {
        x: 0,
        y: 0,
        r: objectData.zoneRadius
    }

This spawnType is what I'm talking about... We seem to be using the Circle emitter, with a radius..

With a Rectangle emitter you can do this:-

https://ibb.co/e4fCkU

From this image you can see that the options are: Point, Rectangle, Circle, Ring and Burst. Each one emits the particles in a different way and would really improve what can be done, and if we are already using this then hopefully it will not be too hard to add the extra function? :)

4ian commented 6 years ago

Oh my bad I've not understood you where talking about the emitter area :) I've updated the title of the card https://trello.com/c/nxSQFK2T/158-extend-the-particle-engine-with-additional-emitters-area-rectangle-ring :)

That would surely be useful for making new effects!

This could be indeed added as new options - should be something that someone could give a try (will need to have GDevelop.js installed though to add an option in the particle emitter object - but it's a bit of C++ that is not too hard - the rest is fully in JavaScript).