#Say I have various animations for death

1 messages · Page 1 of 1 (latest)

north crater
#

So why is the particle effect scheduling so critical?

silver gyro
#

If its deleted early it looks bad obviously

north crater
#

Deleted?

silver gyro
#

and the longer I keep it the longer I can't pool the resorce

#

pooled I mean

north crater
#

My first instinct is to make such a particle system that it reliably finishes in a certain timeframe

silver gyro
#

yeah that would be "set a max and don't let any effects past that", probably most efficient but feels inelegant to me

#

and sets up a potential future problem

north crater
#

If you make an effect that never takes any longer than 2 seconds, you'll know that you can always pool it after two seconds, right?

#

That seems the most obvious solution to me

silver gyro
#

thats what I mean by creates a future problem

#

or just me in a month or two when I forget that all effects need to be under 2 seconds

north crater
#

Another option is to pool it when ParticleSystem.particleCount is 0 and expand the pool if no particle systems are available

#

But for optimization reasons you probably need to keep track of all this stuff anyway

silver gyro
#

I can have it check at the end of what would be the duration and extend it if its not finished

#

by a set amount then check again

#

though that has a problem if there are any infinate particles, but that doesn't really happen right?

north crater
#

Definitely shouldn't happen

#

If the spawn particle systems have unknowably large particle counts active for an unknown amount of time, and the number of required spawns is unknown, that means you have no idea how much performance it will cost

#

I can't think of why a spawn or death particle effect should play continuously, but there's another option in that case
You could spawn the particles in world space and just move the particle system to a new position when pooling it instead of disabling it

#

But that's probably not useful in this situation

silver gyro
#

and that should be found

#

by the animator basically

#

ok for now I think ill just go with a longer duration but that is something to keep in mind thanks

north crater
#

It's not the most elegant solution but I think still the best one is to keep track of both the required duration and maximum particle count when designing the effects

#

Not intern-safe, but then again what is? 😄

#

A similar problem would arise if you need to allow users to customize the effects, in case you do need some smart automatic system for it