SocialSettings.MaxPartySize

SocialSettings.MaxPartySize

#Overview

name: SocialSettings.MaxPartySize

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 SocialSettings.MaxPartySize is to control the maximum number of players allowed in a persistent party within the social system of Unreal Engine 5. This setting is primarily used for multiplayer game functionality and social features.

This setting variable is primarily used by the Online Framework plugin, specifically within the Party module. It’s part of the social system that manages player grouping and interaction in multiplayer games.

The value of this variable is not directly set in the provided code snippets. Instead, it’s associated with a console variable named MaxPartySizeOverride, which can be used to override the default maximum party size at runtime.

The MaxPartySizeOverride variable interacts with SocialSettings.MaxPartySize. It’s used to provide a way to override the maximum party size without changing the game code, which is particularly useful for testing and debugging.

Developers must be aware that this variable is only available in non-shipping builds (as indicated by the #if !UE_BUILD_SHIPPING preprocessor directive). This means it’s intended for development and testing purposes, not for use in final released games.

Best practices when using this variable include:

  1. Use it for testing different party size configurations during development.
  2. Remember that it won’t be available in shipping builds, so don’t rely on it for release versions of the game.
  3. Consider using it in conjunction with the command line parameter “MaxPartySize=” for easy testing of different party sizes.

Regarding the associated variable MaxPartySizeOverride:

The purpose of MaxPartySizeOverride is to provide a runtime method to change the maximum party size, primarily for testing and debugging purposes.

This variable is used within the Party module of the Online Framework plugin, specifically in the SocialSettings class.

The value of MaxPartySizeOverride is set through a console variable, which means it can be changed at runtime through the console or configuration files.

It interacts directly with the SocialSettings.MaxPartySize setting, effectively overriding it when set to a value greater than 0.

Developers should be aware that this override is only available in non-shipping builds, making it a development tool rather than a feature for released games.

Best practices for using MaxPartySizeOverride include:

  1. Use it for quick iterations on party size testing without needing to recompile the game.
  2. Remember to reset it to INDEX_NONE (effectively disabling the override) when not actively testing different party sizes.
  3. Be cautious about using very large values, as they might stress other parts of the game systems not designed for extremely large parties.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Online/OnlineFramework/Source/Party/Private/SocialSettings.cpp:11

Scope: file

Source code excerpt:

int32 MaxPartySizeOverride = INDEX_NONE;
FAutoConsoleVariableRef CVarMaxPartySize(
	TEXT("SocialSettings.MaxPartySize"),
	MaxPartySizeOverride,
	TEXT("Override the maximum persistent party size allowed by the social system"));
#endif

USocialSettings::USocialSettings()
{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Online/OnlineFramework/Source/Party/Private/SocialSettings.cpp:9

Scope: file

Source code excerpt:


#if !UE_BUILD_SHIPPING
int32 MaxPartySizeOverride = INDEX_NONE;
FAutoConsoleVariableRef CVarMaxPartySize(
	TEXT("SocialSettings.MaxPartySize"),
	MaxPartySizeOverride,
	TEXT("Override the maximum persistent party size allowed by the social system"));
#endif

USocialSettings::USocialSettings()
{
	// Switch is the only default supported OSS that does not itself support multiple environments

#Loc: <Workspace>/Engine/Plugins/Online/OnlineFramework/Source/Party/Private/SocialSettings.cpp:62

Scope (from outer to inner):

file
function     int32 USocialSettings::GetDefaultMaxPartySize

Source code excerpt:

{
#if !UE_BUILD_SHIPPING
	if (MaxPartySizeOverride > 0)
	{
		return MaxPartySizeOverride;
	}

	static FString CommandLineOverridePartySize;
	if (FParse::Value(FCommandLine::Get(), TEXT("MaxPartySize="), CommandLineOverridePartySize))
	{
		return FCString::Atoi(*CommandLineOverridePartySize);