Making Sense of Gameplay Effect Durations

What are Gameplay Effects

Gameplay Effects are part of GAS (Gameplay Ability System) in Unreal and are one of the main tools with which you can implement gameplay behaviors.

At it’s most basic level, gameplay effects can be used to modify attributes in different ways, which is incredibly useful.

Gameplay Effects can do much, much more as well, but this time I will focus on a very specific topic which is the effect Duration Policy property, as it can sometimes get confusing.

When you create a gameplay effect, you will see that in the Duration Policy property you have 3 choices: Instant, Has Duration and Infinite.

Let’s see what this actually means.

Instant Gameplay Effects

Instant Gameplay Effects are the most basic effects you can create. What I mean by them being instant is that the moment you apply them, they will do their thing and be done.

This is why if you apply the effect and try to get the handle that the ASC ( Ability System Component ) returns, that handle will not be valid ( although it will have info that the effect has been applied )

The most basic thing you can do with an instant effect is to modify attributes, and this modifications will be permanent, they will modify the Base Value of the attributes.

An example of this would be a damage effect that takes health away from you, the moment the damage is applied, the health is gone and the effect is done.

Duration Gameplay Effects

If you set the Duration Policy to Has Duration two different things will happen.

The first one is that you will get a handle of that effect when you apply it and once the selected duration is over the effect will expire.

The second is that you will see that now you are no longer modifying the base value of the attributes but instead you are modifying the Current Value.

This is because Has Duration effects are temporal effects, they are only active while the effect is active, and once the effect is gone its side-effects will be gone too.

To manage this Attributes in the Gameplay Ability System have a Base Value and a Current Value.

If you want to do a permanent change ( receive damage, or heal ) you modify the base value, if you want temporal changes ( a 5 seconds buff to strength ) you modify the current value so that the attribute can return to the correct value once the effect is gone.

This is important as you may have tons of effects applied at the same time modifying temporarily multiple things, so the base value may be really different from the current value.

In the end the important thing is that duration effects are temporal gameplay effects that only modify the base value ( this will be expanded further down as there are some exceptions )

Infinite Gameplay Effects

Finally you have Infinite duration effects. This effects are in reality the same as Has Duration effects, but they simply do not expire with time. You will need to manually remove them or for a effect condition to be met that removes them.

So in reality, more than Infinite, they are Effects that will stay here until removed.

This are useful for things like a weapon giving you a buff while the weapon is equipped, or a fire hazard that applies a debuff to you while you are inside it.

Period

I teased a little bit before that even though I said that duration and Infinite gameplay effects modify only the current value, there are some exceptions…

When you add a period to the effect that is one of those exceptions.

The moment you do this you will see that modifiers no longer apply to the current value (temporal ) but to the base value ( permanent).

The period makes it so it’s like we are applying an instant effect every tick of the period.

This is useful for things like poison or healing over time, as you would not want that all the damage the poison has done goes away the moment you are no longer poisoned ( the effect goes away, but its periodic side-effects stay )

Things to take into account

In this case I only talked about attribute modifications, but regarding some other topics, instant effects for instance can not grant tags, but duration and infinite effects can grant tags to the ASC.

All of them can have executions ( pieces of code that will run on application of the effect, or on period for duration/infinite effects. And the list goes on.

At the same time now since Unreal 5.3 I think Unreal has modular gameplay effects instead of the monolithic gameplay effects of the past, so they can be extended with tons of cool features, but this may be a topic for another entry.

Conclusion

You have seen that gameplay effects can have different duration policies ( Instant, Has Duration and Infinite ).

Depending on your needs you can use one duration policy or another to help you accomplish whatever gameplay behavior you desire.

I hope this has been helpful in making you better understand how Duration Policy works in the Gameplay Effects of the Unreal Gameplay Ability System.