Question

I have a problem with fps while using particles. In game I have coins which uses particles.
I have tested my application on iPhone 3gs, 4, 4s, 5 and on iPad 3. FPS goes down to 30-35 on 3GS and iPhone 4. But when I stop using particles FPS goes to 50-60.
I used also CCParticleBatchNode but didn't help :( The code I used with batchNode:

CCParticleBatchNode *batchNodeParticle = [CCParticleBatchNode batchNodeWithFile:@"image.png"];
CCParticleSystemQuad *particles = [CCParticleSystemQuad particleWithFile:@"particles.plist"];
[batchNodeParticle addChild:particles];
[self addChild:batchNodeParticle];

Any suggestions?
Thanks and sorry for bad english.

Was it helpful?

Solution

Particle effects are very easy to use performance killers. Here are a few suggestions:

  • Reduce the number of particles. Usually one is tempted to start out with far too many particles. Anything above 100 should make you feel uneasy, anything above 250 should cause a mild panic attack.
  • Multiple particle effects running at the same time multiply the number of particles. 10 particle effects with 100 particles are just as bad performance-wise as a single particle effect with 1000 particles.
  • Don't use overly large textures. Most particles look fine with a 64x64 texture or even less.
  • There's no real need to provide a -hd version of the particle effect. Particles get scaled up on Retina devices and look the same automatically. The only benefit from using -hd particles is using higher resolution textures, which in 99% won't make any visual difference on Retina devices. This is because most particle effects are somewhat blurry in nature to begin with.
  • Particle batching only improves performance if you add multiple particle effects (using the same texture) to the same particle batch node.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top