SPEED OPTIMIZATION HINTS
Designing your particle types is the most important process when trying to keep your game's performance up. If you're planning to create many effects at once within your game or want to distribute your game on slower machines, there are some things you should care about while designing particle types:

Keep particles small
Huge particles (especially when transparent) will be rendered slower than small ones. This is no effect of the engine itself (Particle Candy handles huge particles as fast as small ones). The slow part here is the screen rendering. Huge particles take much more time for being rendered to the screen and we are not sure if this depends on the way a GeForce card works or if this is caused by Blitz' internal render engine. For this reason, we added the MAXSIZE parameter to the ParticleType_SetSize( ) command. This simply stops a particle growing when it reaches a certain size, so you don't have to worry about extremely large particles. You should make use of this parameter.

Keep particle quantity low
It's quite simple: as more particles you generate, as more time Blitz will need to render them all to screen. In most cases, you will be able to decrease the emission count to a lower value without any visual difference. You should also play with the particle size and other parameters. Cleverly set particle type parameters will allow you to decrease the emission rate in most cases without loosing the visual appearance of your effect.

Get rid of particles quickly
To reduce the number of particles on screen, you should set the particle types parameters so that a particle does not 'live' longer than needed. Here are some situations where Particle Candy automatically deletes a particle or simply doesn't render it:

  • When it reaches a size of zero or below
  • When it reaches a transparency value of zero or below
  • When the particle's lifetime has exceeded
  • When the particle is out of sight (camera view)
  • When the particle has reached it's maximum number of bounces

    Keeping this in mind, you'll be able to create particles that do not stay longer on the screen, as neccessary. Give them an alpha decrease value, for example, so Particle Candy will remove them as soon as they are invisible. Or let them shrink in size, so Particle Candy will remove them as soon as their size reaches zero. Or, very simple, give them a short lifetime.


    Counting it all together, there's one golden rule to follow:
    Keep them small, use less.