au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup
au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup
#Overview
name: au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Disables searching the asset registry on startup of the singleton. Otherwise it will incrementally fill cache
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup is to control the caching behavior of SoundWave assets on editor startup in Unreal Engine 5. Specifically, it determines whether the engine should cache all SoundWave loading behaviors immediately upon startup or fill the cache incrementally.
This setting variable is primarily used in the Engine’s audio system, particularly in the SoundWave asset loading mechanism. Based on the callsites, it’s part of the Engine’s runtime module, specifically within the sound-related classes and utilities.
The value of this variable is set through a console variable (CVAR) system, which allows it to be changed at runtime or through configuration files. It’s initialized to 0 by default, meaning the incremental cache filling is the default behavior.
The associated variable SoundWaveLoadingBehaviorUtil_CacheAllOnStartup directly interacts with this setting. They share the same value, and the associated variable is used within the engine’s C++ code to control the behavior.
Developers should be aware that enabling this setting (setting it to 1) will cause the engine to cache all SoundWave loading behaviors on startup. This might lead to longer startup times but could potentially improve performance during runtime by having all behaviors pre-cached.
Best practices when using this variable include:
- Leave it disabled (0) for faster editor startup times during development.
- Consider enabling it (1) for final builds or when preparing for performance testing, as it might provide more consistent audio loading behavior.
- Be mindful of the potential memory impact when enabling this feature, especially for projects with a large number of SoundWave assets.
Regarding the associated variable SoundWaveLoadingBehaviorUtil_CacheAllOnStartup:
- Its purpose is to directly control the caching behavior within the C++ code of the engine.
- It’s used in the FSoundWaveLoadingBehaviorUtil class constructor to determine whether to call CacheAllClassLoadingBehaviors() on startup.
- The value is set by the console variable system, mirroring the au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup setting.
- It interacts closely with other audio-related systems in the engine, particularly those dealing with SoundWave asset loading.
- Developers should be aware that this variable directly affects the behavior of the FSoundWaveLoadingBehaviorUtil class, which is likely a core component of the engine’s audio system.
- Best practices include ensuring consistency between this variable and the console variable setting, and considering the performance implications of enabling or disabling this feature in different scenarios (development, testing, release builds).
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Sound/SoundWaveLoadingBehavior.cpp:31
Scope: file
Source code excerpt:
static int32 SoundWaveLoadingBehaviorUtil_CacheAllOnStartup = 0;
FAutoConsoleVariableRef CVAR_SoundWaveLoadingBehaviorUtil_CacheAllOnStartup(
TEXT("au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup"),
SoundWaveLoadingBehaviorUtil_CacheAllOnStartup,
TEXT("Disables searching the asset registry on startup of the singleton. Otherwise it will incrementally fill cache"),
ECVF_Default
);
static int32 SoundWaveLoadingBehaviorUtil_Enable = 1;
#Associated Variable and Callsites
This variable is associated with another variable named SoundWaveLoadingBehaviorUtil_CacheAllOnStartup
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Sound/SoundWaveLoadingBehavior.cpp:29
Scope: file
Source code excerpt:
#if WITH_EDITOR
static int32 SoundWaveLoadingBehaviorUtil_CacheAllOnStartup = 0;
FAutoConsoleVariableRef CVAR_SoundWaveLoadingBehaviorUtil_CacheAllOnStartup(
TEXT("au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup"),
SoundWaveLoadingBehaviorUtil_CacheAllOnStartup,
TEXT("Disables searching the asset registry on startup of the singleton. Otherwise it will incrementally fill cache"),
ECVF_Default
);
static int32 SoundWaveLoadingBehaviorUtil_Enable = 1;
FAutoConsoleVariableRef CVAR_SoundWaveLoadingBehaviorUtil_Enable(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Sound/SoundWaveLoadingBehavior.cpp:51
Scope (from outer to inner):
file
class class FSoundWaveLoadingBehaviorUtil : public ISoundWaveLoadingBehaviorUtil
function FSoundWaveLoadingBehaviorUtil
Source code excerpt:
: AssetRegistry(FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry")).Get())
{
if (SoundWaveLoadingBehaviorUtil_CacheAllOnStartup)
{
CacheAllClassLoadingBehaviors();
}
}
virtual ~FSoundWaveLoadingBehaviorUtil() override = default;