UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GameplayTagContainer.cpp File Reference

Classes

class  FQueryEvaluator
 

Namespaces

namespace  UE
 
namespace  UE::GameplayTags
 
namespace  UE::GameplayTags::GameplayTagDynamicSerialization
 

Macros

#define LOCTEXT_NAMESPACE   "FGameplayTagContainer"
 

Functions

 DEFINE_STAT (STAT_FGameplayTagContainer_DoesTagContainerMatch)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::RemoveTagByExplicitName"), STAT_FGameplayTagContainer_RemoveTagByExplicitName, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::FillParentTags"), STAT_FGameplayTagContainer_FillParentTags, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::GetGameplayTagParents"), STAT_FGameplayTagContainer_GetGameplayTagParents, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::Filter"), STAT_FGameplayTagContainer_Filter, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::AppendTags"), STAT_FGameplayTagContainer_AppendTags, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::AppendMatchingTags"), STAT_FGameplayTagContainer_AppendMatchingTags, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::AddTag"), STAT_FGameplayTagContainer_AddTag, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::RemoveTag"), STAT_FGameplayTagContainer_RemoveTag, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTagContainer::RemoveTags"), STAT_FGameplayTagContainer_RemoveTags, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTag::GetSingleTagContainer"), STAT_FGameplayTag_GetSingleTagContainer, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTag::MatchesTag"), STAT_FGameplayTag_MatchesTag, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTag::MatchesAny"), STAT_FGameplayTag_MatchesAny, STATGROUP_GameplayTags)
 
 DECLARE_CYCLE_STAT (TEXT("FGameplayTag::NetSerialize"), STAT_FGameplayTag_NetSerialize, STATGROUP_GameplayTags)
 
void SerializeTagNetIndexPacked (FArchive &Ar, FGameplayTagNetIndex &Value, const int32 NetIndexFirstBitSegment, const int32 MaxBits)
 

Variables

FAutoConsoleCommand GameplayTagPrintReplicationMapCmd (TEXT("GameplayTags.PrintReport"), TEXT("Prints frequency of gameplay tags"), FConsoleCommandDelegate::CreateStatic(GameplayTagPrintReplicationMap))
 
FAutoConsoleCommand GameplayTagPrintReplicationIndicesCmd (TEXT("GameplayTags.PrintNetIndices"), TEXT("Prints net indices for all known tags"), FConsoleCommandDelegate::CreateStatic(GameplayTagPrintReplicationIndices))
 
FAutoConsoleCommand TagPackingTestCmd (TEXT("GameplayTags.PackingTest"), TEXT("Prints frequency of gameplay tags"), FConsoleCommandDelegate::CreateStatic(TagPackingTest))
 

Macro Definition Documentation

◆ LOCTEXT_NAMESPACE

#define LOCTEXT_NAMESPACE   "FGameplayTagContainer"

Function Documentation

◆ DECLARE_CYCLE_STAT() [1/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTag::GetSingleTagContainer")  ,
STAT_FGameplayTag_GetSingleTagContainer  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [2/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTag::MatchesAny")  ,
STAT_FGameplayTag_MatchesAny  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [3/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTag::MatchesTag")  ,
STAT_FGameplayTag_MatchesTag  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [4/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTag::NetSerialize")  ,
STAT_FGameplayTag_NetSerialize  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [5/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::AddTag")  ,
STAT_FGameplayTagContainer_AddTag  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [6/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::AppendMatchingTags")  ,
STAT_FGameplayTagContainer_AppendMatchingTags  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [7/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::AppendTags")  ,
STAT_FGameplayTagContainer_AppendTags  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [8/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::FillParentTags")  ,
STAT_FGameplayTagContainer_FillParentTags  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [9/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::Filter")  ,
STAT_FGameplayTagContainer_Filter  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [10/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::GetGameplayTagParents")  ,
STAT_FGameplayTagContainer_GetGameplayTagParents  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [11/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::RemoveTag")  ,
STAT_FGameplayTagContainer_RemoveTag  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [12/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::RemoveTagByExplicitName")  ,
STAT_FGameplayTagContainer_RemoveTagByExplicitName  ,
STATGROUP_GameplayTags   
)

◆ DECLARE_CYCLE_STAT() [13/13]

DECLARE_CYCLE_STAT ( TEXT("FGameplayTagContainer::RemoveTags")  ,
STAT_FGameplayTagContainer_RemoveTags  ,
STATGROUP_GameplayTags   
)

◆ DEFINE_STAT()

◆ SerializeTagNetIndexPacked()

void SerializeTagNetIndexPacked ( FArchive Ar,
FGameplayTagNetIndex Value,
const int32  NetIndexFirstBitSegment,
const int32  MaxBits 
)

Replicates a tag in a packed format: -A segment of NetIndexFirstBitSegment bits are always replicated. -Another bit is replicated to indicate "more" -If "more", then another segment of (MaxBits - NetIndexFirstBitSegment) length is replicated.

This format is basically the same as SerializeIntPacked, except that there are only 2 segments and they are not the same size. The gameplay tag system is able to exploit knoweledge in what tags are frequently replicated to ensure they appear in the first segment. Making frequently replicated tags as cheap as possible.

Setting up your project to take advantage of the packed format. -Run a normal networked game on non shipping build. -After some time, run console command "GameplayTags.PrintReport" or set "GameplayTags.PrintReportOnShutdown 1" cvar. -This will generate information on the server log about what tags replicate most frequently. -Take this list and put it in DefaultGameplayTags.ini. -CommonlyReplicatedTags is the ordered list of tags. -NetIndexFirstBitSegment is the number of bits (not including the "more" bit) for the first segment.

Variable Documentation

◆ GameplayTagPrintReplicationIndicesCmd

FAutoConsoleCommand GameplayTagPrintReplicationIndicesCmd(TEXT("GameplayTags.PrintNetIndices"), TEXT("Prints net indices for all known tags"), FConsoleCommandDelegate::CreateStatic(GameplayTagPrintReplicationIndices)) ( TEXT("GameplayTags.PrintNetIndices")  ,
TEXT("Prints net indices for all known tags" ,
FConsoleCommandDelegate::CreateStatic(GameplayTagPrintReplicationIndices)   
)

◆ GameplayTagPrintReplicationMapCmd

FAutoConsoleCommand GameplayTagPrintReplicationMapCmd(TEXT("GameplayTags.PrintReport"), TEXT("Prints frequency of gameplay tags"), FConsoleCommandDelegate::CreateStatic(GameplayTagPrintReplicationMap)) ( TEXT("GameplayTags.PrintReport")  ,
TEXT("Prints frequency of gameplay tags" ,
FConsoleCommandDelegate::CreateStatic(GameplayTagPrintReplicationMap)   
)

◆ TagPackingTestCmd

FAutoConsoleCommand TagPackingTestCmd(TEXT("GameplayTags.PackingTest"), TEXT("Prints frequency of gameplay tags"), FConsoleCommandDelegate::CreateStatic(TagPackingTest)) ( TEXT("GameplayTags.PackingTest")  ,
TEXT("Prints frequency of gameplay tags" ,
FConsoleCommandDelegate::CreateStatic(TagPackingTest)   
)