title: Unreal GAS: Influence of the GameplayEffect aggregator on gameplay attribute values
body: <p>During analyzing the lifetime of a <a href="https://docs.unrealengine.com/en-us/Gameplay/GameplayAbilitySystem/GameplayAttributesAndGameplayEffects" rel="nofollow noreferrer">GameplayEffect</a> modifier and execution, I've stumbled across <strong>attribute aggregators</strong> or <strong>GameplayEffect aggregators</strong> (both terms are used in source code). These are used to evaluate modified attribute values (they are modified by GameplayEffects).</p>
  
  <p>However, I don't understand how those aggregators influence the actual GameplayAbilitySystem attributes which are attached (as part of an AttributeSet) to the actor:</p>
  
  <ol>
  <li>Does an <em>attribute/GameplayEffect aggregator</em> <code>FAggregator</code> influence the <strong>base value</strong> or the <strong>current value</strong> of a <em>gameplay attribute</em> <code>FGameplayAttributeData</code>?</li>
  <li>Is the <strong>base value</strong> of an <em>attribute/GameplayEffect aggregator</em> <code>float FAggregator::BaseValue</code> related to the <strong>base value</strong> of a <em>gameplay attribute</em> <code>float FGameplayAttributeData::BaseValue</code>?</li>
  </ol>
  
  <hr>
  
  <p>The vital components of <strong>attribute/GameplayEffect aggregators</strong> are</p>
  
  <ul>
  <li>so called <em>gameplay modifier evaluation channels</em> <code>EGameplayModEvaluationChannel</code>, which are used sequentially during value evaluation (the result of channel0 is passed as base value to channel1 etc)</li>
  <li>storing <em>modifiers</em> (with its magnitude, operation, tags and link to the applying <em>GameplayEffect</em>) in certain channels, which define the actual numerical evaluation</li>
  </ul>
  
  <p>Those are used for doing the evaluation of</p>
  
  <ul>
  <li>a <em>final value</em></li>
  <li>a <em>base value</em> by evaluating a final value in reverse, attempting to determine the <em>base value</em> from the modifiers (deprecated b/c GAS now has struct-based attributes - according to documentation)</li>
  <li>a <em>bonus value</em> (final value - base value)</li>
  </ul>
  
  <p>(all of them are just return values of functions and are not member variables of the aggregator)</p>
  
  <p>To notify other classes of an evaluation (or changes to the aggregator), two methods are used</p>
  
  <ol>
  <li><a href="https://docs.unrealengine.com/en-US/Programming/UnrealArchitecture/Delegates" rel="nofollow noreferrer">a delegate</a> <code>FOnAggregatorDirty</code> is broadcasted which contains a reference to the aggregator</li>
  <li>every <em>GameplayEffect</em>, which is registered in the <em>AbilitySystemComponent</em>, updates the change to its affected attribute(s) (via <code>FActiveGameplayEffectsContainer::UpdateAggregatorModMagnitudes()</code>) by updating the aggregator <code>FAggregator</code> for the attribute (which is determined or set via <code>FindOrCreateAttributeAggregator()</code>) in <code>FAggregator::UpdateAggregatorMod()</code>)</li>
  </ol>
  
  <p>I don't see, how one or both of those notification methods update the actual attribute values.</p>
  
  <p>(The official documentation/source code as well as the excellent <a href="https://forums.unrealengine.com/community/community-content-tools-and-tutorials/116578-comprehensive-gameplayabilities-analysis-series" rel="nofollow noreferrer">GAS: Comprehensive Analysis</a> and <a href="https://forums.unrealengine.com/community/community-content-tools-and-tutorials/110113-gameplayabilities-and-you" rel="nofollow noreferrer">GAS and you</a> unfortunately don't shed light on GameplayEffect aggregators.)</p>