MaxRemoteTalkers
MaxRemoteTalkers
#Overview
name: MaxRemoteTalkers
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 10
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MaxRemoteTalkers is to set the maximum number of remote talkers supported in the voice communication system of Unreal Engine 5. This setting is crucial for managing voice chat capabilities in multiplayer games or applications.
The Unreal Engine subsystem that primarily relies on this setting variable is the Online Subsystem, specifically within the voice communication components. It is used in the OnlineSubsystemUtils plugin, which provides implementations for various online features, including voice chat.
The value of MaxRemoteTalkers is typically set in the DefaultEngine.ini configuration file under the [OnlineSubsystem] section. If not specified in the configuration file, the engine will use a default value (often defined as MAX_REMOTE_TALKERS).
MaxRemoteTalkers interacts with other variables such as MaxLocalTalkers, which sets the maximum number of local talkers. Together, these variables define the capacity of the voice chat system.
Developers must be aware that:
- This setting directly impacts the resources allocated for voice communication.
- It should be set appropriately based on the game’s multiplayer design and expected number of concurrent players in voice chat.
- Setting it too high might waste resources, while setting it too low could limit the voice chat functionality.
Best practices when using this variable include:
- Carefully consider the game’s requirements and set an appropriate value in the configuration file.
- Monitor voice chat performance and adjust the value if necessary during development and testing.
- Ensure that the value aligns with any network bandwidth limitations and server capacity.
- Document the chosen value and its implications for the development team and potential modders.
- Consider making this value configurable for server administrators in multiplayer games.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2233, section: [OnlineSubsystem]
- INI Section:
OnlineSubsystem
- Raw value:
16
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystem/Source/Public/Interfaces/VoiceInterface.h:58
Scope (from outer to inner):
file
class class IVoiceEngine
Source code excerpt:
*
* @param MaxLocalTalkers maximum number of local talkers to support
* @param MaxRemoteTalkers maximum number of remote talkers to support
*/
virtual bool Init(int32 MaxLocalTalkers, int32 MaxRemoteTalkers) = 0;
public:
/** Virtual destructor to force proper child cleanup */
virtual ~IVoiceEngine() {}
/**
* Starts local voice processing for the specified user index
*
* @param UserIndex the user to start processing for
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineSubsystemUtils.cpp:363
Scope (from outer to inner):
file
function bool HandleVoiceCommands
Source code excerpt:
}
int32 MaxRemoteTalkers = 0;
if (!GConfig->GetInt(TEXT("OnlineSubsystem"), TEXT("MaxRemoteTalkers"), MaxRemoteTalkers, GEngineIni))
{
UE_LOG_ONLINE_VOICE(Warning, TEXT("Missing MaxRemoteTalkers key in OnlineSubsystem of DefaultEngine.ini"));
}
float VoiceNotificationDelta = 0.0f;
if (!GConfig->GetFloat(TEXT("OnlineSubsystem"), TEXT("VoiceNotificationDelta"), VoiceNotificationDelta, GEngineIni))
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineSubsystemUtils.cpp:403
Scope (from outer to inner):
file
function bool HandleVoiceCommands
Source code excerpt:
UE_LOG_ONLINE_VOICE(Display, TEXT("Ducking Opt Out Enabled: %s"), bDuckingOptOut ? TEXT("true") : TEXT("false"));
UE_LOG_ONLINE_VOICE(Display, TEXT("Max Local Talkers: %d"), MaxLocalTalkers);
UE_LOG_ONLINE_VOICE(Display, TEXT("Max Remote Talkers: %d"), MaxRemoteTalkers);
UE_LOG_ONLINE_VOICE(Display, TEXT("Notification Delta: %0.2f"), VoiceNotificationDelta);
UE_LOG_ONLINE_VOICE(Display, TEXT("Voice Requires Push To Talk: %s"), bRequiresPushToTalk ? TEXT("true") : TEXT("false"));
TArray<FString> OutArray;
VoiceDump.ParseIntoArray(OutArray, TEXT("\n"), false);
for (const FString& Str : OutArray)
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceEngineImpl.cpp:270
Scope (from outer to inner):
file
function bool FVoiceEngineImpl::Init
Source code excerpt:
}
bool FVoiceEngineImpl::Init(int32 MaxLocalTalkers, int32 MaxRemoteTalkers)
{
bool bSuccess = false;
IOnlineSubsystem* OnlineSub = GetOnlineSubSystem();
if (OnlineSub && !OnlineSub->IsDedicated())
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:31
Scope (from outer to inner):
file
function bool FOnlineVoiceImpl::Init
Source code excerpt:
UE_LOG_ONLINE_VOICE(Warning, TEXT("Missing MaxLocalTalkers key in OnlineSubsystem of DefaultEngine.ini"));
}
if (!GConfig->GetInt(TEXT("OnlineSubsystem"),TEXT("MaxRemoteTalkers"), MaxRemoteTalkers, GEngineIni))
{
MaxRemoteTalkers = MAX_REMOTE_TALKERS;
UE_LOG_ONLINE_VOICE(Warning, TEXT("Missing MaxRemoteTalkers key in OnlineSubsystem of DefaultEngine.ini"));
}
if (!GConfig->GetFloat(TEXT("OnlineSubsystem"),TEXT("VoiceNotificationDelta"), VoiceNotificationDelta, GEngineIni))
{
VoiceNotificationDelta = 0.2;
UE_LOG_ONLINE_VOICE(Warning, TEXT("Missing VoiceNotificationDelta key in OnlineSubsystem of DefaultEngine.ini"));
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:58
Scope (from outer to inner):
file
function bool FOnlineVoiceImpl::Init
Source code excerpt:
{
VoiceEngine = CreateVoiceEngine();
bSuccess = VoiceEngine->Init(MaxLocalTalkers, MaxRemoteTalkers);
}
else
{
MaxLocalTalkers = 0;
MaxRemoteTalkers = 0;
}
}
LocalTalkers.Init(FLocalTalker(), MaxLocalTalkers);
RemoteTalkers.Empty(MaxRemoteTalkers);
if (!bSuccess)
{
// Not necessary to log here since VoiceEngine::Init() will report its own failure
//UE_LOG_ONLINE_VOICE(Warning, TEXT("Failed to initialize voice interface"));
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:393
Scope (from outer to inner):
file
function void FOnlineVoiceImpl::RemoveAllRemoteTalkers
Source code excerpt:
// Empty the array now that they are all unregistered
RemoteTalkers.Empty(MaxRemoteTalkers);
}
FRemoteTalker* FOnlineVoiceImpl::FindRemoteTalker(const FUniqueNetId& UniqueId)
{
for (int32 Index = 0; Index < RemoteTalkers.Num(); Index++)
{
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/VoiceEngineImpl.h:262
Scope (from outer to inner):
file
class class FVoiceEngineImpl : public IVoiceEngine, public FSelfRegisteringExec, public IDeviceChangedListener
Source code excerpt:
// IVoiceEngine
virtual bool Init(int32 MaxLocalTalkers, int32 MaxRemoteTalkers) override;
public:
FVoiceEngineImpl(IOnlineSubsystem* InSubsystem);
virtual ~FVoiceEngineImpl();
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/VoiceInterfaceImpl.h:23
Scope (from outer to inner):
file
class class FOnlineVoiceImpl : public IOnlineVoice
Source code excerpt:
int32 MaxLocalTalkers;
/** Maximum permitted remote talkers */
int32 MaxRemoteTalkers;
/** State of all possible local talkers */
TArray<FLocalTalker> LocalTalkers;
/** State of all possible remote talkers */
TArray<FRemoteTalker> RemoteTalkers;
/** Remote players locally muted explicitly */
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/VoiceInterfaceImpl.h:76
Scope (from outer to inner):
file
class class FOnlineVoiceImpl : public IOnlineVoice
Source code excerpt:
VoiceEngine(NULL),
MaxLocalTalkers(MAX_SPLITSCREEN_TALKERS),
MaxRemoteTalkers(MAX_REMOTE_TALKERS),
VoiceNotificationDelta(0.0f)
{};
// IOnlineVoice
virtual bool Init() override;
virtual void ProcessMuteChangeNotification() override;