au.Debug.Soundcues.ShowDistance

au.Debug.Soundcues.ShowDistance

#Overview

name: au.Debug.Soundcues.ShowDistance

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.Debug.Soundcues.ShowDistance is to enable the display of distance information for sound cues in the audio debugging system of Unreal Engine 5. This setting variable is primarily used for debugging and development purposes within the audio system.

This setting variable is relied upon by the Engine module, specifically within the audio debugging subsystem. It’s used to control the visibility of distance information for sound cues during runtime debugging.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a console variable (CVar) named “au.Debug.Soundcues.ShowDistance” and is associated with the C++ variable SoundCueDebugShowDistanceCVar.

The associated variable SoundCueDebugShowDistanceCVar directly interacts with au.Debug.Soundcues.ShowDistance. They share the same value, with SoundCueDebugShowDistanceCVar being the C++ representation of the console variable.

Developers must be aware that this variable is a binary flag (0 or 1). When enabled (set to 1), it will cause additional debug information to be rendered, which may impact performance. Therefore, it should be used judiciously, primarily during development and debugging sessions.

Best practices when using this variable include:

  1. Only enabling it when necessary for debugging sound cue distance issues.
  2. Disabling it in production builds to avoid unnecessary performance overhead.
  3. Using it in conjunction with other audio debugging tools for a comprehensive understanding of sound cue behavior.

Regarding the associated variable SoundCueDebugShowDistanceCVar:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:110

Scope: file

Source code excerpt:

static int32 SoundCueDebugShowDistanceCVar = 0;
FAutoConsoleVariableRef CVarAudioSoundCueDebugShowDistance(
	TEXT("au.Debug.Soundcues.ShowDistance"),
	SoundCueDebugShowDistanceCVar,
	TEXT("Display distance of sound cue when enabled.\n")
	TEXT("0: Not Enabled, 1: Enabled"),
	ECVF_Default);

static int32 SoundCueDebugMinimalCVar = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:108

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 SoundCueDebugShowDistanceCVar = 0;
FAutoConsoleVariableRef CVarAudioSoundCueDebugShowDistance(
	TEXT("au.Debug.Soundcues.ShowDistance"),
	SoundCueDebugShowDistanceCVar,
	TEXT("Display distance of sound cue when enabled.\n")
	TEXT("0: Not Enabled, 1: Enabled"),
	ECVF_Default);

static int32 SoundCueDebugMinimalCVar = 0;
FAutoConsoleVariableRef CVarAudioSoundCueDebugMinimal(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1585

Scope (from outer to inner):

file
namespace    Audio
function     int32 FAudioDebugger::RenderStatCues

Source code excerpt:

						CurrentX += NumberSpacing;

						if (SoundCueDebugShowDistanceCVar)
						{
							const FString DistanceText = FString::Printf(TEXT("%6.2f "), StatSoundInfo.Distance);
							Canvas->DrawShadowedString(CurrentX, Y, *DistanceText, StatsFont, bMutedOrSoloed ? Color : FColor::White);
							CurrentX += (NumberSpacing * 2);
						}