DefaultReplicationGraphClass

DefaultReplicationGraphClass

#Overview

name: DefaultReplicationGraphClass

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 DefaultReplicationGraphClass is to specify the default class to use for the Lyra game’s replication graph. It’s a crucial setting for the networking and replication system in Unreal Engine 5, specifically tailored for the Lyra game project.

This setting variable is primarily used by the Lyra game’s replication system, which is part of the networking subsystem. It’s referenced in the LyraReplicationGraph module, which is likely a custom implementation of Unreal Engine’s replication graph system for the Lyra game.

The value of this variable is set in the constructor of ULyraReplicationGraphSettings, where it’s initialized to ULyraReplicationGraph::StaticClass(). However, it’s also defined as a configurable property, meaning it can be modified through project settings or configuration files.

This variable interacts with other replication-related settings, such as bEnableFastSharedPath, which enables fast shared path replication, and TargetKBytesSecFastSharedPath, which controls bandwidth usage for fast shared movement updates.

Developers must be aware that this variable determines the class used for creating the replication graph, which is crucial for network performance and gameplay synchronization. Changing this value could significantly impact the game’s networking behavior.

Best practices when using this variable include:

  1. Ensure the specified class is a valid subclass of ULyraReplicationGraph.
  2. Test thoroughly after any changes to this setting, as it can have wide-ranging effects on network gameplay.
  3. Consider the implications on performance and bandwidth usage when customizing the replication graph class.
  4. Use this in conjunction with other replication settings for optimal network performance.
  5. Document any custom replication graph implementations thoroughly for team understanding and maintenance.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:227, section: [/Script/LyraGame.LyraReplicationGraphSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/System/LyraReplicationGraph.cpp:148

Scope (from outer to inner):

file
namespace    Lyra::RepGraph
function     UReplicationDriver* ConditionalCreateReplicationDriver

Source code excerpt:

			UE_LOG(LogLyraRepGraph, Display, TEXT("Replication graph is enabled for %s in world %s."), *GetNameSafe(ForNetDriver), *GetPathNameSafe(World));

			TSubclassOf<ULyraReplicationGraph> GraphClass = LyraRepGraphSettings->DefaultReplicationGraphClass.TryLoadClass<ULyraReplicationGraph>();
			if (GraphClass.Get() == nullptr)
			{
				GraphClass = ULyraReplicationGraph::StaticClass();
			}

			ULyraReplicationGraph* LyraReplicationGraph = NewObject<ULyraReplicationGraph>(GetTransientPackage(), GraphClass.Get());

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/System/LyraReplicationGraphSettings.cpp:7

Scope (from outer to inner):

file
function     ULyraReplicationGraphSettings::ULyraReplicationGraphSettings

Source code excerpt:

{
	CategoryName = TEXT("Game");
	DefaultReplicationGraphClass = ULyraReplicationGraph::StaticClass();
}

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/System/LyraReplicationGraphSettings.h:24

Scope (from outer to inner):

file
class        class ULyraReplicationGraphSettings : public UDeveloperSettingsBackedByCVars

Source code excerpt:


	UPROPERTY(config, EditAnywhere, Category = ReplicationGraph, meta = (MetaClass = "/Script/LyraGame.LyraReplicationGraph"))
	FSoftClassPath DefaultReplicationGraphClass;

	UPROPERTY(EditAnywhere, Category = FastSharedPath, meta = (ConsoleVariable = "Lyra.RepGraph.EnableFastSharedPath"))
	bool bEnableFastSharedPath = true;

	// How much bandwidth to use for FastShared movement updates. This is counted independently of the NetDriver's target bandwidth.
	UPROPERTY(EditAnywhere, Category = FastSharedPath, meta = (ForceUnits=Kilobytes, ConsoleVariable = "Lyra.RepGraph.TargetKBytesSecFastSharedPath"))