AbilitySystemComponent ReplicatedLooseTags Usage

Is it intentional that the ReplicatedLooseTags container in the ASC is not considered when querying for tags from GetOwnedGameplayTags and also does not update the owner tag map when tags are manipulated? Should I be using both the replicated loose APIs and non-replicated loose APIs in pairs if I want to be able to query for those tags on the server and the clients?

“Is it intentional that the ReplicatedLooseTags container in the ASC is not considered when querying for tags from GetOwnedGameplayTags and also does not update the owner tag map when tags are manipulated?”

Yes. ASC->ReplicatedLooseTags when modified on the server only updates the GameplayTagCountContainer client-side.

“Should I be using both the replicated loose APIs and non-replicated loose APIs in pairs if I want to be able to query for those tags on the server and the clients?”

Yes, but it depends on whether you call it on the ASC directly or via UAbilitySystemBlueprintLibrary.

  • The server should call both ASC->AddReplicatedLooseGameplayTag() and ASC->AddLooseGameplayTags() in order to have the tag both effective on itself and the client. The client only need to call AddLooseGameplayTags().
  • Alternatively, call UAbilitySystemBlueprintLibrary::AddLooseGameplayTags() server-side with bShouldReplicate = true, which will call both for you.

Be aware that in UE 5.7 the API will change: replicated loose tags (and minimal replication tags) will keep working, but those APIs will be deprecated in favor of one new function “AddGameplayTag” where replication behavior is provided as an option. See CL 45000201 on //UE5/Main for that. We’ll mark AddReplicatedLooseTags as deprecated in 5.7, and remove it in a later engine version so that AddGameplayTag will be the one way to add loose tags.

1 Like

Perfect, thanks for confirming!

Glad to provide that!