FastReplication
FastReplication
#Overview
name: FastReplication
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of FastReplication is to optimize the replication of gameplay tags in Unreal Engine’s networking system. It allows for more efficient network transmission of gameplay tags by using indices instead of full tag names.
This setting variable is primarily used by the GameplayTags system, which is a core module in Unreal Engine. It’s particularly relevant for networked gameplay scenarios where performance and bandwidth optimization are crucial.
The value of this variable is set in the UGameplayTagsSettings class, which is part of the GameplayTags module. By default, it is set to false in the constructor of UGameplayTagsSettings.
FastReplication interacts with other variables in the GameplayTags system, particularly bUseFastReplication in the UGameplayTagsManager class. When FastReplication is true, it affects how tags are serialized and deserialized for network replication.
Developers must be aware that using FastReplication requires the gameplay tags to be identical on both the client and server. If there’s any mismatch in the tag structures between client and server, it could lead to synchronization issues or incorrect tag interpretations.
Best practices when using this variable include:
- Ensure that gameplay tag structures are identical across all networked instances of the game.
- Use this option only when you have a large number of gameplay tags that need frequent replication, as it adds some complexity to the tag management system.
- Thoroughly test the networking behavior of your game with this option both enabled and disabled to ensure it provides a tangible benefit without introducing issues.
- Consider the trade-off between network performance and the flexibility of runtime tag modifications, as fast replication may limit dynamic tag changes.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGameplayTags.ini:5, section: [/Script/GameplayTags.GameplayTagsSettings]
- INI Section:
/Script/GameplayTags.GameplayTagsSettings
- Raw value:
True
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Classes/GameplayTagsSettings.h:122
Scope (from outer to inner):
file
class class UGameplayTagsSettings : public UGameplayTagsList
Source code excerpt:
/** If true, will replicate gameplay tags by index instead of name. For this to work, tags must be identical on client and server */
UPROPERTY(config, EditAnywhere, Category = "Advanced Replication")
bool FastReplication;
/** These characters cannot be used in gameplay tags, in addition to special ones like newline*/
UPROPERTY(config, EditAnywhere, Category = GameplayTags)
FString InvalidTagCharacters;
/** Category remapping. This allows base engine tag category meta data to remap to multiple project-specific categories. */
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsManager.cpp:557
Scope (from outer to inner):
file
function void UGameplayTagsManager::ConstructGameplayTagTree
Source code excerpt:
}
bUseFastReplication = MutableDefault->FastReplication;
bShouldWarnOnInvalidTags = MutableDefault->WarnOnInvalidTags;
bShouldClearInvalidTags = MutableDefault->ClearInvalidTags;
NumBitsForContainerSize = MutableDefault->NumBitsForContainerSize;
NetIndexFirstBitSegment = MutableDefault->NetIndexFirstBitSegment;
#if WITH_EDITOR
#Loc: <Workspace>/Engine/Source/Runtime/GameplayTags/Private/GameplayTagsSettings.cpp:64
Scope (from outer to inner):
file
function UGameplayTagsSettings::UGameplayTagsSettings
Source code excerpt:
WarnOnInvalidTags = true;
ClearInvalidTags = false;
FastReplication = false;
AllowEditorTagUnloading = true;
AllowGameTagUnloading = false;
InvalidTagCharacters = ("\"',");
NumBitsForContainerSize = 6;
NetIndexFirstBitSegment = 16;
}