0

What I understand is, that GameplayAbilities do not need to replicate to update GameplayAttributes across the network, since they don't influence attributes directly. Instead, this is the task of GameplayEffects.

So what is it that updates the GameplayAbilitySystem attribute values (FGameplayAttributeData) over the network:

  • do only attributes replicate?
  • or are the GameplayEffects sent only?
  • or both?

To give context: I have an attribute modification system where I need several “base values”. Those “base values” change very infrequently, while the “final value” changes often. There are two possibilities to do that with GAS

  1. use a separate attribute for each of the “base values” and “final value” or
  2. add additional float members to the attribute struct FGameplayAttributeData, for all “base values” and the “final value”

If only GE are sent over the network (and not attributes), I would go for (2), since the size of an attribute doesn't matter for bandwidth then.

Roi Danton
  • 7,933
  • 6
  • 68
  • 80

1 Answers1

0

Both are replicated!

  • GameplayAttributes are replicated with an OnRep function, which calls FActiveGameplayEffectsContainer::SetBaseAttributeValueFromReplication(), which - despite the name - will also updates the current value using the aggregators which are existing on the local machine. For that to work, also ...
  • GameplayEffects replicate (see also Unreal GAS: GameplayEffect: Difference between minimal and full replication).

So for saving bandwidth in the example given, it is more meaningful to use separate attributes for the “base values” (option (1)), since they are not updated very often. So when the “final value” changes, the constant “base values” won’t have to be replicated.

Roi Danton
  • 7,933
  • 6
  • 68
  • 80