DefaultAmbientZoneSettings

DefaultAmbientZoneSettings

#Overview

name: DefaultAmbientZoneSettings

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 DefaultAmbientZoneSettings is to define the default interior settings for audio in Unreal Engine 5. It is used to apply ambient volumes to sounds that have “apply ambient volumes” set to true on their SoundClass.

This setting variable is primarily used by the Audio subsystem within Unreal Engine. It is referenced in the WorldSettings class and is utilized by the audio device to set default audio settings for the game world.

The value of this variable is set in the AWorldSettings class, which is part of the Engine module. It can be edited through the Unreal Editor’s property system, as indicated by the UPROPERTY macro with EditAnywhere and config specifiers.

DefaultAmbientZoneSettings interacts with DefaultReverbSettings, another audio-related setting in the WorldSettings class. Both of these settings are used together when setting the default audio settings for the world.

Developers should be aware that changes to this variable will affect the ambient audio settings across the entire game world. It’s important to consider how this default setting might interact with more specific audio settings in different areas of the game.

Best practices for using this variable include:

  1. Carefully considering the default values to ensure they provide a good baseline for the game’s audio.
  2. Using this as a starting point and then refining audio settings for specific areas or situations as needed.
  3. Being mindful of performance implications when adjusting these settings, as they can affect audio processing across the entire game.
  4. Testing the audio in various environments to ensure the default settings work well in different contexts.
  5. Collaborating closely with sound designers to determine the most appropriate default settings for the game’s audio aesthetic.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseGame.ini:180, section: [/Script/Engine.WorldSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/WorldSettings.h:758

Scope (from outer to inner):

file
class        class AWorldSettings : public AInfo, public IInterface_AssetUserData

Source code excerpt:

	/** Default interior settings applied to sounds that have "apply ambient volumes" set to true on their SoundClass. */
	UPROPERTY(EditAnywhere, config, Category=Audio)
	FInteriorSettings DefaultAmbientZoneSettings;

	/** Default Base SoundMix.																			*/
	UPROPERTY(EditAnywhere, Category=Audio)
	TObjectPtr<class USoundMix> DefaultBaseSoundMix;

#if WITH_EDITORONLY_DATA

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/LevelActor.cpp:1783

Scope (from outer to inner):

file
function     AAudioVolume* UWorld::GetAudioSettings

Source code excerpt:

	if( OutInteriorSettings )
	{
		*OutInteriorSettings = CurrentWorldSettings->DefaultAmbientZoneSettings;
	}

	return nullptr;
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldSettings.cpp:209

Scope (from outer to inner):

file
function     void AWorldSettings::PostRegisterAllComponents

Source code excerpt:

	if (FAudioDeviceHandle AudioDevice = World->GetAudioDevice())
	{
		AudioDevice->SetDefaultAudioSettings(World, DefaultReverbSettings, DefaultAmbientZoneSettings);
	}
}

UWorldPartition* AWorldSettings::GetWorldPartition() const
{
	return WorldPartition;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/WorldSettings.cpp:804

Scope (from outer to inner):

file
function     void AWorldSettings::InternalPostPropertyChanged

Source code excerpt:

void AWorldSettings::InternalPostPropertyChanged(FName PropertyName)
{
	if (PropertyName == GET_MEMBER_NAME_CHECKED(AWorldSettings, DefaultReverbSettings) || PropertyName == GET_MEMBER_NAME_CHECKED(AWorldSettings, DefaultAmbientZoneSettings))
{
		UWorld* World = GetWorld();
		if (FAudioDeviceHandle AudioDevice = World->GetAudioDevice())
	{
			AudioDevice->SetDefaultAudioSettings(World, DefaultReverbSettings, DefaultAmbientZoneSettings);
		}
	}
	else if (PropertyName == GET_MEMBER_NAME_CHECKED(AWorldSettings, bForceNoPrecomputedLighting) && bForceNoPrecomputedLighting)
	{
		FMessageDialog::Open( EAppMsgType::Ok, LOCTEXT("bForceNoPrecomputedLightingIsEnabled", "bForceNoPrecomputedLighting is now enabled, build lighting once to propagate the change (will remove existing precomputed lighting data)."));
	}