PredictTargetGameplayEffects
PredictTargetGameplayEffects
#Overview
name: PredictTargetGameplayEffects
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of PredictTargetGameplayEffects is to control client-side prediction of gameplay effects applied to targets in the Unreal Engine’s Gameplay Ability System. This setting variable is specifically related to the prediction of effects on other entities, not just self-effects.
This setting variable is primarily used within the Gameplay Abilities plugin, which is a part of Unreal Engine’s runtime modules. It’s specifically referenced in the AbilitySystemGlobals class, which is a core component of the Gameplay Ability System.
The value of this variable is set in the UAbilitySystemGlobals constructor and is defined as a config property, meaning it can be configured in the project settings or through configuration files.
PredictTargetGameplayEffects interacts with other aspects of the Gameplay Ability System, particularly the client-side prediction system. It works in conjunction with other prediction and replication settings to determine how gameplay effects are handled across the network.
Developers must be aware that enabling this variable (which is the default behavior) allows clients to attempt predicting gameplay effects on other targets. This can lead to more responsive gameplay but may also introduce discrepancies if the prediction is incorrect.
Best practices when using this variable include:
- Carefully consider the implications of client-side prediction on gameplay and network performance.
- Ensure that server-side validation is in place to correct any mispredictions.
- Test thoroughly in networked environments to ensure that enabling this feature doesn’t introduce unwanted behavior or exploits.
- Use in conjunction with other Gameplay Ability System settings to fine-tune the prediction and replication behavior of your game.
- Document any changes to this setting, as it can significantly impact the feel and responsiveness of gameplay abilities in multiplayer scenarios.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:17, section: [/Script/GameplayAbilities.AbilitySystemGlobals]
- INI Section:
/Script/GameplayAbilities.AbilitySystemGlobals
- Raw value:
false
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemGlobals.cpp:45
Scope (from outer to inner):
file
function UAbilitySystemGlobals::UAbilitySystemGlobals
Source code excerpt:
bUseDebugTargetFromHud = false;
PredictTargetGameplayEffects = true;
ReplicateActivationOwnedTags = true;
MinimalReplicationTagCountBits = 5;
bAllowGameplayModEvaluationChannels = false;
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemGlobals.cpp:230
Scope (from outer to inner):
file
function bool UAbilitySystemGlobals::ShouldPredictTargetGameplayEffects
Source code excerpt:
bool UAbilitySystemGlobals::ShouldPredictTargetGameplayEffects() const
{
return PredictTargetGameplayEffects;
}
bool UAbilitySystemGlobals::ShouldReplicateActivationOwnedTags() const
{
return ReplicateActivationOwnedTags;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/AbilitySystemGlobals.h:391
Scope (from outer to inner):
file
class class UAbilitySystemGlobals : public UObject
Source code excerpt:
/** Set to true if you want clients to try to predict gameplay effects done to targets. If false it will only predict self effects */
UPROPERTY(config)
bool PredictTargetGameplayEffects;
/**
* Set to true if you want tags granted to owners from ability activations to be replicated. If false, ActivationOwnedTags are only applied locally.
* This should only be disabled for legacy game code that depends on non-replication of ActivationOwnedTags.
*/
UPROPERTY(config)