UnrealPilotSeptember 12, 202613 min read

Gameplay Ability System with UnrealPilot

GAS is powerful but complex. UnrealPilot helps you navigate the system, generate abilities, and implement attribute sets without the learning curve.

What is the Gameplay Ability System?

The Gameplay Ability System (GAS) is Epic's framework for building ability-based gameplay. Originally developed for Paragon and Fortnite, it's now available for any Unreal Engine project. GAS handles abilities, attributes, effects, and their interactions in a data-driven way.

The system is incredibly flexible but notoriously difficult to learn. The documentation is sparse, and the architecture involves many interconnected pieces. UnrealPilot significantly reduces the learning curve by generating correct GAS code from natural language descriptions.

GAS Basics

Before diving into implementation, let's understand the core components.

Ability System Component

The Ability System Component (ASC) is the central hub that manages everything. Every actor that uses GAS needs one. The ASC handles granting abilities, managing attributes, applying effects, and processing gameplay tags.

// Adding ASC to a character in C++
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
UAbilitySystemComponent* AbilitySystemComponent;

// In constructor
AbilitySystemComponent = CreateDefaultSubobject<UAbilitySystemComponent>(
  TEXT("AbilitySystemComponent")
);

Gameplay Abilities

Gameplay Abilities are the actions characters can perform - spells, attacks, dashes, anything. Each ability defines what happens when activated, its costs, cooldowns, and targeting behavior.

// Basic ability structure
UCLASS()
class UGA_FireBall : public UGameplayAbility
{
  GENERATED_BODY()

public:
  virtual void ActivateAbility(...) override;
  virtual bool CanActivateAbility(...) const override;
  virtual void EndAbility(...) override;

  UPROPERTY(EditDefaultsOnly)
  TSubclassOf<UGameplayEffect> DamageEffect;

  UPROPERTY(EditDefaultsOnly)
  float ManaCost = 25.f;
};

Gameplay Effects

Gameplay Effects modify attributes and apply status conditions. They can be instant (deal damage), duration-based (buff for 10 seconds), or infinite (passive modifier). Effects are data assets configured in the editor.

Attribute Sets

Attribute Sets define the numeric properties characters have - health, mana, strength, speed. GAS provides networking, clamping, and change notifications automatically when you use attribute sets properly.

// Basic attribute set
UCLASS()
class UMyAttributeSet : public UAttributeSet
{
  GENERATED_BODY()

public:
  UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Health)
  FGameplayAttributeData Health;
  ATTRIBUTE_ACCESSORS(UMyAttributeSet, Health)

  UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_MaxHealth)
  FGameplayAttributeData MaxHealth;
  ATTRIBUTE_ACCESSORS(UMyAttributeSet, MaxHealth)
};

Gameplay Tags

Gameplay Tags are hierarchical labels that control ability flow. They determine what abilities can be activated, what effects can be applied, and how systems interact. Tags like "State.Dead" or "Ability.Attack.Melee" drive the entire system.

Creating Abilities with UnrealPilot

Writing GAS abilities manually involves significant boilerplate. UnrealPilot generates complete ability implementations from descriptions.

Basic Ability

"Create a fireball ability that costs 25 mana, has a 3 second cooldown,
and deals 50 fire damage on impact"

UnrealPilot generates:

  • UGameplayAbility subclass with proper setup
  • Cost effect checking mana attribute
  • Cooldown effect with 3-second duration
  • Projectile spawning in ActivateAbility
  • Damage effect with fire damage type
  • Required gameplay tags configuration
// Generated ability header
UCLASS()
class UGA_Fireball : public UGameplayAbility
{
  GENERATED_BODY()

public:
  UGA_Fireball();

  virtual void ActivateAbility(const FGameplayAbilitySpecHandle Handle,
    const FGameplayAbilityActorInfo* ActorInfo,
    const FGameplayAbilityActivationInfo ActivationInfo,
    const FGameplayEventData* TriggerEventData) override;

