What's the best way to scroll your emitter (and the particles with it)

Hi guys, So I make a sidescrolling game that has some torches/candle that uses particles on it. If I scroll my camera I just usually move all my display objects position. If I do this with my emitters position it’ll make the particles move like it’s dragged. How can I safely scroll my emitters and particles without creating the dragged emitter ? Thanks

Hi @yanuar,

Are you using display.newEmitter() along with Particle Designer (or similar)? If so, do you want the particles to move in “lock step” with the emitter? This sort of thing can be toggled from within PD… see sub-point #5 which talks about “Grouped/Relative” in the following tutorial:

http://coronalabs.com/blog/2014/03/25/tutorial-using-particle-designer-in-corona/

Brent

Hmm… I don’t think this will solve the problem in the long run since I probably need an object that both will have the particles follow an emitter but also at the same time scroll along the scene as I move the camera.

For ex. an alien spaceship will have rocket trail on it that follows the ship’s movement but also at the same time scrolls/transform as I move along the level.

Does this scenario makes sense?

Also I noticed when I’m trying to use Particle Designer, it seems it loads a texture per particle system. Can the new EmitterObject  uses atlas/imagesheet?

I’m planning to have several particles system on my game that shows up on one scene and it seems drawing from sevreal textures will add unneeded overhead and might slowdown the game.

Is there anything I should know about how to optimize the particels in my game?

You may be able to achieve this using emitters inserted into a display group, and move the group, but you’ll need to experiment based on your intention.

Emitters cannot use image sheets, but a typical particle image should be relatively small and have no strict need to be pulled from an image sheet.

As for performance, you’ll just need to experiment. Of course particles can potentially impact the performance of any simulation if you have too many on the screen at once.

Brent

Of course particles can potentially impact the performance of any simulation if you have too many on the screen at once.

Yes of course but the question is, is having all the particle sprites from a single texture should make things faster than having smaller textures for each type of particles?

This is kinda a no win situation for me and probably other devs too:

- Particle Candy is pretty much dead with no update and the guy doesn’t even reply anything anymore (there’s someone in the forum complaining he bought it but unable to download it)

  • The new EmitterObject will only work with Particle Designer that’s gonna cost me another 75$ (and only works on Mac???) and probably have performance issue with using single texture for each particle system. I just tested, afaik, there’s no way to initialize parameters for EmitterObject without using the JSON from PD2.0 or something else.

