Custom duration visual effects

Hey everybody, I am trying to solve quite a difficult problem and maybe you could help.

We have quite a lot of skills in our game and some of the dropped items can affect the lifetime of the skill. The question is, how does one adjust the skill’s lifetime without the effect looking all wrong?

We are trying to come up with a system so that the duration of the skill could be customizable and the effects would just adjust to it.

What we thought of now:

  1. Breaking the effect into three parts - have anticipation duration just as normal, the middle part on a loop (this is where the new custom duration would come in and set how long it will be looping), and then the finishing part, where you would have the looping part fading off. The problem with this one is, that if you have some sort of randomness in the looping part you cannot reproduce the same positions, rotations etc. in the finishing part at the dissipation will be ugly.
  2. Another way is to actually change the lifetimes of the Particle Systems with a script individually. Problem is, if you do this, most of the fading out, color over lifetime, and rotations will not make sense as they are normalized with the particle lifetime so if you would want a quick fade in at the start and the lifetime increases it will be super slow.

Aaagh, is there actually a way? I cannot wrap my head around how games like Diablo or Divinity Original Sin 2 do it. Even in League of Legends, do they just have different duration effect variations?

Has anybody encountered a similar issue? Maybe you have some suggestions and ideas?

Some technicalities: project is on Unity and I am using the Particle Systems (Shuriken) for effects.

Thanks in advance :heart:

The main issue is that in tons of these cases you don’t even know how long it will take when the effect is spawned because it is disabled based on external factors.
Using Niagara, we fixed this by replacing the default state manager with a looping state manager.

Essentially the particle spawns and triggers a timer on spawn which can be used to fade in.
Then it loops for which again the timer can be used to animate (or not) the looping part.
We then detect a disable call or allow custom disable calls which trigger a fadout timer.
On top of that we still also time age, and normalized age which can be used for animating independently of the loop animation. (to avoid having to wait until a loop is over for the fadeout we can make the loop really small and use normalized age instead.)

Works pretty well

1 Like

Unfortunately, I don’t think there is an easy way out of this problem, with the limitations that you listed :pensive:
From my point of view, you have these choices:

  1. Stick with Shuriken and make multiple versions of the effect for pre-defined timings.
  2. Stick with Shuriken and not have any randomness in the position/scale/velocity. You’ll have to align particles very carefully to avoid jarring jumps between the 3 phases of the effect.
  3. Stick with Shuriken and make 3 particle systems for 3 phases of your effect. Set up custom scripts that read the values of all of the particles at the end of one phase, and set them in the next one. There’s a chance that it would not be performant for a gameplay effect, but I’m not entirely sure (I never had to make something like this in production).
  4. Make the effects in the VFX Graph, have randomness and adjustable length of the middle phase of the effect.
1 Like

Thanks @Niels and @kuba_kuleszewicz for the answers, much appreciated. I guess nothing is ideal on Shuriken :sob: