a.EnableQueuedAnimEventsOnServer

a.EnableQueuedAnimEventsOnServer

#Overview

name: a.EnableQueuedAnimEventsOnServer

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

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 a.EnableQueuedAnimEventsOnServer is to control whether queued animation events are enabled on servers in Unreal Engine’s character movement system. This setting is particularly relevant for projects using Listen Servers.

This setting variable is primarily used by the Character Movement Component, which is part of Unreal Engine’s gameplay framework. It affects how animation events are processed on the server side.

The value of this variable is set using a console variable (CVar) system. It is initialized to 1 (enabled) by default, but can be changed at runtime through console commands or configuration files.

The associated variable EnableQueuedAnimEventsOnServer directly interacts with a.EnableQueuedAnimEventsOnServer. They share the same value and are used interchangeably in the code.

Developers must be aware that enabling this variable can impact server performance, as it allows for additional animation event processing that wouldn’t normally occur on the server. It’s particularly important for projects using Listen Servers, where the server is also acting as a client.

Best practices when using this variable include:

  1. Keep it enabled (default value of 1) for projects using Listen Servers.
  2. Consider disabling it (set to 0) for dedicated servers if animation events are not critical for server-side logic.
  3. Test thoroughly to ensure that enabling this doesn’t negatively impact server performance in your specific use case.

Regarding the associated variable EnableQueuedAnimEventsOnServer:

The purpose of EnableQueuedAnimEventsOnServer is identical to a.EnableQueuedAnimEventsOnServer, as they are directly linked.

It is used within the UCharacterMovementComponent::MoveAutonomous function to determine whether to process queued animation events on the server.

The value is set through the console variable system, just like a.EnableQueuedAnimEventsOnServer.

This variable directly controls the execution of animation-related code on the server, potentially affecting performance and gameplay behavior.

Developers should treat EnableQueuedAnimEventsOnServer with the same considerations as a.EnableQueuedAnimEventsOnServer, as they are essentially the same setting represented in different ways within the codebase.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:153, section: [ConsoleVariables]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:141

Scope (from outer to inner):

file
namespace    CharacterMovementCVars

Source code excerpt:

	static int32 EnableQueuedAnimEventsOnServer = 1;
	FAutoConsoleVariableRef CVarEnableQueuedAnimEventsOnServer(
		TEXT("a.EnableQueuedAnimEventsOnServer"),
		EnableQueuedAnimEventsOnServer,
		TEXT("Whether to enable queued anim events on servers. In most cases, when the server is doing a full anim graph update, queued notifies aren't triggered by the server, but this will enable them. Enabling this is recommended in projects using Listen Servers. \n")
		TEXT("0: Disable, 1: Enable"),
		ECVF_Default);

	// Logging when character is stuck. Off by default in shipping.

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:139

Scope (from outer to inner):

file
namespace    CharacterMovementCVars

Source code excerpt:

		ECVF_Default);

	static int32 EnableQueuedAnimEventsOnServer = 1;
	FAutoConsoleVariableRef CVarEnableQueuedAnimEventsOnServer(
		TEXT("a.EnableQueuedAnimEventsOnServer"),
		EnableQueuedAnimEventsOnServer,
		TEXT("Whether to enable queued anim events on servers. In most cases, when the server is doing a full anim graph update, queued notifies aren't triggered by the server, but this will enable them. Enabling this is recommended in projects using Listen Servers. \n")
		TEXT("0: Disable, 1: Enable"),
		ECVF_Default);

	// Logging when character is stuck. Off by default in shipping.
#if UE_BUILD_SHIPPING

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/CharacterMovementComponent.cpp:10257

Scope (from outer to inner):

file
function     void UCharacterMovementComponent::MoveAutonomous

Source code excerpt:

		check(OwnerMesh != nullptr)
		
		if (CharacterMovementCVars::EnableQueuedAnimEventsOnServer)
		{
			if (const UAnimInstance* AnimInstance = OwnerMesh->GetAnimInstance())
			{
				if (OwnerMesh->VisibilityBasedAnimTickOption <= EVisibilityBasedAnimTickOption::AlwaysTickPose && AnimInstance->NeedsUpdate())
				{
					// If we are doing a full graph update on the server but its doing a parallel update,