During analyzing the lifetime of a GameplayEffect modifier and execution, I've stumbled across attribute aggregators or GameplayEffect aggregators (both terms are used in source code). These are used to evaluate modified attribute values (they are modified by GameplayEffects).
However, I don't understand how those aggregators influence the actual GameplayAbilitySystem attributes which are attached (as part of an AttributeSet) to the actor:
- Does an attribute/GameplayEffect aggregator
FAggregator
influence the base value or the current value of a gameplay attributeFGameplayAttributeData
? - Is the base value of an attribute/GameplayEffect aggregator
float FAggregator::BaseValue
related to the base value of a gameplay attributefloat FGameplayAttributeData::BaseValue
?
The vital components of attribute/GameplayEffect aggregators are
- so called gameplay modifier evaluation channels
EGameplayModEvaluationChannel
, which are used sequentially during value evaluation (the result of channel0 is passed as base value to channel1 etc) - storing modifiers (with its magnitude, operation, tags and link to the applying GameplayEffect) in certain channels, which define the actual numerical evaluation
Those are used for doing the evaluation of
- a final value
- a base value by evaluating a final value in reverse, attempting to determine the base value from the modifiers (deprecated b/c GAS now has struct-based attributes - according to documentation)
- a bonus value (final value - base value)
(all of them are just return values of functions and are not member variables of the aggregator)
To notify other classes of an evaluation (or changes to the aggregator), two methods are used
- a delegate
FOnAggregatorDirty
is broadcasted which contains a reference to the aggregator - every GameplayEffect, which is registered in the AbilitySystemComponent, updates the change to its affected attribute(s) (via
FActiveGameplayEffectsContainer::UpdateAggregatorModMagnitudes()
) by updating the aggregatorFAggregator
for the attribute (which is determined or set viaFindOrCreateAttributeAggregator()
) inFAggregator::UpdateAggregatorMod()
)
I don't see, how one or both of those notification methods update the actual attribute values.
(The official documentation/source code as well as the excellent GAS: Comprehensive Analysis and GAS and you unfortunately don't shed light on GameplayEffect aggregators.)