LoadMapTimeLimit
LoadMapTimeLimit
#Overview
name: LoadMapTimeLimit
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 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of LoadMapTimeLimit is to set a maximum time limit for streaming resources when loading a map in Unreal Engine 5. This variable is primarily used in the content streaming system, which is responsible for efficiently loading and managing game assets.
The LoadMapTimeLimit variable is primarily used by the FStreamingManagerCollection class, which is part of the Engine module’s content streaming subsystem. This subsystem is crucial for managing the loading and streaming of various game assets, including textures, audio, and other renderable assets.
The value of this variable is initially set to 5.0 seconds in the FStreamingManagerCollection constructor. However, it can be overridden by a value specified in the GEngineIni configuration file under the [TextureStreaming] section.
LoadMapTimeLimit interacts with the TimeLimit parameter in the StreamAllResources function. If the TimeLimit parameter is nearly zero, the function uses LoadMapTimeLimit as the default time limit for streaming resources.
Developers should be aware of the following when using this variable:
- It directly affects the loading time of maps and the responsiveness of the game during map transitions.
- Setting it too low might result in incomplete resource streaming, potentially causing visual or audio glitches.
- Setting it too high could lead to longer loading times, which may negatively impact the player experience.
Best practices when using this variable include:
- Adjust the value based on the specific needs of your game and the target hardware capabilities.
- Monitor and profile the resource streaming process to find an optimal balance between loading speed and completeness.
- Consider allowing players to adjust this value in the game settings, especially for games with varying asset complexity across different levels.
- Use in conjunction with other streaming optimization techniques, such as prioritizing critical assets or implementing progressive loading strategies.
- Regularly test with different values during development to ensure smooth map transitions across various scenarios and hardware configurations.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:1814, section: [TextureStreaming]
- INI Section:
TextureStreaming
- Raw value:
20.0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:768
Scope (from outer to inner):
file
function FStreamingManagerCollection::FStreamingManagerCollection
Source code excerpt:
: NumIterations(1)
, DisableResourceStreamingCount(0)
, LoadMapTimeLimit(5.0f)
, RenderAssetStreamingManager(nullptr)
, NaniteCoarseMeshStreamingManager(nullptr)
{
#if PLATFORM_SUPPORTS_TEXTURE_STREAMING
// Disable texture streaming if that was requested (needs to happen before the call to ProcessNewlyLoadedUObjects, as that can load textures)
if( FParse::Param( FCommandLine::Get(), TEXT( "NoTextureStreaming" ) ) )
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:916
Scope (from outer to inner):
file
function int32 FStreamingManagerCollection::StreamAllResources
Source code excerpt:
if (FMath::IsNearlyZero(TimeLimit))
{
TimeLimit = LoadMapTimeLimit;
}
// Update resource streaming, making sure we process all textures.
UpdateResourceStreaming(0, true);
// Block till requests are finished, or time limit was reached.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:1317
Scope (from outer to inner):
file
function void FStreamingManagerCollection::AddOrRemoveTextureStreamingManagerIfNeeded
Source code excerpt:
FlushRenderingCommands();
GConfig->GetFloat( TEXT("TextureStreaming"), TEXT("LoadMapTimeLimit"), LoadMapTimeLimit, GEngineIni );
// Create the streaming manager and add the default streamers.
RenderAssetStreamingManager = new FRenderAssetStreamingManager();
AddStreamingManager( RenderAssetStreamingManager );
if (IsRenderAssetStreamingEnabled(EStreamableRenderAssetType::NaniteCoarseMesh))
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ContentStreaming.h:883
Scope: file
Source code excerpt:
/** Maximum number of seconds to block in StreamAllResources(), by default (.ini setting). */
float LoadMapTimeLimit;
/** The currently added texture streaming manager. Can be NULL*/
FRenderAssetStreamingManager* RenderAssetStreamingManager;
/** The audio streaming manager, should always exist */
IAudioStreamingManager* AudioStreamingManager;