Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (223)
games submitted by our members
Games in WIP (813)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Struggling to get my head around the [LibGDX] Particles Editor  (Read 447 times)
0 Members and 1 Guest are viewing this topic.
Offline phunni

Senior Newbie


Exp: 17 years



« Posted 2017-08-22 14:07:33 »

First of all, let me just say: if there is a better (i.e. easier) way to do particles than using the libGDX editor and engine in Java then I'd be happy to hear about it.

I'm fairly sure I get the basic concept of particles and how to use them in libGDX using the built in particles engine.  I have a few examples of successfully rendering particles - albeit using the particles that others have created online.

However, trying to create my own particle effects using the editor is stumping me.  Up till now, I've been told "just play around and see what everything does" and I have tried that.  The problem is that I'm not really any the wiser...  If I were to get anything like what I wanted it would be more by luck than judgement and not something I've achieved thus far.

I don't know if it's relevant since it's my general ability to use the tool that's lacking, but I'm currently trying to get some small red particles (blood) to splash upwards and then fall to the floor - an effect for when a character dies. In the past I have also tried (and failed )to create a shower of sparks which would be a similar effect except, obviously, using sparks instead of blood.

Anyone who is able to clearly explain how to use this complicated looking tool or explain another approach entirely that I can actually use would earn my undying and eternal gratitude.
Offline phunni

Senior Newbie


Exp: 17 years



« Reply #1 - Posted 2017-08-24 13:05:09 »

Bump
Offline tommohawkaction
« Reply #2 - Posted 2017-08-24 13:56:17 »

I didn't really like the interface and the code implementation.. I prefer to just code my own... using the Spritebatch as a particle system is pretty fast
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dfour
« Reply #3 - Posted 2017-08-24 15:25:23 »

Hi phunni,

I have a blog which happens to have an article on the Libgdx particle editor and what each of the parameters do with a couple of examples.

Here is a list of what each of the parameters do:

2D Particle Effect Editor Properties Explained

So what are the different properties in the editor? Well they are:

    Image
        This is where we can add our own custom image to be used as a particle. Usually, the default image is fine and will be suitable for most of our effects. Sometimes you will want to add your own. For example, if you wanted a 1-UP effect to pop out of the player you can use an image with 1-UP text.
    Default
        This is to reset the image back to the default image if you changed the image previously.
    Default (Premultiplied Alpha)
        This set the image to be used to the default image and then sets the blending type. To view the difference, try using the default image with the default fire effect, then swap to the premultiplied alpha version and see what happens.
    Count
        The count is used to define how many particles there should be at any time during the effect. The two boxes set the minimum and maximum amount. If the min is 0 and the max is 0 then no particles will ever be made or drawn. If the min and max are both 10 then there will always be 10 particles drawn, if one finishes another is created to replace it.
    Delay
        The delay as expected delays the particles from being made. This is useful when you use multiple effects as you can have a fire effect which runs for about 1 second, then a smoke effect with a delay of 0.8-1.0 seconds so the fire appears to change to smoke.
    Duration
        The Duration is the value that sets how long the Effect runs. A duration of 1000 means the effect will last for 1 second.
    Emission
        This defines how the particles are spawned. If the minimum value is 5 then each second at least 5 particles will spawn. If the max is 100 then up to 100 can spawn per second. This is useful for effects like smoke which should fizzle out the longer it runs. so you can have it start or 20 particles per second and run down to 0. (This requires the duration graph to be used and will be covered later in this tutorial)
    Life
        This sets how long a particle will live for. If you set this to 1000 (1 second) the particle will last for 1 second then get removed. This is not 1 second from the start of the effect as a particle can be created at any time.
    Life offset
        This allows you to have a particle that starts part way through their life cycle. So particles that have a full life to live all the way down to particles that are just about to be killed off can spawn.
    X-Offset
        Adds an offset on the x axis to each particle. Negative values make particles spawn more to the left and positive values to the right.
    Y-Offset
        Adds an offset on the y axis to each particle. Negative values spawn more to the bottom and positive more to the top.
    Spawn
        This sets the shape of the area where particles can spawn.
    Spawn Width
        Sets the width of the spawn shape.
    Spawn Height
        Sets the height of the spawn shape.
    Size
        Sets the size of the particles.
    Velocity
        Sets the speed of the particles.
    Angle
        Sets the angle that the particles face. Only visible if velocity is set.
    Rotation
        Sets the rotation of the particle. Not very useful with the round default image.
    Wind
        Adds a force to move particles left or right to simulate the wind.
    Gravity
        Adds a force to move particle up or down to simulate gravity.
    Tint
        Colours the particles from left to right of the gradient defined.
    Transparency
        Sets the opacity of the particle over its lifetime.
    Options
        Allows you to change the properties of the Effect:
            Additive: Additive blending on/off.
            Attached: sets whether the particles move with the emitter or stay in the same place.
            Continuous: Should the effect loop or run once.
            Aligned: Particles should rotate with the emitter on/off.
            Premultiplied Alpha: Premultipled blending on/off.

If you want to learn more you can view it on https://www.gamedevelopment.blog/particle-effects-libgdx-2d/
Offline phunni

Senior Newbie


Exp: 17 years



« Reply #4 - Posted 2017-08-24 16:38:30 »

@dfour thank you - that looks most helpful.
Offline phunni

Senior Newbie


Exp: 17 years



« Reply #5 - Posted 2017-08-24 22:37:50 »

That's a very helpful tutorial - thanks very much.  Much makes sense to me now that didn't before.

It doesn't look as though there's a way to define a "floor" - apart from box2d, which would be massive overkill - so I may just have to implement the "blood splash" myself anyway.  Still a massively useful learning experience though - thanks again! @dfour
Pages: [1]
  ignore  |  Print  
 
 

 
cybrmynd (117 views)
2017-08-02 12:28:51

cybrmynd (139 views)
2017-08-02 12:19:43

cybrmynd (136 views)
2017-08-02 12:18:09

Sralse (152 views)
2017-07-25 17:13:48

Archive (619 views)
2017-04-27 17:45:51

buddyBro (730 views)
2017-04-05 03:38:00

CopyableCougar4 (1255 views)
2017-03-24 15:39:42

theagentd (1235 views)
2017-03-24 15:32:08

Rule (1213 views)
2017-03-19 12:43:22

Rule (1265 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!