bSubtitlesEnabled

bSubtitlesEnabled

#Overview

name: bSubtitlesEnabled

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 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bSubtitlesEnabled is to control the display of subtitles for localized sounds in Unreal Engine 5. It acts as a global flag to enable or disable the subtitle system across the engine.

This setting variable is primarily used by the Engine and Audio subsystems of Unreal Engine 5. Based on the callsites, it’s referenced in the UEngine class and utilized in gameplay-related functionality and subtitle management.

The value of this variable is set in the UEngine class as a config property, which means it can be configured in the engine’s configuration files. It can also be dynamically set at runtime using the UGameplayStatics::SetSubtitlesEnabled function.

bSubtitlesEnabled interacts with another variable, bSubtitlesForcedOff. When bSubtitlesForcedOff is true, it overrides bSubtitlesEnabled, forcibly disabling subtitles regardless of the bSubtitlesEnabled value.

Developers must be aware that this is a global setting affecting all subtitle displays in the game. Changes to this variable will impact the entire subtitle system, not just specific instances or areas of the game.

Best practices when using this variable include:

  1. Use UGameplayStatics::SetSubtitlesEnabled and UGameplayStatics::AreSubtitlesEnabled for getting and setting the value, rather than directly accessing the UEngine property.
  2. Consider providing an in-game option for players to toggle subtitles on/off, which would modify this setting.
  3. Be mindful of the interaction with bSubtitlesForcedOff when implementing subtitle-related features.
  4. When disabling subtitles, ensure that critical information conveyed through subtitles is available through other means to maintain accessibility.
  5. Use this setting in conjunction with localization systems to provide a comprehensive language support solution in your game.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:277, section: [/Script/Engine.Engine]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h:1438

Scope (from outer to inner):

file
class        class UEngine : public UObject , public FExec

Source code excerpt:

	/** Flag for completely disabling subtitles for localized sounds. */
	UPROPERTY(EditAnywhere, config, Category=Subtitles)
	uint32 bSubtitlesEnabled:1;

	/** Flag for forcibly disabling subtitles even if you try to turn them back on they will be off */
	UPROPERTY(EditAnywhere, config, Category=Subtitles)
	uint32 bSubtitlesForcedOff:1;

	/** Script maximum loop iteration count used as a threshold to warn users about script execution runaway */

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp:1892

Scope (from outer to inner):

file
function     void UGameplayStatics::SetSubtitlesEnabled

Source code excerpt:

	if (GEngine)
	{
		GEngine->bSubtitlesEnabled = bEnabled;
	}
}

bool UGameplayStatics::AreSubtitlesEnabled()
{
	if (GEngine)
	{
		return GEngine->bSubtitlesEnabled;
	}
	return 0;
}

void UGameplayStatics::SetBaseSoundMix(const UObject* WorldContextObject, USoundMix* InSoundMix)
{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SubtitleManager.cpp:433

Scope (from outer to inner):

file
function     void FSubtitleManager::DisplaySubtitles

Source code excerpt:

		check(InCanvas);

		if (GEngine->bSubtitlesForcedOff || !GEngine->bSubtitlesEnabled)
		{
			return; // do nothing if subtitles are disabled.
		}

		if (!GEngine->GetSubtitleFont())
		{