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

Debugging Gameplay Effects and Calculations

Use the GAS console commands and visual debug tools to inspect attribute changes and verify that your execution calculations are firing correctly.

In this lesson, you will learn how to leverage GAS-specific console commands and visual logging to verify that your GameplayEffectExecutionCalculations are firing accurately and calculating the correct results.

When you create a custom UGameplayEffectExecutionCalculation, it acts as a "black box" where complex math happens. If your damage numbers aren't what you expect, you need to see exactly what is happening inside that box.

Visualizing the Execution

The most powerful tool in your arsenal is the showdebug abilitysystem console command. When you enter this in the game console, you get a multi-page overlay. By pressing PageDown, you can cycle to the Gameplay Effects page. This displays all active effects, their tags, and the current modifiers being applied to your attributes.

Inspecting Calculations

To verify your custom calculations, you should add UE_LOG statements inside your Execute_Implementation function. Since execution calculations run on the server (and sometimes client in predictive scenarios), logging helps you trace the math:

void UMyDamageExecution::Execute_Implementation(const FGameplayEffectCustomExecutionParameters& ExecutionParams, FGameplayEffectCustomExecutionOutput& OutOutput) const
{
    // ... capture attributes ...
    float DamageValue = SourceAttributeValue * TargetArmorValue;
    
    UE_LOG(LogTemp, Warning, TEXT("Execution: SourceVal: %f, TargetArmor: %f, Result: %f"), 
           SourceAttributeValue, TargetArmorValue, DamageValue);

    OutOutput.AddOutputModifier(FGameplayModifierEvaluatedData(MyAttributeProperty, EGameplayModOp::Additive, DamageValue));
}

Pro-Tip: Using Visual Log

For more complex debugging, use the Visual Logger (vislog). You can trigger UE_VLOG macros inside your execution calculation to log specific attribute captures. This allows you to step through your gameplay session after it occurs, seeing exactly which effect was active at the moment of calculation and what the captured values were before the final attribute change was committed. If the math in your Execute function seems correct but the attribute value remains unchanged, use showdebug abilitysystem to ensure the GameplayEffect itself actually reached the target and wasn't blocked by a GameplayTag requirement.

Key Takeaway: Use showdebug abilitysystem to verify active effects and UE_LOG inside your Execute_Implementation to confirm that your capture parameters and math logic are producing the expected numerical output.