GlobalIdentifier

GlobalIdentifier

#Overview

name: GlobalIdentifier

The value of this variable can be defined or overridden in .ini config files. 10 .ini config files referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of GlobalIdentifier is to provide a unique identifier for each platform supported by Unreal Engine. It is a GUID (Globally Unique Identifier) that represents a specific platform throughout the engine’s codebase.

This setting variable is primarily used by the Core module of Unreal Engine, specifically within the DataDrivenPlatformInfoRegistry system. It’s also utilized by the Media module for platform identification purposes.

The value of this variable is set in the DataDrivenPlatformInfo.ini file and loaded into the FDataDrivenPlatformInfo structure during engine initialization. The LoadDDPIIniSettings function in DataDrivenPlatformInfoRegistry.cpp is responsible for reading this value from the configuration file.

GlobalIdentifier interacts with other platform-specific variables within the FDataDrivenPlatformInfo structure, such as bHasDedicatedGamepad, bDefaultInputStandardKeyboard, and bInputSupportConfigurable.

Developers must be aware that this variable is crucial for platform identification and should always have a valid, unique value for each platform. The engine performs a check to ensure that the GlobalIdentifier is not empty (FGuid()) when loading platform information.

Best practices when using this variable include:

  1. Ensuring that each platform has a unique GlobalIdentifier set in the DataDrivenPlatformInfo.ini file.
  2. Using the provided FDataDrivenPlatformInfoRegistry functions to access platform information rather than directly accessing the GlobalIdentifier.
  3. When adding support for new platforms, always assign a new, unique GUID as the GlobalIdentifier.
  4. Use the GlobalIdentifier for platform-specific logic or feature toggles that need to persist across different versions of the engine or project.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/Android/DataDrivenPlatformInfo.ini:11, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/IOS/DataDrivenPlatformInfo.ini:11, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Linux/DataDrivenPlatformInfo.ini:12, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/LinuxArm64/DataDrivenPlatformInfo.ini:13, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Mac/DataDrivenPlatformInfo.ini:12, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/TVOS/DataDrivenPlatformInfo.ini:5, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Unix/DataDrivenPlatformInfo.ini:5, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:9, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Config/Windows/DataDrivenPlatformInfo.ini:18, section: [DataDrivenPlatformInfo]

Location: <Workspace>/Engine/Platforms/VisionOS/Config/DataDrivenPlatformInfo.ini:5, section: [DataDrivenPlatformInfo]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/DataDrivenPlatformInfoRegistry.cpp:347

Scope (from outer to inner):

file
function     static void LoadDDPIIniSettings

Source code excerpt:

	DDPIGetBool(IniFile, TEXT("Freezing_bAlignBases"), Info.Freezing_bAlignBases);

	DDPIGetGuid(IniFile, TEXT("GlobalIdentifier"), Info.GlobalIdentifier);
	checkf(Info.GlobalIdentifier != FGuid(), TEXT("Platform %s didn't have a valid GlobalIdentifier set in DataDrivenPlatformInfo.ini"), *PlatformName.ToString());

	// NOTE: add more settings here!
	DDPIGetBool(IniFile, TEXT("bHasDedicatedGamepad"), Info.bHasDedicatedGamepad);
	DDPIGetBool(IniFile, TEXT("bDefaultInputStandardKeyboard"), Info.bDefaultInputStandardKeyboard);

	DDPIGetBool(IniFile, TEXT("bInputSupportConfigurable"), Info.bInputSupportConfigurable);

#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/DataDrivenPlatformInfoRegistry.h:137

Scope: file

Source code excerpt:


	// GUID to represent this platform forever
	FGuid GlobalIdentifier;

	// MemoryFreezing information, matches FPlatformTypeLayoutParameters - defaults are clang, noneditor
	uint32 Freezing_MaxFieldAlignment = 0xffffffff;
	bool Freezing_b32Bit = false;
	bool Freezing_bForce64BitMemoryImagePointers = false;
	bool Freezing_bAlignBases = false;

#Loc: <Workspace>/Engine/Source/Runtime/Media/Private/MediaModule.cpp:35

Scope (from outer to inner):

file
class        class FMediaModule : public IMediaModule
function     virtual FName GetPlatformName

Source code excerpt:

		for (auto& Pair : FDataDrivenPlatformInfoRegistry::GetAllPlatformInfos())
		{
			if (Pair.Value.GlobalIdentifier == PlatformGuid)
			{
				return Pair.Key;
			}
		}
		return FName();
	}

#Loc: <Workspace>/Engine/Source/Runtime/Media/Private/MediaModule.cpp:45

Scope (from outer to inner):

file
class        class FMediaModule : public IMediaModule
function     virtual FGuid GetPlatformGuid

Source code excerpt:

	virtual FGuid GetPlatformGuid(const FName& PlatformName) const override
	{
		return FDataDrivenPlatformInfoRegistry::GetPlatformInfo(PlatformName).GlobalIdentifier;
	}

	virtual const TArray<IMediaCaptureSupport*>& GetCaptureSupports() const override
	{
		return CaptureSupports;
	}