AbilitySystem.GameplayCueFailLoads
AbilitySystem.GameplayCueFailLoads
#Overview
name: AbilitySystem.GameplayCueFailLoads
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Pretend all GameplayCues are unloaded (and keep requesting loads) while true. Set to false to allow GameplayCues to play.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of AbilitySystem.GameplayCueFailLoads is to simulate scenarios where GameplayCues are failing to load or loading slowly due to IO contention in the Unreal Engine’s Gameplay Ability System.
This setting variable is primarily used in the GameplayAbilities plugin, specifically within the GameplayCueSet module. It’s part of the Ability System, which is a core component of Unreal Engine’s gameplay framework.
The value of this variable is set through a console variable (CVar) named CVarGameplayCueFailLoads. It’s initialized as a static TAutoConsoleVariable with a default value of false.
The associated variable CVarGameplayCueFailLoads directly interacts with AbilitySystem.GameplayCueFailLoads. They share the same value and purpose.
Developers must be aware that when this variable is set to true, it will simulate a scenario where all GameplayCues are unloaded and will continue to request loads. This can be useful for testing how the game behaves under conditions where GameplayCues are failing to load or loading slowly.
Best practices when using this variable include:
- Use it for testing and debugging purposes only, not in production builds.
- Be prepared for potential performance impacts when enabled, as it will continually request loads for GameplayCues.
- Remember to disable it (set to false) when you want GameplayCues to play normally.
- Use in conjunction with other debugging tools to identify and resolve issues related to GameplayCue loading and performance.
Regarding the associated variable CVarGameplayCueFailLoads:
- It’s the actual console variable that controls the behavior described above.
- It’s used in the UGameplayCueSet::HandleGameplayCueNotify_Internal function to determine whether to simulate failed loads.
- When CVarGameplayCueFailLoads.GetValueOnGameThread() returns true, the function will treat the GameplayCue as if it hasn’t been loaded, even if it actually has.
- This allows developers to test the game’s behavior and error handling when GameplayCues fail to load, without actually removing or corrupting the GameplayCue assets.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayCueSet.cpp:44
Scope: file
Source code excerpt:
// Let's use this to create a path for testing what happens when GameplayCues are failing to load (or are loading slowly due to IO contention)
static TAutoConsoleVariable<bool> CVarGameplayCueFailLoads(TEXT("AbilitySystem.GameplayCueFailLoads"), false, TEXT("Pretend all GameplayCues are unloaded (and keep requesting loads) while true. Set to false to allow GameplayCues to play."), ECVF_Default);
// --------------------------------------------------------------------------------------------------------------------------------------------------------
//
// UGameplayCueSet
//
// --------------------------------------------------------------------------------------------------------------------------------------------------------
#Associated Variable and Callsites
This variable is associated with another variable named CVarGameplayCueFailLoads
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayCueSet.cpp:44
Scope: file
Source code excerpt:
// Let's use this to create a path for testing what happens when GameplayCues are failing to load (or are loading slowly due to IO contention)
static TAutoConsoleVariable<bool> CVarGameplayCueFailLoads(TEXT("AbilitySystem.GameplayCueFailLoads"), false, TEXT("Pretend all GameplayCues are unloaded (and keep requesting loads) while true. Set to false to allow GameplayCues to play."), ECVF_Default);
// --------------------------------------------------------------------------------------------------------------------------------------------------------
//
// UGameplayCueSet
//
// --------------------------------------------------------------------------------------------------------------------------------------------------------
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayCueSet.cpp:274
Scope (from outer to inner):
file
function bool UGameplayCueSet::HandleGameplayCueNotify_Internal
Source code excerpt:
Parameters.MatchedTagName = CueData.GameplayCueTag;
const bool bDebugFailLoads = CVarGameplayCueFailLoads.GetValueOnGameThread();
// If object is not loaded yet
if (CueData.LoadedGameplayCueClass == nullptr || bDebugFailLoads)
{
// See if the object is loaded but just not hooked up here
CueData.LoadedGameplayCueClass = Cast<UClass>(CueData.GameplayCueNotifyObj.ResolveObject());