GameplayCueNotifyPaths

GameplayCueNotifyPaths

#Overview

name: GameplayCueNotifyPaths

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

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of GameplayCueNotifyPaths is to specify the directories where the engine should look for GameplayCue Notifies. These are essential components of the Gameplay Ability System in Unreal Engine 5, used to define visual and audio feedback for gameplay events.

This setting variable is primarily used by the Gameplay Abilities system, which is a plugin in Unreal Engine 5. Specifically, it’s utilized by the AbilitySystemGlobals and GameplayCueManager classes within this plugin.

The value of this variable is typically set in the DefaultGame.ini configuration file under the [/Script/GameplayAbilities.AbilitySystemGlobals] section. However, it can also be modified at runtime using the AddGameplayCueNotifyPath and RemoveGameplayCueNotifyPath functions.

GameplayCueNotifyPaths interacts with other components of the Gameplay Ability System, particularly the GameplayCueManager. The manager uses these paths to load and manage GameplayCue Notifies.

Developers should be aware that:

  1. If no paths are specified, the system defaults to using “/Game”, which can be slow for large projects.
  2. Changes to this variable at runtime may require rescanning of cue assets.

Best practices when using this variable include:

  1. Specifying precise paths in the configuration to optimize loading times and performance.
  2. Being cautious when modifying paths at runtime, as it can impact performance due to asset rescanning.
  3. Ensuring that all necessary GameplayCue Notifies are located within the specified paths.
  4. Using the AddGameplayCueNotifyPath function when adding new paths dynamically, especially in modular game systems or plugins.

By carefully managing GameplayCueNotifyPaths, developers can ensure efficient loading and management of GameplayCue Notifies, which are crucial for providing feedback in gameplay ability systems.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:25, section: [/Script/GameplayAbilities.AbilitySystemGlobals]

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:26, section: [/Script/GameplayAbilities.AbilitySystemGlobals]

#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:171

Scope (from outer to inner):

file
function     void UAbilitySystemGlobals::AddGameplayCueNotifyPath

Source code excerpt:

void UAbilitySystemGlobals::AddGameplayCueNotifyPath(const FString& InPath)
{
	GameplayCueNotifyPaths.AddUnique(InPath);
}

int32 UAbilitySystemGlobals::RemoveGameplayCueNotifyPath(const FString& InPath)
{
	return GameplayCueNotifyPaths.Remove(InPath);
}

#if WITH_EDITOR

void UAbilitySystemGlobals::OnTableReimported(UObject* InObject)
{

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemGlobals.cpp:520

Scope (from outer to inner):

file
function     UGameplayCueManager* UAbilitySystemGlobals::GetGameplayCueManager

Source code excerpt:

		GlobalGameplayCueManager->OnCreated();

		if (GameplayCueNotifyPaths.Num() == 0)
		{
			GameplayCueNotifyPaths.Add(TEXT("/Game"));
			ABILITY_LOG(Warning, TEXT("No GameplayCueNotifyPaths were specified in DefaultGame.ini under [/Script/GameplayAbilities.AbilitySystemGlobals]. Falling back to using all of /Game/. This may be slow on large projects. Consider specifying which paths are to be searched."));
		}
		
		if (GlobalGameplayCueManager->ShouldAsyncLoadObjectLibrariesAtStart())
		{
			StartAsyncLoadingObjectLibraries();

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/AbilitySystemGlobals.h:290

Scope (from outer to inner):

file
class        class UAbilitySystemGlobals : public UObject
function     virtual TArray<FString> GetGameplayCueNotifyPaths

Source code excerpt:


	/** Path where the engine will load gameplay cue notifies from */
	virtual TArray<FString> GetGameplayCueNotifyPaths() { return GameplayCueNotifyPaths; }

	/** Add a path to the GameplayCueNotifyPaths array. */
	virtual void AddGameplayCueNotifyPath(const FString& InPath);

	/**
	 * Remove the given gameplay cue notify path from the GameplayCueNotifyPaths array.
	 *
	 * @return Number of paths removed.
	 */
	virtual int32 RemoveGameplayCueNotifyPath(const FString& InPath);

	UPROPERTY()
	FNetSerializeScriptStructCache	TargetDataStructCache;

	UPROPERTY()
	FNetSerializeScriptStructCache	EffectContextStructCache;

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/AbilitySystemGlobals.h:378

Scope (from outer to inner):

file
class        class UAbilitySystemGlobals : public UObject

Source code excerpt:

	/** Look in these paths for GameplayCueNotifies. These are your "always loaded" set. */
	UPROPERTY(config)
	TArray<FString>	GameplayCueNotifyPaths;

	/** The class to instantiate as the GameplayTagResponseTable. */
	UPROPERTY(config)
	FSoftObjectPath GameplayTagResponseTableName;

	UPROPERTY()

#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/GameplayCueManager.h:285

Scope (from outer to inner):

file
function     class GAMEPLAYABILITIES_API UGameplayCueManager : public UDataAsset { GENERATED_UCLASS_BODY

Source code excerpt:


	/**
	 * Add a path to the GameplayCueNotifyPaths array.
	 * Re-initalizes RuntimeObjectLibrary based on the new paths
	 *
	 * @param InPath					The path to the directory that should be added to the scan
	 * @param bShouldRescanCueAssets		If true then the runtime object library will be rebuilt.
	 */
	virtual void AddGameplayCueNotifyPath(const FString& InPath, const bool bShouldRescanCueAssets = true);

	/**
	 * Remove the given gameplay cue notify path from the GameplayCueNotifyPaths array.
	 * Re-initalizes RuntimeObjectLibrary based on the new paths
	 * 
	 * @param InPath					The path to the directory that should be removed from the scan
	 * @param bShouldRescanCueAssets		If true then the runtime object library will be rebuilt.
	 * @return Number of paths removed.
	 */
	virtual int32 RemoveGameplayCueNotifyPath(const FString& InPath, const bool bShouldRescanCueAssets = true);
	
	int32 FinishLoadingGameplayCueNotifies();

	FStreamableManager	StreamableManager;
	
	void PrintGameplayCueNotifyMap();

#Loc: <Workspace>/Projects/Lyra/Source/LyraEditor/LyraEditor.cpp:59

Scope (from outer to inner):

file
function     static FString GetGameplayCuePath

Source code excerpt:

	//@TODO: Try plugins (e.g., GameplayCue.ShooterGame.Foo should be in ShooterCore or something)

	// Default path to the first entry in the UAbilitySystemGlobals::GameplayCueNotifyPaths.
	if (IGameplayAbilitiesModule::IsAvailable())
	{
		IGameplayAbilitiesModule& GameplayAbilitiesModule = IGameplayAbilitiesModule::Get();

		if (GameplayAbilitiesModule.IsAbilitySystemGlobalsAvailable())
		{

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/GameFeatures/GameFeatureAction_AddGameplayCuePath.h:9

Scope: file

Source code excerpt:

 * GameFeatureAction responsible for adding gameplay cue paths to the gameplay cue manager.
 *
 * @see UAbilitySystemGlobals::GameplayCueNotifyPaths
 */
UCLASS(MinimalAPI, meta = (DisplayName = "Add Gameplay Cue Path"))
class UGameFeatureAction_AddGameplayCuePath final : public UGameFeatureAction
{
	GENERATED_BODY()

public:

	UGameFeatureAction_AddGameplayCuePath();