  UPROPERTY(EditDefaultsOnly, Category = "Projectile")
  TSubclassOf<AFireballProjectile> ProjectileClass;

  UPROPERTY(EditDefaultsOnly, Category = "Effects")
  TSubclassOf<UGameplayEffect> DamageEffect;

  UPROPERTY(EditDefaultsOnly, Category = "Effects")
  TSubclassOf<UGameplayEffect> CostEffect;

  UPROPERTY(EditDefaultsOnly, Category = "Effects")
  TSubclassOf<UGameplayEffect> CooldownEffect;
};

Channeled Ability

"Create a healing channel ability that heals 10 HP per second while
channeling, drains 5 mana per second, and can be interrupted"

UnrealPilot handles the complexity of channeled abilities:

  • Periodic effect application
  • Continuous mana drain
  • Cancellation logic with proper cleanup
  • Visual and audio feedback hooks

Passive Ability

"Create a passive ability that increases armor by 20% while health is below 50%"

Passives require different patterns - they activate automatically and modify attributes conditionally. UnrealPilot sets up the proper attribute change listeners and conditional effect application.

Attribute Sets with UnrealPilot

Attribute sets require careful implementation for networking and clamping to work correctly. UnrealPilot generates complete, properly structured attribute sets.

Creating Attribute Sets

"Create an attribute set with Health, MaxHealth, Mana, MaxMana, Strength,
and Agility. Health and Mana should clamp to their max values."

UnrealPilot generates:

// Generated attribute set
UCLASS()
class UMyAttributeSet : public UAttributeSet
{
  GENERATED_BODY()

public:
  UMyAttributeSet();

  virtual void GetLifetimeReplicatedProps(
    TArray<FLifetimeProperty>& OutLifetimeProps) const override;

  virtual void PreAttributeChange(
    const FGameplayAttribute& Attribute, float& NewValue) override;

  virtual void PostGameplayEffectExecute(
    const FGameplayEffectModCallbackData& Data) override;

  // Health
  UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Health)
  FGameplayAttributeData Health;
  ATTRIBUTE_ACCESSORS(UMyAttributeSet, Health)
  UFUNCTION()
  virtual void OnRep_Health(const FGameplayAttributeData& OldHealth);

  // MaxHealth
  UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_MaxHealth)
  FGameplayAttributeData MaxHealth;
  ATTRIBUTE_ACCESSORS(UMyAttributeSet, MaxHealth)
  UFUNCTION()
  virtual void OnRep_MaxHealth(const FGameplayAttributeData& OldMaxHealth);

  // Additional attributes...
};

The generated code includes proper replication, clamping in PreAttributeChange, and death handling in PostGameplayEffectExecute.

Derived Attributes

"Add a DamageBonus attribute that equals Strength * 0.5 + WeaponDamage"

UnrealPilot sets up Gameplay Effect Calculations (MMCs) for derived attributes that update automatically when base values change.

Gameplay Effects

Gameplay Effects are primarily data assets, but complex effects require custom code. UnrealPilot helps with both.

Creating Effect Blueprints

"Create a poison effect that deals 5 damage per second for 10 seconds,
stacking up to 5 times, and reduces healing received by 25%"

UnrealPilot creates the Gameplay Effect asset with:

  • Duration policy set to Has Duration (10 seconds)
  • Periodic damage modifier
  • Stack limit of 5 with proper stacking rules
  • Healing reduction modifier
  • Appropriate gameplay tags for effect identification

Execution Calculations

For complex damage formulas, GAS uses Gameplay Effect Execution Calculations. These are C++ classes that compute final values based on source and target attributes.

"Create a damage calculation that uses the formula:
BaseDamage * (1 + SourceStrength/100) * (1 - TargetArmor/200)"

UnrealPilot generates the complete UGameplayEffectExecutionCalculation subclass with proper attribute capturing and formula implementation.

