![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "GameplayTagContainer.h"#include "HAL/IConsoleManager.h"#include "UObject/CoreNet.h"#include "UObject/ObjectSaveContext.h"#include "UObject/UnrealType.h"#include "Engine/PackageMapClient.h"#include "UObject/Package.h"#include "Engine/NetConnection.h"#include "GameplayTagsManager.h"#include "GameplayTagsModule.h"#include "Misc/OutputDeviceNull.h"#include "JsonObjectConverter.h"#include "Net/Core/NetToken/NetTokenExportContext.h"#include "GameplayTagTokenStore.h"#include <Net/Core/Trace/NetTrace.h>Classes | |
| class | FQueryEvaluator |
Namespaces | |
| namespace | UE |
| namespace | UE::GameplayTags |
| namespace | UE::GameplayTags::GameplayTagDynamicSerialization |
Macros | |
| #define | LOCTEXT_NAMESPACE "FGameplayTagContainer" |
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)) |
| #define LOCTEXT_NAMESPACE "FGameplayTagContainer" |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTag::GetSingleTagContainer") | , |
| STAT_FGameplayTag_GetSingleTagContainer | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTag::MatchesAny") | , |
| STAT_FGameplayTag_MatchesAny | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTag::MatchesTag") | , |
| STAT_FGameplayTag_MatchesTag | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTag::NetSerialize") | , |
| STAT_FGameplayTag_NetSerialize | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::AddTag") | , |
| STAT_FGameplayTagContainer_AddTag | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::AppendMatchingTags") | , |
| STAT_FGameplayTagContainer_AppendMatchingTags | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::AppendTags") | , |
| STAT_FGameplayTagContainer_AppendTags | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::FillParentTags") | , |
| STAT_FGameplayTagContainer_FillParentTags | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::Filter") | , |
| STAT_FGameplayTagContainer_Filter | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::GetGameplayTagParents") | , |
| STAT_FGameplayTagContainer_GetGameplayTagParents | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::RemoveTag") | , |
| STAT_FGameplayTagContainer_RemoveTag | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::RemoveTagByExplicitName") | , |
| STAT_FGameplayTagContainer_RemoveTagByExplicitName | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DECLARE_CYCLE_STAT | ( | TEXT("FGameplayTagContainer::RemoveTags") | , |
| STAT_FGameplayTagContainer_RemoveTags | , | ||
| STATGROUP_GameplayTags | |||
| ) |
| DEFINE_STAT | ( | STAT_FGameplayTagContainer_DoesTagContainerMatch | ) |
| 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.
| 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) | |||
| ) |
| 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) | |||
| ) |
| 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) | |||
| ) |