GameplayTagTableList
GameplayTagTableList
#Overview
name: GameplayTagTableList
The value of this variable can be defined or overridden in .ini config files. 2
.ini config files referencing this setting variable.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of GameplayTagTableList is to store a list of data tables that contain gameplay tags. This variable is crucial for the gameplay tag system in Unreal Engine 5, which is used for categorizing and organizing game elements.
The GameplayTagTableList is primarily used by the GameplayTags module, specifically within the UGameplayTagsManager class. This module is responsible for managing and processing gameplay tags throughout the engine and game code.
The value of this variable is set in the UGameplayTagsSettings class, which is a configuration class for the gameplay tag system. It is defined as a UPROPERTY with the ‘config’ and ‘EditAnywhere’ specifiers, allowing it to be edited in the project settings and saved in configuration files.
This variable interacts closely with the LoadGameplayTagTables function in the UGameplayTagsManager class. The function uses the paths stored in GameplayTagTableList to load the corresponding data tables and populate the gameplay tag system.
Developers should be aware that:
- Changes to this list may require a restart of the engine, as indicated by the ‘ConfigRestartRequired’ meta tag on a nearby property.
- The variable supports asynchronous loading in non-editor builds, which can help with performance optimization.
- The data tables referenced should contain valid gameplay tag structures.
Best practices when using this variable include:
- Keeping the list of data tables organized and relevant to your project’s needs.
- Ensuring that all referenced data tables are properly set up with the correct row structure for gameplay tags.
- Being mindful of the performance impact when adding many tables, especially in runtime scenarios.
- Using the project settings interface to manage this list rather than modifying it directly in code, unless absolutely necessary.
- Considering the use of async loading in appropriate scenarios to improve performance.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:7, section: [/Script/GameplayTags.GameplayTagsSettings]
- INI Section:
/Script/GameplayTags.GameplayTagsSettings
- Raw value:
/Game/ContextEffects/DT_AnimEffectTags.DT_AnimEffectTags
- Is Array:
True
Location: <Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:8, section: [/Script/GameplayTags.GameplayTagsSettings]
- INI Section:
/Script/GameplayTags.GameplayTagsSettings
- Raw value:
/Game/ContextEffects/DT_SurfaceTypes.DT_SurfaceTypes
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Classes/GameplayTagsSettings.h:134
Scope (from outer to inner):
file
class class UGameplayTagsSettings : public UGameplayTagsList
Source code excerpt:
/** List of data tables to load tags from */
UPROPERTY(config, EditAnywhere, Category = GameplayTags, meta = (AllowedClasses = "/Script/Engine.DataTable"))
TArray<FSoftObjectPath> GameplayTagTableList;
/** List of active tag redirects */
UPROPERTY(config, EditAnywhere, Category = GameplayTags, meta = (ConfigRestartRequired = true))
TArray<FGameplayTagRedirect> GameplayTagRedirects;
/** List of most frequently replicated tags */
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:206
Scope (from outer to inner):
file
function void UGameplayTagsManager::LoadGameplayTagTables
Source code excerpt:
#if !WITH_EDITOR
// If we're a cooked build and in a safe spot, start an async load so we can pipeline it
if (bAllowAsyncLoad && !IsLoading() && MutableDefault->GameplayTagTableList.Num() > 0)
{
for (FSoftObjectPath DataTablePath : MutableDefault->GameplayTagTableList)
{
LoadPackageAsync(DataTablePath.GetLongPackageName());
}
return;
}
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:218
Scope (from outer to inner):
file
function void UGameplayTagsManager::LoadGameplayTagTables
Source code excerpt:
SCOPE_LOG_GAMEPLAYTAGS(TEXT("UGameplayTagsManager::LoadGameplayTagTables"));
for (FSoftObjectPath DataTablePath : MutableDefault->GameplayTagTableList)
{
UDataTable* TagTable = LoadObject<UDataTable>(nullptr, *DataTablePath.ToString(), nullptr, LOAD_None, nullptr);
// Handle case where the module is dynamically-loaded within a LoadPackage stack, which would otherwise
// result in the tag table not having its RowStruct serialized in time. Without the RowStruct, the tags manager
// will not be initialized correctly.
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:1019
Scope (from outer to inner):
file
function void UGameplayTagsManager::InitializeManager
Source code excerpt:
for (const FString& DataTable : GameplayTagTablePaths)
{
MutableDefault->GameplayTagTableList.AddUnique(DataTable);
}
}
}
SingletonManager->LoadGameplayTagTables(true);
SingletonManager->ConstructGameplayTagTree();