LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest

LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest

#Overview

name: LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest is to control whether the server should wait for client acknowledgment before considering streaming levels as visible to the client in Unreal Engine’s level streaming system.

This setting variable is primarily used in the level streaming subsystem of Unreal Engine. It is part of the Engine module, specifically within the LevelStreaming functionality.

The value of this variable is set through a console variable (CVar) system. It is initialized based on whether the UE_WITH_IRIS macro is defined. If UE_WITH_IRIS is defined, it’s set to true; otherwise, it’s set to false.

This variable interacts directly with its associated variable bShouldServerUseMakingVisibleTransactionRequest. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable affects the synchronization between server and client during level streaming. When enabled, it adds an extra step in the process where the server waits for client confirmation before considering a level visible.

Best practices when using this variable include:

  1. Consider the network performance implications when enabling this feature.
  2. Use it in conjunction with other level streaming settings for optimal performance.
  3. Test thoroughly in both single-player and multiplayer scenarios to ensure desired behavior.

Regarding the associated variable bShouldServerUseMakingVisibleTransactionRequest:

This is the actual boolean variable that stores the setting value. It is used directly in the ULevelStreaming::ShouldServerUseMakingVisibleTransactionRequest() function, which likely influences the level streaming behavior throughout the engine.

The variable is defined within the LevelStreamingCVars namespace, suggesting it’s part of a group of related level streaming console variables.

Developers should note that this variable’s value can be changed at runtime through the console, which allows for dynamic adjustment of the level streaming behavior. However, changing this value during gameplay might lead to unexpected behavior, so it should be done with caution.

When using this variable, developers should consider the potential impact on network traffic and client-side performance, especially in multiplayer scenarios with frequent level streaming events.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelStreaming.cpp:75

Scope (from outer to inner):

file
namespace    LevelStreamingCVars

Source code excerpt:

#endif
	FAutoConsoleVariableRef CVarShouldServerUseMakingVisibleTransactionRequest(
		TEXT("LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest"),
		bShouldServerUseMakingVisibleTransactionRequest,
		TEXT("Whether server should wait for client to acknowledge visibility update before treating streaming levels as visible by the client.\n")
		TEXT("0: Disable, 1: Enable"),
		ECVF_Default);

	static bool bShouldReuseUnloadedButStillAroundLevels = true;

#Associated Variable and Callsites

This variable is associated with another variable named bShouldServerUseMakingVisibleTransactionRequest. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelStreaming.cpp:70

Scope (from outer to inner):

file
namespace    LevelStreamingCVars

Source code excerpt:


#if UE_WITH_IRIS
	static bool bShouldServerUseMakingVisibleTransactionRequest = true;
#else
	static bool bShouldServerUseMakingVisibleTransactionRequest = false;
#endif
	FAutoConsoleVariableRef CVarShouldServerUseMakingVisibleTransactionRequest(
		TEXT("LevelStreaming.ShouldServerUseMakingVisibleTransactionRequest"),
		bShouldServerUseMakingVisibleTransactionRequest,
		TEXT("Whether server should wait for client to acknowledge visibility update before treating streaming levels as visible by the client.\n")
		TEXT("0: Disable, 1: Enable"),
		ECVF_Default);

	static bool bShouldReuseUnloadedButStillAroundLevels = true;
	FAutoConsoleVariableRef CVarShouldReuseUnloadedButStillAroundLevels(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelStreaming.cpp:126

Scope (from outer to inner):

file
function     bool ULevelStreaming::ShouldServerUseMakingVisibleTransactionRequest

Source code excerpt:

bool ULevelStreaming::ShouldServerUseMakingVisibleTransactionRequest()
{
	return LevelStreamingCVars::bShouldServerUseMakingVisibleTransactionRequest;
}

bool ULevelStreaming::ShouldReuseUnloadedButStillAroundLevels(const ULevel* InLevel)
{
#if WITH_EDITOR
	if (InLevel && InLevel->GetForceCantReuseUnloadedButStillAround())