au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup

au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup

#Overview

name: au.editor.SoundWaveOwnerLoadingBehaviorCacheOnStartup

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 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:

  1. Leave it disabled (0) for faster editor startup times during development.
  2. Consider enabling it (1) for final builds or when preparing for performance testing, as it might provide more consistent audio loading behavior.
  3. 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:

#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;