Course contentsShow
← Unreal Engine Game Development
Lesson 647 of 8809. Gameplay Ability System (GAS)Free lesson

Configuring Gameplay Effect Stack Counts

Understand how to implement stacking logic to allow multiple instances of the same effect to accumulate or refresh duration on attributes.

In this lesson, you will learn how to configure the Gameplay Ability System to handle multiple instances of the same effect through stacking, allowing you to scale attributes dynamically.

The Logic of Stacking

When applying a UGameplayEffect, you don't always want a new instance to overwrite the old one or simply add its magnitude independently. Stacking allows you to group multiple applications of the same effect into a single "stack count." This is essential for mechanics like "poison damage that gets stronger with each hit" or "armor buffs that increase with every stack."

To configure this, you open your GameplayEffect asset and look under the Stacking section in the Details panel.

Stacking Policy

The core of this logic lies in the Stacking Type property:

  • None: The effect does not stack. Each application is treated as a separate entity.
  • Aggregate by Source: If the same actor applies the effect multiple times, the stack count increases.
  • Aggregate by Target: Every time the effect is applied to the target—regardless of who applied it—the stack count increases.

Refresh and Overflow

Once you select an aggregate type, you must define how the stack behaves when it hits its limit:

  • Stack Limit Count: The maximum number of stacks allowed.
  • Stack Expiration Policy: Determines what happens when the duration runs out. You can choose to Clear Entire Stack (the effect ends completely) or Remove Single Stack (it effectively degrades one tier at a time).
  • Stack Duration Refresh Policy: If you re-apply the effect while stacks exist, you can choose to Refresh Duration (resetting the timer for all stacks) or Never Refresh (the original duration timer persists).

Practical Example

If you are designing a "Burning" effect, you might set the Stacking Type to Aggregate by Target, a Stack Limit of 5, and set the Duration Refresh Policy to Refresh Duration. This ensures that every time the player lands a fire spell, the intensity of the damage increases, and the timer restarts, rewarding consistent aggression.

Key Takeaway: Stacking transforms a static Gameplay Effect into a dynamic, stateful modifier that automatically manages duration and magnitude through the Stacking Policy settings in your Gameplay Effect asset.