Etheri Dev Log #5: Learning about all the types of gameplay effects and how to handle them.
- camjhill737
- Mar 17
- 2 min read
So to begin with there are 3 types of gameplay effects Instant, Duration and Infinite. Instant gameplay effects happen instantly and the effects are permanent. Duration gameplay effects make a change to an attribute for the length of the duration as specified. Infinite gameplay effects make a permanent change until the effect is manually removed.
An example scenario is having a health potion for each gameplay effect type all 3 potions will heal the character for 50 health points. The instant health potion gives you 50 hp straight away permanently. The duration potion gives you 10 hp every second for a total of 5 seconds and then after those 5 seconds the 50 hp that was given is now taken away so if the player was on 20hp and picked up the potion after the 5 seconds they will go back to 20hp. The infinite potion will give the player 50 hp until the effect is removed and then that 50hp will be removed with the effect.
The reason for these differences between instant and the other two types is because the instant gameplay effect changes the base value of the gameplay attribute whereas the other two change the current value variable.
Easy way to remember it .
Instant → Base value change → Permanent
Duration → Current value change → Temporary (fixed time)
Infinite → Current value change → Until manually removed
How I am handling application of gameplay effects.
There are two enum classes to control how effects are applied and removed:
EApplyEffectPolicy → Controls when the effect is applied (on overlap or on end overlap).
EEffectRemovalPolicy → Controls whether an effect is removed when overlap ends.

TArray<FAppliesGameplayEffect> GameplayEffectsToApply – Holds a list of effects to apply.
TMultiMap<UAbilitySystemComponent*, FActiveEffectRemovalHandle> ActiveGameEffects – Stores active infinite effects for easy removal later.
OnOverlap:
When an actor overlaps with the AEtheriEffectActor:
It checks the EApplyEffectPolicy.
If set to Apply On Overlap, it applies the effect using the target’s AbilitySystemComponent.
If the effect is infinite and the removal policy is Remove On End Overlap, it stores the effect in ActiveGameEffects.
OnEndOverlap:
When an actor ends the overlap:
It checks the EApplyEffectPolicy.
If set to Apply On End Overlap, it applies the effect.
If the effect is marked for removal (ERP_RemoveOnEndOverlap), it removes the active effect using the stored handle and cleans up the map.
ApplyGameplayEffectToActor:
Uses the AbilitySystemComponent to apply effects:
Creates an effect context with MakeEffectContext().
Builds an effect spec using MakeOutgoingSpec() with the ActorLevel.
Applies the effect to the target using ApplyGameplayEffectSpecToSelf().
If bDestroyOnEffectRemoval is true, the actor destroys itself after applying or removing the effect.
Right now I used it for creating health potions in my project. For clamping game attributes to their max value, the function PreAttributeChange was created for that so its a suitable place to do clamping. However you shouldn't make any further calculations to do certain events in your game that should be done in the function PostGameplayEffectExecute.
Comments