This unfortunately puts some limitations on some useful cases. For example, a smoke particle pops into existence fully opaque (since fading out over time is more important) looks kinda bad. One way around this is having an actor track which particles it has spawned and "replace" a particle with a new visual when a particle would reach end of life, but this can add considerable overhead.
A useful solution to this could be allowing predefined formulas entry for size/fade stepping, based on the age of the particle. An example pseudocode implementation:
Code: Select all
// Some actor function
{
FSpawnParticleParams SmokeParticle;
SmokeParticle.Color1 = "Gray";
SmokeParticle.Lifetime = 35;
SmokeParticle.StartAlpha = 0;
SmokeParticle.Size = 0;
SmokeParticle.FadeFormula = SPFF_FADEINOUT;
SmokeParticle.SizeFormula = SPSF_GROWSHRINK;
Level.SpawnParticle (SmokeParticle);
}
// Engine particle code
{
if (FadeFormula = SPFF_FADEINOUT) { particle.alpha = sin(age/lifetime); }
if (SizeFormula = SPSF_GROWSHRINK) { particle.size = sin(age/lifetime); }
else { particle.size += particle.sizestep; } // revert to the regular one if nothing set
}