Concert.EnablePresenceInGame
Concert.EnablePresenceInGame
#Overview
name: Concert.EnablePresenceInGame
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable Concert Presence in Game
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.EnablePresenceInGame
is to control whether Concert Presence functionality is enabled in the game mode of Unreal Engine. This setting is part of the Concert collaboration system, which is used for real-time multi-user editing and synchronization in Unreal Engine.
This setting variable is primarily used by the ConcertSync plugin, specifically within the ConcertSyncClient module. Based on the callsites, it’s clear that this variable is used to determine the behavior of the AConcertClientPresenceActor
class.
The value of this variable is set as a console variable, which means it can be changed at runtime through the console or configuration files. It’s initialized with a default value of 0, indicating that Concert Presence is disabled in game mode by default.
The associated variable CVarEnablePresenceInGame
is directly linked to Concert.EnablePresenceInGame
. It’s implemented as a TAutoConsoleVariable<int32>
, which is the standard way to create console variables in Unreal Engine.
Developers must be aware that:
- This variable affects whether Concert Presence actors are considered editor-only or not.
- Changing this variable can impact the visibility and behavior of presence-related features in game mode.
Best practices when using this variable include:
- Only enable it when necessary, as it may have performance implications in game mode.
- Consider the implications on multiplayer scenarios if enabled.
- Use it in conjunction with other Concert system settings for a cohesive collaboration experience.
Regarding the associated variable CVarEnablePresenceInGame
:
- It’s the C++ representation of the
Concert.EnablePresenceInGame
console variable. - It’s used to query the current value of the setting, as seen in the
AConcertClientPresenceActor
constructor. - The
GetValueOnAnyThread()
method is used to safely retrieve its value, which determines if the actor is editor-only.
Developers should note that changes to CVarEnablePresenceInGame
will directly affect the behavior of AConcertClientPresenceActor
instances. When the value is 0, these actors are set as editor-only, which means they won’t be visible or active in the game mode. When set to a non-zero value, these actors will be present in the game mode, potentially enabling collaborative features during gameplay or game testing scenarios.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientPresenceActor.cpp:21
Scope: file
Source code excerpt:
#define LOCTEXT_NAMESPACE "ConcertClientPresenceActor"
static TAutoConsoleVariable<int32> CVarEnablePresenceInGame(TEXT("Concert.EnablePresenceInGame"), 0, TEXT("Enable Concert Presence in Game"));
//////////////////////////////////////////////////////////////////////////
// AConcertClientPresenceActor
AConcertClientPresenceActor::AConcertClientPresenceActor(const FObjectInitializer& ObjectInitializer)
#Associated Variable and Callsites
This variable is associated with another variable named CVarEnablePresenceInGame
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientPresenceActor.cpp:21
Scope: file
Source code excerpt:
#define LOCTEXT_NAMESPACE "ConcertClientPresenceActor"
static TAutoConsoleVariable<int32> CVarEnablePresenceInGame(TEXT("Concert.EnablePresenceInGame"), 0, TEXT("Enable Concert Presence in Game"));
//////////////////////////////////////////////////////////////////////////
// AConcertClientPresenceActor
AConcertClientPresenceActor::AConcertClientPresenceActor(const FObjectInitializer& ObjectInitializer)
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertSync/ConcertSyncClient/Source/ConcertSyncClient/Private/ConcertClientPresenceActor.cpp:31
Scope (from outer to inner):
file
function AConcertClientPresenceActor::AConcertClientPresenceActor
Source code excerpt:
{
// Initialize if this actor will be editor only based the `EnablePresenceInGame` console variable.
bIsEditorOnlyActor = CVarEnablePresenceInGame.GetValueOnAnyThread() == 0;
// Set root component
{
USceneComponent* SceneRootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
AddOwnedComponent(SceneRootComponent);
SetRootComponent(SceneRootComponent);