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

Defining Gameplay Effect Modifier Containers

Learn to structure Gameplay Effect classes by defining attribute modifiers that change base values using additive, multiplicative, or override operations.

In this lesson, you will learn how to structure GameplayEffect classes by defining modifier containers that dictate how specific attributes change during gameplay.

The Role of Modifier Containers

While AttributeSets hold the data, GameplayEffects (GEs) are the tools that modify that data. A GameplayEffect uses Modifier Containers—a collection of data structures within the GE—to determine which attribute to target, what math operation to perform, and what the source value should be.

When you open a GameplayEffect blueprint, you will find the Modifiers array. Each element in this array is a container consisting of three core parts:

  1. Attribute: The specific stat you are targeting (e.g., Health, Mana, or MoveSpeed).
  2. Modifier Op: The mathematical operation applied to the attribute.
  3. Modifier Magnitude: The actual value or formula used for the calculation.

Selecting the Modifier Operation

The "Modifier Op" defines how the change occurs. Understanding these is vital for balancing game logic:

  • Additive: Simply adds or subtracts the magnitude from the base value (e.g., CurrentHealth - 10).
  • Multiplicative: Multiplies the current attribute by the magnitude (e.g., MoveSpeed * 1.5 for a speed boost).
  • Override: Completely replaces the existing value with the new magnitude, regardless of the previous total.

Configuring Magnitudes

The Magnitude isn’t always a static number. You can define it using:

  • Scalable Float: A constant value that can be hooked into a CurveTable for level-based scaling.
  • Attribute Based: The magnitude is determined by another attribute (e.g., a "Heal" effect that scales based on the caster's "SpellPower" attribute).
  • Custom Calculation Class: A logic-heavy approach using GameplayEffectExecutionCalculation (which you’ve already explored) for complex, multi-stat dependency math.

Example Configuration

If you wanted to implement a "Poison" effect that reduces Max Health, your Modifier Container would look like this:

  • Attribute: AttributeSet.MaxHealth
  • Modifier Op: Additive
  • Magnitude: -10.0

By stacking these containers within a single GameplayEffect, you can create complex, multi-layered buffs or debuffs—such as an item that simultaneously grants a flat armor bonus and a percentage-based stamina regeneration increase.

Key Takeaway: Modifier Containers act as the mathematical bridge between Gameplay Effects and Attributes, allowing you to define precisely how values are adjusted through additive, multiplicative, or override operations.