AbilitySystem.Fix.UseModTagReqsOnAllGE

AbilitySystem.Fix.UseModTagReqsOnAllGE

#Overview

name: AbilitySystem.Fix.UseModTagReqsOnAllGE

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of AbilitySystem.Fix.UseModTagReqsOnAllGE is to fix an issue in the Gameplay Ability System where MustHave/MustNotHave tags were not being applied to Instant and Periodic Gameplay Effects.

This setting variable is primarily used in the Gameplay Abilities plugin, which is a part of Unreal Engine’s runtime modules. Specifically, it affects the behavior of the Gameplay Effect system within this plugin.

The value of this variable is set as a console variable using FAutoConsoleVariableRef. It’s initialized to true by default, indicating that the fix is enabled.

The associated variable bUseModifierTagRequirementsOnAllGameplayEffects directly interacts with AbilitySystem.Fix.UseModTagReqsOnAllGE. They share the same value and purpose.

Developers must be aware that this variable affects how tag requirements are processed for Instant and Periodic Gameplay Effects. When enabled (which is the default), it ensures that the MustHave and MustNotHave tags are checked for these types of effects, which wasn’t the case before.

Best practices when using this variable include:

  1. Generally, leave it enabled (true) to benefit from the fix.
  2. If you’re updating an existing project that relied on the previous behavior, you may need to review and possibly adjust your Gameplay Effects to ensure they work as intended with the new behavior.
  3. Be aware of this change when debugging issues related to Gameplay Effects, especially if they involve tag requirements.

Regarding the associated variable bUseModifierTagRequirementsOnAllGameplayEffects:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayEffect.cpp:86

Scope (from outer to inner):

file
namespace    UE::GameplayEffect

Source code excerpt:

	// Fix introduced in UE5.4
	bool bUseModifierTagRequirementsOnAllGameplayEffects = true;
	FAutoConsoleVariableRef CVarUseModTagReqsOnAllGE{ TEXT("AbilitySystem.Fix.UseModTagReqsOnAllGE"), bUseModifierTagRequirementsOnAllGameplayEffects, TEXT("Fix an issue where MustHave/MustNotHave tags did not apply to Instant and Periodic Gameplay Effects"), ECVF_Default };

	// Fix introduced in UE5.4
	bool bSkipUnmappedReferencesCheckForGameplayCues = true;
	FAutoConsoleVariableRef CVarSkipUnmappedReferencesCheckForGameplayCues{ TEXT("AbilitySystem.Fix.SkipUnmappedReferencesCheckForGameplayCues"), bSkipUnmappedReferencesCheckForGameplayCues,
		TEXT("Skip the bHasMoreUnmappedReferences check for GameplayCues which never worked as intended and causes issues when set properly (may be deprecated soon)"), ECVF_Default };

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayEffect.cpp:85

Scope (from outer to inner):

file
namespace    UE::GameplayEffect

Source code excerpt:


	// Fix introduced in UE5.4
	bool bUseModifierTagRequirementsOnAllGameplayEffects = true;
	FAutoConsoleVariableRef CVarUseModTagReqsOnAllGE{ TEXT("AbilitySystem.Fix.UseModTagReqsOnAllGE"), bUseModifierTagRequirementsOnAllGameplayEffects, TEXT("Fix an issue where MustHave/MustNotHave tags did not apply to Instant and Periodic Gameplay Effects"), ECVF_Default };

	// Fix introduced in UE5.4
	bool bSkipUnmappedReferencesCheckForGameplayCues = true;
	FAutoConsoleVariableRef CVarSkipUnmappedReferencesCheckForGameplayCues{ TEXT("AbilitySystem.Fix.SkipUnmappedReferencesCheckForGameplayCues"), bSkipUnmappedReferencesCheckForGameplayCues,
		TEXT("Skip the bHasMoreUnmappedReferences check for GameplayCues which never worked as intended and causes issues when set properly (may be deprecated soon)"), ECVF_Default };

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayEffect.cpp:2874

Scope (from outer to inner):

file
function     void FActiveGameplayEffectsContainer::PredictivelyExecuteEffectSpec

Source code excerpt:

		const FGameplayModifierInfo& ModDef = SpecToUse.Def->Modifiers[ModIdx];

		if (UE::GameplayEffect::bUseModifierTagRequirementsOnAllGameplayEffects)
		{
			// Check tag requirements. This code path is for Instant & Periodic effects.
			// Duration effects are a separate code path; they use aggregators and their requirements checks are in FAggregatorMod::UpdateQualifies.
			if (!ModDef.SourceTags.IsEmpty() && !ModDef.SourceTags.RequirementsMet(Spec.CapturedSourceTags.GetActorTags()))
			{
				continue;

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/GameplayEffect.cpp:3005

Scope (from outer to inner):

file
function     void FActiveGameplayEffectsContainer::ExecuteActiveEffectsFrom

Source code excerpt:

		const FGameplayModifierInfo& ModDef = SpecToUse.Def->Modifiers[ModIdx];

		if (UE::GameplayEffect::bUseModifierTagRequirementsOnAllGameplayEffects)
		{
			// Check tag requirements. This code path is for Instant & Periodic effects.
			// Duration effects are a separate code path; they use aggregators and their requirements checks are in FAggregatorMod::UpdateQualifies.
			if (!ModDef.SourceTags.IsEmpty() && !ModDef.SourceTags.RequirementsMet(Spec.CapturedSourceTags.GetActorTags()))
			{
				continue;