After 4 years you think a 2D game engine should have a solution by now :( 

 

Hi @yanuar,

There should be no noticeable performance impact from particles not supporting image sheets. Once the texture(s) are loaded, they should remain in the cache and do not require being re-loaded each time a particle is generated. And, because particles are typically small (perhaps a maximum of 256x256 pixels for most applications?), the amount of texture memory that would be saved by pulling particles from image sheets would be minimal.

As for choices, you now have several choices for particles. If you don’t wish to pay for Particle Designer (or if you use Windows), then you can use RoamingGamer’s Corona-based editor. If you don’t want to pay anything, then you can use the free web-based “Particle Editor” product linked in the following post:

http://coronalabs.com/blog/2014/04/29/tutorial-corona-particle-tools-and-data-formats/

If you don’t like any of these options, you can hand-design your emitters via the JSON properties… no visual tool is actually “required” to create emitters in Corona. You can probably also download sample emitter data from around the web and tweak it.

A final option is the free “CFEffects” particle generator offered by Gymbl… totally free and open source:

http://gymbyl.com/programming/cbeffects.html

Brent

Yeah, thank you for still trying to explain everything and show me other tools.

Sorry if it’s a rant but I’ve done my research before I posted my rant yesterday. 

The list of emitter authoring tools mentioned in the blog is PD (75$ Mac only), PE for Corona SDK (30$ build for your device), the other is free but you have to convert it to the emitter params format.

You mentioned about JSON properties but there’s no documentation on the format, properties names and all. I’d love to work on my own without using any tools but documentation is so scarce and pretty much just Particle Designer advertising. All the blogs and sample mentioned using PD as if it’s the only way to do it and it seems the simplest way to do it. 

Here’s a link on the API doc on Emitter Object : http://docs.coronalabs.com/daily/api/type/EmitterObject/index.html
Here’s the description on the emitter properties : 

The following properties mirror their JSON values. For more information, consult the Particle Designer website.

Here’s a link on the API doc on how to create emitter object : http://docs.coronalabs.com/daily/api/library/display/newEmitter.html
 

Overview

This function is used to create an EmitterObject, used to display particle effects created with Particle Designer.

Syntaxdisplay.newEmitter( emitterParams )
emitterParams (required)

String. The decoded parameters as outputted by Particle Designer in JSON format.

What do you expect from me to work on? I can only see that you’re somewhat enforcing Particle Designer to make things work? What kind of information can I get from the docs?
As far as I know, there’s no documentation, articles what soever that’ll help me working without using that tool you suggested.

Btw, the other tool you mentioned Particle Editor from Roaming Games, is not even working. It’s so bad that the Corona project for it doesn’t even build on the fly because there’s a faulty file names in the folder and even after I fixed it (and some code in it), it’s still crashing when I try to save my emitter.

Good thing they gave me refund 

So I’m not going to prolong my drama here but if you say : " no visual tool is actually “required” to create emitters in Corona. __You can probably also download sample emitter data from around the web and tweak it.

Please let me know where can I find the sample code for it, where you can create emitters without tools? Afaik, all the sample codes that I found so far always use files from emitter authoring tools.

Thank you
 

Hi @yanuar,

It may be tricky to “hand design” particle effects, but it’s possible. I suggest you start with the Corona sample projects located in your application folder:

CoronaSDK > SampleCode > Graphics-Premium > ParticleEffects > *

Within those projects, you’ll find JSON files with basically all of the possible parameters. You can just adjust the values and see what happens.

I agree that our documentation on this could be clearer. Soon I will attempt to improve this and provide the acceptable value(s) or range of values for each property, for those who aren’t using Particle Designer.

Brent

Hi @yanuar,

Are you using display.newEmitter() along with Particle Designer (or similar)? If so, do you want the particles to move in “lock step” with the emitter? This sort of thing can be toggled from within PD… see sub-point #5 which talks about “Grouped/Relative” in the following tutorial:

http://coronalabs.com/blog/2014/03/25/tutorial-using-particle-designer-in-corona/

Brent

Hmm… I don’t think this will solve the problem in the long run since I probably need an object that both will have the particles follow an emitter but also at the same time scroll along the scene as I move the camera.

For ex. an alien spaceship will have rocket trail on it that follows the ship’s movement but also at the same time scrolls/transform as I move along the level.

Does this scenario makes sense?

Also I noticed when I’m trying to use Particle Designer, it seems it loads a texture per particle system. Can the new EmitterObject  uses atlas/imagesheet?

I’m planning to have several particles system on my game that shows up on one scene and it seems drawing from sevreal textures will add unneeded overhead and might slowdown the game.

Is there anything I should know about how to optimize the particels in my game?

You may be able to achieve this using emitters inserted into a display group, and move the group, but you’ll need to experiment based on your intention.

Emitters cannot use image sheets, but a typical particle image should be relatively small and have no strict need to be pulled from an image sheet.

As for performance, you’ll just need to experiment. Of course particles can potentially impact the performance of any simulation if you have too many on the screen at once.

Brent

Of course particles can potentially impact the performance of any simulation if you have too many on the screen at once.

Yes of course but the question is, is having all the particle sprites from a single texture should make things faster than having smaller textures for each type of particles?

This is kinda a no win situation for me and probably other devs too:

- Particle Candy is pretty much dead with no update and the guy doesn’t even reply anything anymore (there’s someone in the forum complaining he bought it but unable to download it)

  • The new EmitterObject will only work with Particle Designer that’s gonna cost me another 75$ (and only works on Mac???) and probably have performance issue with using single texture for each particle system. I just tested, afaik, there’s no way to initialize parameters for EmitterObject without using the JSON from PD2.0 or something else.

After 4 years you think a 2D game engine should have a solution by now :( 

 

Hi @yanuar,

There should be no noticeable performance impact from particles not supporting image sheets. Once the texture(s) are loaded, they should remain in the cache and do not require being re-loaded each time a particle is generated. And, because particles are typically small (perhaps a maximum of 256x256 pixels for most applications?), the amount of texture memory that would be saved by pulling particles from image sheets would be minimal.

As for choices, you now have several choices for particles. If you don’t wish to pay for Particle Designer (or if you use Windows), then you can use RoamingGamer’s Corona-based editor. If you don’t want to pay anything, then you can use the free web-based “Particle Editor” product linked in the following post:

http://coronalabs.com/blog/2014/04/29/tutorial-corona-particle-tools-and-data-formats/

If you don’t like any of these options, you can hand-design your emitters via the JSON properties… no visual tool is actually “required” to create emitters in Corona. You can probably also download sample emitter data from around the web and tweak it.

A final option is the free “CFEffects” particle generator offered by Gymbl… totally free and open source:

http://gymbyl.com/programming/cbeffects.html

Brent

Yeah, thank you for still trying to explain everything and show me other tools.

Sorry if it’s a rant but I’ve done my research before I posted my rant yesterday. 

The list of emitter authoring tools mentioned in the blog is PD (75$ Mac only), PE for Corona SDK (30$ build for your device), the other is free but you have to convert it to the emitter params format.

You mentioned about JSON properties but there’s no documentation on the format, properties names and all. I’d love to work on my own without using any tools but documentation is so scarce and pretty much just Particle Designer advertising. All the blogs and sample mentioned using PD as if it’s the only way to do it and it seems the simplest way to do it. 

Here’s a link on the API doc on Emitter Object : http://docs.coronalabs.com/daily/api/type/EmitterObject/index.html
Here’s the description on the emitter properties : 

The following properties mirror their JSON values. For more information, consult the Particle Designer website.

Here’s a link on the API doc on how to create emitter object : http://docs.coronalabs.com/daily/api/library/display/newEmitter.html
 

Overview

This function is used to create an EmitterObject, used to display particle effects created with Particle Designer.

Syntaxdisplay.newEmitter( emitterParams )
emitterParams (required)

String. The decoded parameters as outputted by Particle Designer in JSON format.

What do you expect from me to work on? I can only see that you’re somewhat enforcing Particle Designer to make things work? What kind of information can I get from the docs?
As far as I know, there’s no documentation, articles what soever that’ll help me working without using that tool you suggested.

Btw, the other tool you mentioned Particle Editor from Roaming Games, is not even working. It’s so bad that the Corona project for it doesn’t even build on the fly because there’s a faulty file names in the folder and even after I fixed it (and some code in it), it’s still crashing when I try to save my emitter.

Good thing they gave me refund 

So I’m not going to prolong my drama here but if you say : " no visual tool is actually “required” to create emitters in Corona. __You can probably also download sample emitter data from around the web and tweak it.

Please let me know where can I find the sample code for it, where you can create emitters without tools? Afaik, all the sample codes that I found so far always use files from emitter authoring tools.

Thank you
 

Hi @yanuar,

It may be tricky to “hand design” particle effects, but it’s possible. I suggest you start with the Corona sample projects located in your application folder:

CoronaSDK > SampleCode > Graphics-Premium > ParticleEffects > *

Within those projects, you’ll find JSON files with basically all of the possible parameters. You can just adjust the values and see what happens.

I agree that our documentation on this could be clearer. Soon I will attempt to improve this and provide the acceptable value(s) or range of values for each property, for those who aren’t using Particle Designer.

Brent