How do I reduce the particle counts during an explosion effect?

Hi

I am trying to optimize my game and was wondering how to reduce the particle counts so that PC takes less processing . Would just reducing the particle lifetime the way to go? In any other ways to reduce the particle count during a explosion?

Thanks for any pointers.

Mo [import]uid: 49236 topic_id: 19564 reply_id: 319564[/import]

I am sorry but I failed to see the difference between the 2 functions? By the way I will assume those are your functions and not PC right?

Thanks for taking the time. I cannot wait to see the difference in my game!

Mo [import]uid: 49236 topic_id: 19564 reply_id: 75534[/import]

You have to change the emission rate. We converted a high particle count effect from

function AttachExplosionLowPerformance(emitterName)  
 Particles.DetachParticleTypes(emitterName)  
 Particles.AttachParticleType (emitterName, "ExplosionSmoke", 15, 500,750)   
 Particles.AttachParticleType (emitterName, "FireballSlow", 20, 400,0)   
 Particles.AttachParticleType (emitterName, "FireballBright", 20, 400,0)   
 Particles.AttachParticleType (emitterName, "ExplosionFlash", 50, 100,0)   
  
 -- NEW: ATTACH SOUND EFFECT  
 --Particles.SetEmitterSound(emitterName, Sounds[1], 0, false, { channel = 0, loops = 0, fadeIn = 0 } )  
end  

to

function AttachExplosionLowerPerformance(emitterName)  
 Particles.DetachParticleTypes(emitterName)  
 Particles.AttachParticleType (emitterName, "ExplosionSmoke", 1, 500,750)   
 Particles.AttachParticleType (emitterName, "FireballSlow", 1, 400,0)   
 Particles.AttachParticleType (emitterName, "FireballBright", 1, 400,0)   
 Particles.AttachParticleType (emitterName, "ExplosionFlash", 1, 100,0)   
 --Particles.AttachParticleType (emitterName, "ExplosionSparks", 5, 100,100)   
  
 -- NEW: ATTACH SOUND EFFECT  
 --Particles.SetEmitterSound(emitterName, Sounds[1], 0, false, { channel = 0, loops = 0, fadeIn = 0 } )  
end  

And you will see a huge difference.
-M.Y. Developers [import]uid: 55057 topic_id: 19564 reply_id: 75530[/import]

You can see the difference better now

Particles.AttachParticleType (emitterName, "ExplosionFlash", 50, 100,0)  

to

Particles.AttachParticleType (emitterName, "ExplosionFlash", 1, 100,0)  

you have to change the emission rate. [import]uid: 55057 topic_id: 19564 reply_id: 75536[/import]

Duh! Sorry, I was looking at the post using my iPhone and could not make it the difference. I will try it and report here.

Thanks again,

Mo [import]uid: 49236 topic_id: 19564 reply_id: 75573[/import]

It is always a good practice to keep particle count as low as possible. The best (and easiest) way is to include more details into your particle images, so you won’t have to emit many particle at once.

Take a starfield (or something similar) for example: you could either use a particle image with one star per image (which would be a bad idea) or put plenty of stars onto the particle image, all with a different size. This will create the illusion of many stars, without using a high number of particles.

Have a look at the “explosion.png” that comes with the included fireworks sample. There are seven “bursts” placed on this image, all with a different size, which creates the illusion of using seven times more particles -without the need to do so.
[import]uid: 10504 topic_id: 19564 reply_id: 76355[/import]

Cool! I will look again at the examples.

In term of emission rate, is there a minimum? For instance I tried to set it at 1 as suggested by the post above but could not see anything coming out ( explosion). I had to set it at 3 or 4 I believe before I could see an explosion ( less dense effect than with the default rate )

Would you suggest worrying about the image first before playing with the emmision rate?

Finally, are the explosion images ( flares, smoke…) coming with PC yours? Is it safe to release (in term of IP) on the app store?

Thanks again for your wonderful product. My game would not have been possible without it.

Mo [import]uid: 49236 topic_id: 19564 reply_id: 76361[/import]

You can use the included particle graphics in any way you want, no worries. It might be a better choice to create your own, however, if you like to achieve an original and very unique look for your app.

The emission rate is rounded. Since you specify the emission rate per second, it will be calculated to a per-millisecond-value internally, so there may be some loss caused by math rounding. When using very low emission rates, you should consider to use one-shot emission mode (see manual, StartEmitter()) which is more precise then. [import]uid: 10504 topic_id: 19564 reply_id: 76366[/import]

Great! I did modify your images to create more unique effects.

I did not know about the one shot deal! I will try that and see. Thank you for letting me know about this feature.

Thanks for everything.

Mo

[import]uid: 49236 topic_id: 19564 reply_id: 76369[/import]