How to reliably wipe all owned gameplay tags

We have the ABS living on player state.

inside InitAbilityActorInfo we call our own RemoveAllGameplayTagsAndEffects function

if ( InOwnerActor->HasAuthority() || InOwnerActor->HasLocalNetOwner() )

{

//reset any previous tags and effects, don’t do this for sim proxies to prevent JIP wiping all tags

RemoveAllGameplayTagsAndEffects();

}

my current version of this function looks like this:

void UOurAbilitySystemComponent::RemoveAllGameplayTagsAndEffects()

{

// Remove all active effects (removes effect-granted tags)

RemoveActiveEffects( FGameplayEffectQuery() );

// Remove all loose tags

FGameplayTagContainer OwnedGameplayTags = GetOwnedGameplayTags();

for ( const FGameplayTag& Tag : OwnedGameplayTags )

{

SetTagMapCount( Tag, 0 );

}

const bool HasLocalNetOwner = GetOwner()->HasLocalNetOwner();

if ( HasLocalNetOwner || GetOwner()->HasAuthority() )

{

// Clear minimal replicated owned tags

GetMinimalReplicationTags_Mutable().RemoveAllTags();

}

if ( GetOwner()->HasAuthority() )

{

// clear replicated loose tags

GetReplicatedLooseTags_Mutable().RemoveAllTags();

}

}

This attempts to nuke all gameplay tags. But in practice, once the tag map is modified again after respawn the deleted replicated loose tags will reappear on the actor for other players (locally the tags remain wiped it seems).

Are there any suggestions you can make to fix this function so it reliably wipes everything?

I am aware that the intended flow is that sources of tags all self manage, but we are working on a prototype and adding/removing loose tags is more convenient in most cases and adding them via gameplay effects etc is often overkill for many of our use cases.

Is Epic planning on adding a generic wipe all tags function of their own? If not, should we be recreating the ABS every time the player respawns instead? This would cause it’s own headaches, so is not preferable.

Is there a reason this functionality is not exposed besides enforcing design patterns for how tags should be removed added?

I also know this system is being updated in 5.7, will this problem go away / will we need a new way to solve?

Thanks :slight_smile:

[Attachment Removed]

Steps to Reproduce

  • Have ability system on the player sate, online multiplayer game
  • add replicated loose tags on server
  • player dies
  • try to wipe all tags on death
  • Tags persist once the tag map is modified
    [Attachment Removed]

you can just call ResetTagMap() in the ASC to reset the entire tag count container? You can also use GetReplicatedLooseTags_Mutable()->RemoveAllTags() and GetMinimalReplicationTags_Mutable()->RemoveAllTags(). Though i really dislike doing this, we just clear loosetags only on death. THough we avoid using ReplicatedLooseTags in favour of GE’s which apply a tag, which is much more manageable.

[Attachment Removed]