bEnableGameCenterSupport
bEnableGameCenterSupport
#Overview
name: bEnableGameCenterSupport
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. Also referenced in 1
C# build file meaning it may affect the build system logic.
#Summary
#Usage in the C++ source code
The purpose of bEnableGameCenterSupport is to control whether Game Center support should be enabled in the iOS version of the game. Game Center is Apple’s social gaming network that provides features like leaderboards, achievements, and multiplayer functionality.
This setting variable is primarily used by the iOS Online Subsystem, which is part of the OnlineSubsystemIOS plugin in Unreal Engine. This plugin is responsible for integrating iOS-specific online features into the game.
The value of this variable is set in the IOSRuntimeSettings class, which is defined in the IOSRuntimeSettings module. It is declared as a UPROPERTY with the GlobalConfig and EditAnywhere specifiers, meaning it can be edited in the project settings and saved in the game’s configuration files.
The bEnableGameCenterSupport variable interacts with other iOS-specific settings, such as bEnableCloudKitSupport, which controls CloudKit integration. These settings work together to determine which iOS online features are available in the game.
Developers must be aware that enabling Game Center support will require additional setup in the Apple Developer portal and Xcode project settings. They should also consider the implications of enabling this feature on their game’s design and user experience.
Best practices when using this variable include:
- Only enable it if you plan to use Game Center features in your game.
- Ensure that your game’s design accommodates Game Center functionality if enabled.
- Test thoroughly on iOS devices to ensure proper integration and functionality.
- Keep in mind that enabling Game Center may require additional certifications or approvals during the App Store submission process.
- Consider providing alternative features or graceful degradation for users who don’t have Game Center enabled on their devices.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2978, section: [/Script/IOSRuntimeSettings.IOSRuntimeSettings]
- INI Section:
/Script/IOSRuntimeSettings.IOSRuntimeSettings
- Raw value:
False
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/IOS/OnlineSubsystemIOS/Source/Private/OnlineSubsystemIOS.cpp:309
Scope (from outer to inner):
file
function bool FOnlineSubsystemIOS::IsGameCenterEnabled
Source code excerpt:
{
bool bEnableGameCenter = false;
GConfig->GetBool(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("bEnableGameCenterSupport"), bEnableGameCenter, GEngineIni);
return bEnableGameCenter;
}
bool FOnlineSubsystemIOS::IsCloudKitEnabled()
{
#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Classes/IOSRuntimeSettings.h:181
Scope (from outer to inner):
file
class class UIOSRuntimeSettings : public UObject
Source code excerpt:
// Should Game Center support (iOS Online Subsystem) be enabled?
UPROPERTY(GlobalConfig, EditAnywhere, Category = Online, meta = (ConfigHierarchyEditable))
bool bEnableGameCenterSupport;
// Should Cloud Kit support (iOS Online Subsystem) be enabled?
UPROPERTY(GlobalConfig, EditAnywhere, Category = Online)
bool bEnableCloudKitSupport;
// iCloud Read stategy
#Loc: <Workspace>/Engine/Source/Runtime/IOS/IOSRuntimeSettings/Private/IOSRuntimeSettings.cpp:25
Scope (from outer to inner):
file
function UIOSRuntimeSettings::UIOSRuntimeSettings
Source code excerpt:
, CompressionQualityModifier(1)
{
bEnableGameCenterSupport = true;
bEnableCloudKitSupport = false;
bUserSwitching = false;
bSupportsPortraitOrientation = true;
bSupportsITunesFileSharing = false;
bSupportsFilesApp = false;
BundleDisplayName = TEXT("UnrealGame");
#References in C# build files
This variable is referenced in the following C# build files:
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/IOSExports.cs:343
// As of iOS15, to support GameCenter, "com.apple.developer.game-center" entitlement must be set
bool bEnableGameCenterSupport = false;
PlatformGameConfig.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableGameCenterSupport", out bEnableGameCenterSupport);
if (bEnableGameCenterSupport)
{
Text.AppendLine("\t<key>com.apple.developer.game-center</key>");
Text.AppendLine("\t<true/>");
}