// Generated execution calculation
void UDamageExecution::Execute_Implementation(
  const FGameplayEffectCustomExecutionParameters& ExecutionParams,
  FGameplayEffectCustomExecutionOutput& OutExecutionOutput) const
{
  // Capture source attributes
  float SourceStrength = 0.f;
  ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(
    StrengthDef, EvaluationParams, SourceStrength);

  // Capture target attributes
  float TargetArmor = 0.f;
  ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(
    ArmorDef, EvaluationParams, TargetArmor);

  // Calculate final damage
  float BaseDamage = Spec.GetSetByCallerMagnitude(DamageTag);
  float FinalDamage = BaseDamage
    * (1.f + SourceStrength / 100.f)
    * (1.f - TargetArmor / 200.f);

  OutExecutionOutput.AddOutputModifier(
    FGameplayModifierEvaluatedData(HealthAttribute,
      EGameplayModOp::Additive, -FinalDamage));
}

Common GAS Patterns

Certain patterns appear in almost every GAS implementation. UnrealPilot knows these patterns and generates them correctly.

Ability Combos

"Create a three-hit melee combo where each hit can chain into the next
within a 1-second window, with increasing damage multipliers"

UnrealPilot generates abilities with proper input buffering, combo state management, and timing windows.

Cooldown Management

"Add a cooldown reduction system where every point of Haste reduces
ability cooldowns by 1%"

The generated code uses Cooldown Magnitude Calculations that read the Haste attribute and modify cooldown durations dynamically.

Resource Management

"Create an energy system where abilities cost energy, energy regenerates
at 10/second, and regeneration stops while any ability is active"

UnrealPilot sets up the energy attribute, regeneration effects with proper tag requirements, and ability blocking tags.

Interrupt System

"Create an interrupt system where abilities with the Channeled tag can be
interrupted by effects with the Interrupt tag"

The generated code uses ability tags for blocking and cancellation, plus the proper GAS events for clean interruption handling.

Debugging GAS Issues

GAS problems can be difficult to diagnose. UnrealPilot helps identify common issues.

Ability Not Activating

"My fireball ability won't activate - help me debug it"

UnrealPilot checks for common causes:

  • Missing ability grant to the ASC
  • Blocking tags preventing activation
  • Failed cost check (not enough mana)
  • Cooldown still active
  • Incorrect input binding

Effect Not Applying

"My damage effect applies but doesn't reduce health"

UnrealPilot analyzes the effect configuration, attribute setup, and execution flow to identify the issue.

Network Replication

"Abilities work locally but don't replicate to other clients"

UnrealPilot checks ASC replication mode, ability net execution policies, and attribute replication setup.

GAS Best Practices

Through extensive GAS experience, certain practices consistently lead to better outcomes:

Use Data Assets

Keep ability configuration in data assets where possible. Hard-coded values are difficult to balance. UnrealPilot generates abilities with exposed UPROPERTY values for easy tuning.

Tag Everything

Gameplay Tags are the glue of GAS. Use them liberally for ability states, effect types, damage categories, and status conditions. UnrealPilot generates comprehensive tag configurations.

Separate Concerns

Abilities should activate effects, not directly modify attributes. This separation makes the system more modular and easier to debug.

Test Incrementally

GAS has many moving parts. Test each component independently before combining them. UnrealPilot can generate test harnesses for individual abilities and effects.

Beyond the Basics

Once you're comfortable with core GAS, there's much more to explore:

  • Ability Tasks for async operations within abilities
  • Gameplay Cues for visual and audio feedback
  • Target Data for ability targeting systems
  • Prediction for client-side ability execution
"Create an ability task that traces for targets in a cone, highlights
valid targets, and waits for player confirmation"

UnrealPilot handles advanced GAS patterns too, generating proper task implementations with callbacks and cleanup.

Start Building Abilities

The Gameplay Ability System is one of Unreal Engine's most powerful features, but its complexity can be overwhelming. UnrealPilot removes the barrier by generating correct, well-structured GAS code from your descriptions.

Whether you're building a simple action game or a complex RPG with dozens of abilities, AI assistance makes GAS development faster and less frustrating.

Request beta access to UnrealPilot →