Skip to content

Conversation

Packetdancer
Copy link
Collaborator

@Packetdancer Packetdancer commented Sep 30, 2024

This is a fairly significant set of changes, reworking how the ability queue works and how the effect application works.

The core of this is the creation of a templated TGMASBoundOperationQueue where each TGMASBoundOperation represents a single action (add/remove, whatever) to a queue. The queue can be replicated client-to-server via GMC moves (as with the ability queue), server-to-client via RPC (as with the ServerAuth effect queue type), or used as a holding pen (as with the PredictedQueued effect queue type). In addition, each operation has a non-templated form which can be passed via RPC and then restored to a full operation in the queue.

Atop that change, the following additional changes were made.

  • The ability queue was converted to using a bound operation queue.
  • Effect application was converted to using bound operation queues.
  • New effect queue types were defined: Predicted, PredictedQueued, and ServerAuth are exposed to blueprint. ClientAuth and ServerAuthMove exist for the sake of completeness, but are hidden in the UENUM.
  • New API was added to determine how an effect operation (add/remove) is queued.
  • Old API was converted to use the new queues; the old API will use Predicted if bOutside is false, and ServerAuth if true.
  • The new API accepts "effect handles" -- these are effect identifiers which are only relevant/valid locally, but which can be used to refer to an effect immediately after it is queued for application, whether or not a valid effect ID was available yet.

For the sake of testing, there is a matching queue-refactor branch of the GMASExTemplate project which pulls this branch as the GMAS submodule, and where the BP_EffectBox has been converted to using the new API. In addition, BP_EffectBox has been set up so that the method by which the effect is queued can be changed easily in the blueprint (so that I didn't go insane while testing every queue type on every network scenario, repeatedly).

(However, despite the changes, previous code should Just Work seamlessly, though the older legacy API will have deprecation warnings.)

The bound operations queue functionality is meant to also support gameplay cues, as my next large task.

@Packetdancer Packetdancer added enhancement New feature or request maintenance Code cleanup, portability considerations, and such labels Sep 30, 2024
Copy link
Collaborator

@Aherys Aherys Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion :

  • Backward incrementation removal instead of dual loop.
  • int reference as primitive type is less performant than copy (the more you know)

@Aherys
Copy link
Collaborator

Aherys commented Sep 30, 2024

First fast review, nothing to report, good job.

  • elegant use of template for the bound queue, i like it.

@petegilb
Copy link
Collaborator

petegilb commented Oct 2, 2024

This is super cool! I looked through it and there's nothing that I disagree with so next step would be some testing and we'll see where we're at!

@rafadsm
Copy link

rafadsm commented Oct 3, 2024

I am experiencing a small rollback when using sprint in the demo project described (Playing as Client)
When using sprint, my character accelerates for a few milliseconds, then returns to normal speed and accelerates again
The same when sprint is turned off
The character slows down, accelerates and slows down again
I tried to bind to MaxDesiredSpeed, but that wasn't the problem
I don't know if it could be something with the ability system or the demo

Here is a video, it doesn't always happen, but at some point you notice the character doing a slight rollback

video: https://streamable.com/if7uk4

Although I don't understand much about the gmc, I believe you did a great job with this rework

@petegilb
Copy link
Collaborator

petegilb commented Oct 3, 2024

I am experiencing a small rollback when using sprint in the demo project described When using sprint, my character accelerates for a few milliseconds, then returns to normal speed and accelerates again The same when sprint is turned off The character slows down, accelerates and slows down again I tried to bind to MaxDesiredSpeed, but that wasn't the problem I don't know if it could be something with the ability system or the demo

Here is a video, it doesn't always happen, but at some point you notice the character doing a slight rollback

video: https://streamable.com/if7uk4

Although I don't understand much about the gmc, I believe you did a great job with this rework

I had the same issue. Was getting replays constantly when starting

@Packetdancer
Copy link
Collaborator Author

@rafadsm -- Do the most recent changes to the branch fix your desync/replay? I know they did for @petegilb, but I want to double-check.

@rafadsm
Copy link

rafadsm commented Oct 8, 2024

@rafadsm -- Do the most recent changes to the branch fix your desync/replay? I know they did for @petegilb, but I want to double-check.

I did some tests and the desync/replay is fixed, thanks!

FInstancedStruct InstancedPayload {};

UPROPERTY()
float RPCGracePeriodSeconds { 1.f };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default should be editable on the ASC somehow

Also it would be nice to be able to set this at the Effect level as well. Per @Aherys comment in Discord, some things absolutely need to be resolved sooner with little to no grace period (which will of course cause corrections).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion : AdvancedDisplay for this one,
Value below some reasonable amount must not be possible and we must warn the user when used/avoid using them (or why using this queue mode then ?) OR warn the user, and switch/force the queue mode if this is the case.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also suggest making the grace time a lot lower by default. If you use the client's move timestamp to determine if the grace time is over, you're effectively only waiting for a one-way trip (server to client RPC) and not RTT.

This means that having 1000 ms of grace time by default is a bit much. A grace period of 150 ms or 250 ms would account for most scenarios (technically double those numbers).

And high ping would result in rubberbanding anyway. If the server hitches causing a ping spike in players, they'll also feel it, so a lower grace period shouldn't affect players at all, and make it harder for cheaters to game the system.

Additionally, the header might be better holding the player's latest move timestamp (double) instead of the remaining period seconds. Seems a little more readable, you'd check against the current move timestamp you're handling from the player when checking if the grace period is over.

Copy link

@xCynDev xCynDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things I've spotted reading this PR. Some of these could be some pretty critical issues, others are just ideas.

*GetNetRoleAsString(GetOwnerRole()), *GetOwner()->GetName())
}

UGMCAbilityEffect* Effect = DuplicateObject(Operation.ItemClass->GetDefaultObject<UGMCAbilityEffect>(), this);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why DuplicateObject is used over NewObject in this case? Since the duplicated object is the CDO, it's basically the same as just calling NewObject with the item class no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason really, other than "it was done that way in other bits of the code which I didn't write." I was just trying to match the existing behavior for effects in case there was a side effect I wasn't aware of. I have zero objection to switching it back to NewObject.

Copy link
Collaborator Author

@Packetdancer Packetdancer Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoyingly it won't let me reply to the grace period comment, so I'm replying here.

I used 1 second because the existing "outside" behavior used that grace period; in case anyone was using that code, I didn't want to change the value on them by changing what was happening under the hood. (Same logic for doing the remaining time being deducted rather than a move timestamp.) Mostly, I just didn't want to change the implementation drastically and potentially change the behavior simultaneously when folks were testing it, as I wanted to have folks test the implementation sort of in isolation first; I figured behavior could be changed later.

I do think we should expose the grace period, and if no one is using the previous behavior I agree it would be good to have a shorter interval.

FInstancedStruct InstancedPayload {};

UPROPERTY()
float RPCGracePeriodSeconds { 1.f };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also suggest making the grace time a lot lower by default. If you use the client's move timestamp to determine if the grace time is over, you're effectively only waiting for a one-way trip (server to client RPC) and not RTT.

This means that having 1000 ms of grace time by default is a bit much. A grace period of 150 ms or 250 ms would account for most scenarios (technically double those numbers).

And high ping would result in rubberbanding anyway. If the server hitches causing a ping spike in players, they'll also feel it, so a lower grace period shouldn't affect players at all, and make it harder for cheaters to game the system.

Additionally, the header might be better holding the player's latest move timestamp (double) instead of the remaining period seconds. Seems a little more readable, you'd check against the current move timestamp you're handling from the player when checking if the grace period is over.


// The instanced struct representation of this payload, used to actually
// bind for replication.
FInstancedStruct InstancedPayload;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind this is very unsafe as FInstancedStruct contains UObjects. The UScriptStruct of the wrapped struct, and the struct memory itself may contain UPROPERTY fields which the GC knows about through the AddStructReferencedObjects type trait.

I already talked to GRIM about implementing it for the GMC's bound variables since UObject* ones aren't referenced by the GC in some scenarios. You're meant to UPROPERTY instanced structs to prevent dangling pointers.

If there is no way to make it UPROPERTY, there are other solutions:

  • If this templated struct is held in a struct, you can implement the WithAddStructReferencedObjects type trait to manually add the instanced struct's references (and ItemClass as well) if they're not nullptr.
  • If this is held by a UObject, you can override UObject::AddReferencedObjects() and do the same.

I see this template is used by another template, so I would go up the chain until I find a UPROPERTY'd struct or UObject and handle it either way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth noting that the payloads being used may have UObject* properties, but those are filled in on the side actually utilizing it, so I was not particularly concerned about dangling pointers in this case as opposed to an abstract way to sync the templated payload.

However, it's a valid concern if someone blithely used the bound queue for something else. I'm not going to be able to do a rewrite for the next couple of weeks, however, so if you'd like to see that change sooner, feel free to refactor and make a PR against the source branch!


FGameplayTag GetTag() const { return Header.Tag; }

bool GracePeriodExpired() const
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor pet peeve, mostly Epic's coding convention which has bool getters be a question, like HasGracePeriodExpired().

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, and easy enough to change.

// An actual class to be utilized with this, in case we need to instance it.
TSubclassOf<C> ItemClass { nullptr };

FInstancedStruct InstancedPayloadIds;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment on line 82.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InstancedPayloadIds only ever contains an FGMASBoundQueueOperationIdSet, a struct which only ever contains a single property of type TArray; it's only an instanced struct because GMC lacks a way to bind arrays.

I don't consider this one a particular risk, as a result.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair. I'm mostly worried about the UScriptStruct but I suppose it shouldn't ever be GC'd for a C++ struct.

{
// Get a handle to our class, for instancing purposes.
TSoftClassPtr<C> ClassPtr = TSoftClassPtr<C>(FSoftObjectPath(Header.ItemClassName.ToString()));
ItemClass = ClassPtr.LoadSynchronous();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can cause hitches as this flushes the async streaming queue. I would use the asset manager's FStreamableManager::RequestSyncLoad() as it instead puts the request at the top of the queue, potentially finishing faster.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasonable change!

Copy link

@xCynDev xCynDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus

FGMCOuterApplicationWrapper Wrapper = FGMCOuterApplicationWrapper::Make<FGMCOuterEffectAdd>(Effect, InitializationData);
AddPendingEffectApplications(Wrapper);
QueuedEffectOperations.QueuePreparedOperation(Operation, false);
ClientQueueEffectOperation(Operation);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder if we could instead have another queue on the server, so we don't spam RPCs in case of multiple effects. Minor optimization perhaps but we could have an array of operations and send them as one RPC instead.

@Crezetique
Copy link
Contributor

image
Bringing this over from discord to ensure vis and in case someone has the chance to look into it.

Replicable in fresh project. An issue occurs when nested gameplay tags are granted and removed with effects.
The effects are removed, but the granted tag is not removed correctly.
In the screenshot scenario, State.Test granted tag is never removed.
Having the effects added or removed in different order does not change the outcome.

reznok added a commit that referenced this pull request Nov 21, 2024
* Beginnings of general queue implementation

* Further work on bound queues.

* Convert abilities over to using the new bound operations queue.

* Refactor to generalize ability queue processing

* Convert effects to bound queue

* Refactor and cleanup

* A little more refactoring

* Support server-auth effects queued via GMC moves.

Note that this requires adding an SV_PreRemoteMoveExecution to your movement component, and calling into GMAS's PreRemoteMove call in that.

* Ensure that Queue-via-GMC effects work in standalone as well.

* Queue rework and cleanup finished!

* Last few tweaks to the queue setup.

* Further queue refactor and cleanup.

New queue types (ClientAuth, PredictedQueued) added.

* Add effect handles, so that PredictedQueued works right.

* Small cleanup on effect handle expiry.

* Correct desync for server-auth queue.

* Ensure we don't use the same ID if queuing two server-auth things in the same frame.

* Fix for Reznok's two-effects-in-one-frame issue.

* Correct issue with 2+ PredictedQueued operations in one tick, or 3+ ServerAuth queued.

* Fix off-by-one on server auth effect tick

* Fix a task ticking bug when multiple tasks happened in a row

* Fix:Add SourceComponent references to effect applications

* Add a bool to EffectData to preserve multiple instances of granted tags

---------

Co-authored-by: Rachel Blackman <packetdancer@gmail.com>
Co-authored-by: Rachel Blackman <rachel.c.blackman@gmail.com>
@reznok
Copy link
Owner

reznok commented Nov 21, 2024

Changes were brought in with #97

Keeping this open for now as there's some good discussion about changes that haven't made it in yet and should be in another PR.

reznok added a commit that referenced this pull request Jun 5, 2025
* Update README.md

* move effect and cooldowns to ancillary tick, add ancillary tick options for abilities and tasks (#53)

* Fix GMAS Pawn automatic input setup.

* Avoid crashing in editor if adding new attributes/ability maps.

* Make IsPeriodPaused() overridable.

* Allow FAttributeClamp to be compared on both reference and pointer.

* Replicate unbound attributes via FFastArraySerializer

* Update bound attributes individually.

* Bound attributes are now sorted by tag (to be deterministic).
* Rather than binding the BoundAttributes struct, we now bind the
  Value, BaseValue, and modifiers for each bound attribute individually.

* Unbound attributes must only be added on authority.

* Correct erroneously auto-included header.

* Add functionality to count active/queued abilities, and ensure abilities are unique.

* Minor cleanups to appease Linux compilation.

* Add UPROPERTY Categories to allow compilation as engine plugin.

* Adding Method CancelAbility, allowing ending an ability without triggering EndAbilityEvent.
Internally, FinishEndAbility Method as also been added and ensure logics (see GAS termination of an ability)

* Moving Activation tag requirement check before instantiation of the ability.

* Added pre-check function for ability, allowing to have some basic test and allow to cancel an ability if they fail,
Overridable in C++ or in Blueprint.

* Adding Precheck and Cancelling by tag

- Adding PreCheck function allowing to test logic on the start of an ability
- Adding Cancelling ability by tag.

* Ability Precheck, Abilities Cancel by Tag, Check Before instances, Engine Plugin Compability (#64)

* Add UPROPERTY Categories to allow compilation as engine plugin.

* Adding Method CancelAbility, allowing ending an ability without triggering EndAbilityEvent.
Internally, FinishEndAbility Method as also been added and ensure logics (see GAS termination of an ability)

* Moving Activation tag requirement check before instantiation of the ability.

* Added pre-check function for ability, allowing to have some basic test and allow to cancel an ability if they fail,
Overridable in C++ or in Blueprint.

* Adding Precheck and Cancelling by tag

- Adding PreCheck function allowing to test logic on the start of an ability
- Adding Cancelling ability by tag.

* Add UGMCAbilityTask_WaitForInputKeyPress, fix potential memory mishaps with WaitForInputKeyRelease

* Fix copyright, UGMCAbility::GetWorld()

* Fix inverted condition

* fix ability tag activation typo

* Adding Method CancelAbility, allowing ending an ability without triggering EndAbilityEvent.
Internally, FinishEndAbility Method as also been added and ensure logics (see GAS termination of an ability)

* Moving Activation tag requirement check before instantiation of the ability.

* Fix for AncilarityAbilityTick

* - Changed default start point from BeginAbility to PreBeginAbility, allow a better flow when overriding in c++.
- Check are now done in PreBeginAbility
- Fix: GetActiveAbilityCount was also counting ended ability
- Adding check to execute end ability event only one time (in case EndAbility is re-called externally or internally)
- Moving GetWorld() from private to protected, cause no reason to be in private.

* Adding Two Ability Task
- Adding Target Data Object
- Adding Wait For Input Key Press

* Fix for Aucillary Tick

Moving the clear of Ability And Task Data to the end AucillaryTick.
Fix Found with @Gilbz

* Splitting TaskData acquisition for AncillaryTick Ability
Avoiding replay to modify the TaskData acquisition when an ability is Ancillary.

* remove copyright notice

* remove duplicate getworld

* Allow CheckActivationTags() to be overridden

* Added Activity Blocked by ActiveAbility

* Fixing crash in HandleTaskHeartBeat.

* Change behavior for attribute ChangeCallback

- Callback OnAttributeChanged is now also called on SP
- Callback is now also called when the value is affected outside for whatever reason (like by SetAttributeValueByTag)
- Support Replay
- SetAttributeValueByTag now also re-caculate the value.

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* Change behavior for attribute ChangeCallback

- Callback OnAttributeChanged is now also called on SP/AP
- Callback is now also called when the value is affected outside for whatever reason (like by SetAttributeValueByTag)
- Support Replay
- SetAttributeValueByTag now also re-caculate the value.

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Clean before merge
- Removed Log message
- Removed irrelevant bounding

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Bug fixing and improvement for rep notify

* BL-279 Fixing Attribute notification

* BL-279 Adding Byte data type to Set Target for DW GMC Ability

* Improvement for tags, added duration

* BL-232 Progress

* BL-232 Initial work on External Effect/Ability Pending and Tag application

* BL-232 Working state.

* BL-232 Refactor and cleaning, handled now by Instanced Struct

* BL-232 Progress of the day

* Fixing a bug in remove effect.

They are now removing by specifique ID when outer removed, to ensure the list rest coherent client <-> server

* BL-232 Fixing removing effect

* BL-232 bug fixing in effect

* Bug fixing, adding accessor

* BL-232 Fix effect remove itself even is another instance is running

* Guard against GetWorld() being called with no active world contexts.

* Added getter

* Fixed name space for SetTargetDataFloat, Fixed EEffectType of GMCAbilityEffect sharing same name than playfab, Fixed wait for input key release with suggestion of Nas

* Stability
- Fixed name space for SetTargetDataFloat,
- Fixed EEffectType of GMCAbilityEffect sharing same name than playfab
- Fixed wait for input key release with suggestion of Nas
- GetAbilityMapData now return a const ref.

For compability, you probably want to add to core redirect those lines :
```
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectType",NewName="/Script/GMCAbilitySystem.EGMASEffectType")
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectState",NewName="/Script/GMCAbilitySystem.EGMASEffectState")
```

* Ensure Unbound attributes are replicated properly at startup.

* Adding possibility for effect to end an active ability

* Changing Ability Blocking way.

They are now internally stored. An Ability store itself what ability it will block, instead of other ability who will block him.

This allow to modify during execution this behavior.
For example, you may be want to stop an ability activation only during X time in your ability execution.

* Adding a nicer way to end ability

* BL-225 Grenade 100%

* Minor Cleanup (#86)

* Ensure Unbound attributes are replicated properly at startup.

* Additional guards on unbinding filtered tag delegates for gameplay element mapping.

* Ensure Unbound attributes are replicated properly at startup.

* Ensure the garbage check on gameplay element maps works in 5.3 and earlier.

* Add methods to add/remove starting effects (#84)

* Fix heartbeats for locally controlled server pawns causing timeouts

* Add WaitForGMCMontageChange

* Effects:Add Application/Ongoing checks for Must(Not) Have Tags

* Prevent effect from starting if tag requirements not met

* Fix clang error

* Adding Attribute Dynamic Condition to effect.

* Virtualize ability effect (#90)

* Ensure Unbound attributes are replicated properly at startup.

* virtualize lifecycle function so that AbilityEffect can be subclassed

* remove extra whitespace

---------

Co-authored-by: Rachel Blackman <packetdancer@gmail.com>
Co-authored-by: utf8 <uft8decodeerror@gmail.com>

* Fix crash when an active effect has been destroyed

* Module upload

* GMC Update

* Addition of levitation actor

* Crash fix

* GMC Fix for starting abilities,
Fix for stamina,
Fix for crash,
Adding speed for orb,
Adding plugin for metahuman hairs.

* Update for log

* Fix for GetActiveEffect ?

* Typo fix

* Rebased Deep Worlds fork (#93)

* Add UPROPERTY Categories to allow compilation as engine plugin.

* Adding Method CancelAbility, allowing ending an ability without triggering EndAbilityEvent.
Internally, FinishEndAbility Method as also been added and ensure logics (see GAS termination of an ability)

* Moving Activation tag requirement check before instantiation of the ability.

* Added Activity Blocked by ActiveAbility

* Fixing crash in HandleTaskHeartBeat.

* Change behavior for attribute ChangeCallback

- Callback OnAttributeChanged is now also called on SP/AP
- Callback is now also called when the value is affected outside for whatever reason (like by SetAttributeValueByTag)
- Support Replay
- SetAttributeValueByTag now also re-caculate the value.

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Clean before merge
- Removed Log message
- Removed irrelevant bounding

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Bug fixing and improvement for rep notify

* BL-279 Fixing Attribute notification

* BL-279 Adding Byte data type to Set Target for DW GMC Ability

* Improvement for tags, added duration

* BL-232 Progress

* BL-232 Initial work on External Effect/Ability Pending and Tag application

* BL-232 Working state.

* BL-232 Refactor and cleaning, handled now by Instanced Struct

* BL-232 Progress of the day

* Fixing a bug in remove effect.

They are now removing by specifique ID when outer removed, to ensure the list rest coherent client <-> server

* BL-232 Fixing removing effect

* BL-232 bug fixing in effect

* Bug fixing, adding accessor

* BL-232 Fix effect remove itself even is another instance is running

* Added getter

* Stability
- Fixed name space for SetTargetDataFloat,
- Fixed EEffectType of GMCAbilityEffect sharing same name than playfab
- Fixed wait for input key release with suggestion of Nas
- GetAbilityMapData now return a const ref.

For compability, you probably want to add to core redirect those lines :
```
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectType",NewName="/Script/GMCAbilitySystem.EGMASEffectType")
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectState",NewName="/Script/GMCAbilitySystem.EGMASEffectState")
```

* Adding possibility for effect to end an active ability

* Changing Ability Blocking way.

They are now internally stored. An Ability store itself what ability it will block, instead of other ability who will block him.

This allow to modify during execution this behavior.
For example, you may be want to stop an ability activation only during X time in your ability execution.

* Adding a nicer way to end ability

* BL-225 Grenade 100%

* Fix clang error

* Adding Attribute Dynamic Condition to effect.

* Fix crash when an active effect has been destroyed

* Module upload

* GMC Update

* Addition of levitation actor

* Crash fix

* GMC Fix for starting abilities,
Fix for stamina,
Fix for crash,
Adding speed for orb,
Adding plugin for metahuman hairs.

* Update for log

* Fix for GetActiveEffect ?

* Typo fix

* couple of misc fixes from rebasing deep worlds fork

---------

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>
Co-authored-by: Eric Rajot <aherys@deepworlds.studio>

* Update SetTargetDataGameplayTag.cpp

fix: Remove super call for SetTargetDataGameplayTag

* DW Improvements (#94)

* Minor Cleanup (#86)

* Ensure Unbound attributes are replicated properly at startup.

* Additional guards on unbinding filtered tag delegates for gameplay element mapping.

* Ensure Unbound attributes are replicated properly at startup.

* Ensure the garbage check on gameplay element maps works in 5.3 and earlier.

* Add methods to add/remove starting effects (#84)

* Fix heartbeats for locally controlled server pawns causing timeouts

* Add WaitForGMCMontageChange

* Effects:Add Application/Ongoing checks for Must(Not) Have Tags

* Prevent effect from starting if tag requirements not met

* Virtualize ability effect (#90)

* Ensure Unbound attributes are replicated properly at startup.

* virtualize lifecycle function so that AbilityEffect can be subclassed

* remove extra whitespace

---------

Co-authored-by: Rachel Blackman <packetdancer@gmail.com>
Co-authored-by: utf8 <uft8decodeerror@gmail.com>

* Rebased Deep Worlds fork (#93)

* Add UPROPERTY Categories to allow compilation as engine plugin.

* Adding Method CancelAbility, allowing ending an ability without triggering EndAbilityEvent.
Internally, FinishEndAbility Method as also been added and ensure logics (see GAS termination of an ability)

* Moving Activation tag requirement check before instantiation of the ability.

* Added Activity Blocked by ActiveAbility

* Fixing crash in HandleTaskHeartBeat.

* Change behavior for attribute ChangeCallback

- Callback OnAttributeChanged is now also called on SP/AP
- Callback is now also called when the value is affected outside for whatever reason (like by SetAttributeValueByTag)
- Support Replay
- SetAttributeValueByTag now also re-caculate the value.

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Clean before merge
- Removed Log message
- Removed irrelevant bounding

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Bug fixing and improvement for rep notify

* BL-279 Fixing Attribute notification

* BL-279 Adding Byte data type to Set Target for DW GMC Ability

* Improvement for tags, added duration

* BL-232 Progress

* BL-232 Initial work on External Effect/Ability Pending and Tag application

* BL-232 Working state.

* BL-232 Refactor and cleaning, handled now by Instanced Struct

* BL-232 Progress of the day

* Fixing a bug in remove effect.

They are now removing by specifique ID when outer removed, to ensure the list rest coherent client <-> server

* BL-232 Fixing removing effect

* BL-232 bug fixing in effect

* Bug fixing, adding accessor

* BL-232 Fix effect remove itself even is another instance is running

* Added getter

* Stability
- Fixed name space for SetTargetDataFloat,
- Fixed EEffectType of GMCAbilityEffect sharing same name than playfab
- Fixed wait for input key release with suggestion of Nas
- GetAbilityMapData now return a const ref.

For compability, you probably want to add to core redirect those lines :
```
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectType",NewName="/Script/GMCAbilitySystem.EGMASEffectType")
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectState",NewName="/Script/GMCAbilitySystem.EGMASEffectState")
```

* Adding possibility for effect to end an active ability

* Changing Ability Blocking way.

They are now internally stored. An Ability store itself what ability it will block, instead of other ability who will block him.

This allow to modify during execution this behavior.
For example, you may be want to stop an ability activation only during X time in your ability execution.

* Adding a nicer way to end ability

* BL-225 Grenade 100%

* Fix clang error

* Adding Attribute Dynamic Condition to effect.

* Fix crash when an active effect has been destroyed

* Module upload

* GMC Update

* Addition of levitation actor

* Crash fix

* GMC Fix for starting abilities,
Fix for stamina,
Fix for crash,
Adding speed for orb,
Adding plugin for metahuman hairs.

* Update for log

* Fix for GetActiveEffect ?

* Typo fix

* couple of misc fixes from rebasing deep worlds fork

---------

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>
Co-authored-by: Eric Rajot <aherys@deepworlds.studio>

* Update SetTargetDataGameplayTag.cpp

fix: Remove super call for SetTargetDataGameplayTag

---------

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>
Co-authored-by: Peter Gilbert <33180578+petegilb@users.noreply.github.com>
Co-authored-by: Rachel Blackman <packetdancer@gmail.com>
Co-authored-by: Bean's Beans Studios <dylancharleston@gmail.com>
Co-authored-by: utf8decodeerror <30543450+utf8decodeerror@users.noreply.github.com>
Co-authored-by: utf8 <uft8decodeerror@gmail.com>
Co-authored-by: Eric Rajot <aherys@deepworlds.studio>

* Removing unecessary log

* Beginnings of general queue implementation

* Further work on bound queues.

* Convert abilities over to using the new bound operations queue.

* Refactor to generalize ability queue processing

* Convert effects to bound queue

* Refactor and cleanup

* A little more refactoring

* Support server-auth effects queued via GMC moves.

Note that this requires adding an SV_PreRemoteMoveExecution to your movement component, and calling into GMAS's PreRemoteMove call in that.

* Ensure that Queue-via-GMC effects work in standalone as well.

* Queue rework and cleanup finished!

* Last few tweaks to the queue setup.

* Further queue refactor and cleanup.

New queue types (ClientAuth, PredictedQueued) added.

* Add effect handles, so that PredictedQueued works right.

* Small cleanup on effect handle expiry.

* Correct desync for server-auth queue.

* Fix crash BL-SERVER-B

* Ensure we don't use the same ID if queuing two server-auth things in the same frame.

* Fix for Reznok's two-effects-in-one-frame issue.

* Correct issue with 2+ PredictedQueued operations in one tick, or 3+ ServerAuth queued.

* BL-453 Adding application must have tag.

* Fix for server compile

* Update GMCAbilityComponent.cpp (#96)

remove superfluous call to MarkArrayDirty()

* BL-453 - Fixing AbilityData unset from ability instanciation

* Add Todo.

* Remove Extra MarkDirty call

Same patch that went into main #96

* Fix unbound attribute replication issues

* Rooibot queue refactor (#95) (#97)

* Beginnings of general queue implementation

* Further work on bound queues.

* Convert abilities over to using the new bound operations queue.

* Refactor to generalize ability queue processing

* Convert effects to bound queue

* Refactor and cleanup

* A little more refactoring

* Support server-auth effects queued via GMC moves.

Note that this requires adding an SV_PreRemoteMoveExecution to your movement component, and calling into GMAS's PreRemoteMove call in that.

* Ensure that Queue-via-GMC effects work in standalone as well.

* Queue rework and cleanup finished!

* Last few tweaks to the queue setup.

* Further queue refactor and cleanup.

New queue types (ClientAuth, PredictedQueued) added.

* Add effect handles, so that PredictedQueued works right.

* Small cleanup on effect handle expiry.

* Correct desync for server-auth queue.

* Ensure we don't use the same ID if queuing two server-auth things in the same frame.

* Fix for Reznok's two-effects-in-one-frame issue.

* Correct issue with 2+ PredictedQueued operations in one tick, or 3+ ServerAuth queued.

* Fix off-by-one on server auth effect tick

* Fix a task ticking bug when multiple tasks happened in a row

* Fix:Add SourceComponent references to effect applications

* Add a bool to EffectData to preserve multiple instances of granted tags

---------

Co-authored-by: Rachel Blackman <packetdancer@gmail.com>
Co-authored-by: Rachel Blackman <rachel.c.blackman@gmail.com>

* - Allowing Predicted effect in Ancilary tick.

* [TO TEST] Moving tick of Actives Effect from Ancilarity to Predicted. Should fix the chain rollback with attribute

* Fixing Crash

* Re-added BL-453 Commit : fix for AbilitytData input activation tag missing from ability instanciation

* Fixing crash in ability task data

* Added EnsureMsfgIf to easier catch miss effect for users. TODO: Add effect tag.

* BL-527 : Fixing nested tag removal in active tag.
Issue reported as #98 in Reznok branch (#98)

--------------------------------------------

Issue was GetActiveEffectByTag() was looking also for depth in tag hierarchy. Fixed by adding an optional argument (bMatchExact), this argument has been set by default to true, and can mess with project who are calling this function if they are excepting in depht.

Not ideal for retrocompability, but i prefere to enforce a good practice over the time.

* Deep Worlds SA - Stability Update (#100)

* Add UPROPERTY Categories to allow compilation as engine plugin.

* Adding Method CancelAbility, allowing ending an ability without triggering EndAbilityEvent.
Internally, FinishEndAbility Method as also been added and ensure logics (see GAS termination of an ability)

* Moving Activation tag requirement check before instantiation of the ability.

* Added pre-check function for ability, allowing to have some basic test and allow to cancel an ability if they fail,
Overridable in C++ or in Blueprint.

* Adding Precheck and Cancelling by tag

- Adding PreCheck function allowing to test logic on the start of an ability
- Adding Cancelling ability by tag.

* Added Activity Blocked by ActiveAbility

* Fixing crash in HandleTaskHeartBeat.

* Change behavior for attribute ChangeCallback

- Callback OnAttributeChanged is now also called on SP
- Callback is now also called when the value is affected outside for whatever reason (like by SetAttributeValueByTag)
- Support Replay
- SetAttributeValueByTag now also re-caculate the value.

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* Change behavior for attribute ChangeCallback

- Callback OnAttributeChanged is now also called on SP/AP
- Callback is now also called when the value is affected outside for whatever reason (like by SetAttributeValueByTag)
- Support Replay
- SetAttributeValueByTag now also re-caculate the value.

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Clean before merge
- Removed Log message
- Removed irrelevant bounding

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Bug fixing and improvement for rep notify

* BL-279 Fixing Attribute notification

* BL-279 Adding Byte data type to Set Target for DW GMC Ability

* Improvement for tags, added duration

* BL-232 Progress

* BL-232 Initial work on External Effect/Ability Pending and Tag application

* BL-232 Working state.

* BL-232 Refactor and cleaning, handled now by Instanced Struct

* BL-232 Progress of the day

* Fixing a bug in remove effect.

They are now removing by specifique ID when outer removed, to ensure the list rest coherent client <-> server

* BL-232 Fixing removing effect

* BL-232 bug fixing in effect

* Bug fixing, adding accessor

* BL-232 Fix effect remove itself even is another instance is running

* Added getter

* Fixed name space for SetTargetDataFloat, Fixed EEffectType of GMCAbilityEffect sharing same name than playfab, Fixed wait for input key release with suggestion of Nas

* Stability
- Fixed name space for SetTargetDataFloat,
- Fixed EEffectType of GMCAbilityEffect sharing same name than playfab
- Fixed wait for input key release with suggestion of Nas
- GetAbilityMapData now return a const ref.

For compability, you probably want to add to core redirect those lines :
```
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectType",NewName="/Script/GMCAbilitySystem.EGMASEffectType")
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectState",NewName="/Script/GMCAbilitySystem.EGMASEffectState")
```

* Adding possibility for effect to end an active ability

* Changing Ability Blocking way.

They are now internally stored. An Ability store itself what ability it will block, instead of other ability who will block him.

This allow to modify during execution this behavior.
For example, you may be want to stop an ability activation only during X time in your ability execution.

* Adding a nicer way to end ability

* BL-225 Grenade 100%

* Fix clang error

* Adding Attribute Dynamic Condition to effect.

* Fix crash when an active effect has been destroyed

* Module upload

* GMC Update

* Addition of levitation actor

* Crash fix

* GMC Fix for starting abilities,
Fix for stamina,
Fix for crash,
Adding speed for orb,
Adding plugin for metahuman hairs.

* Update for log

* Fix for GetActiveEffect ?

* Typo fix

* Removing unecessary log

* Beginnings of general queue implementation

* Further work on bound queues.

* Convert abilities over to using the new bound operations queue.

* Refactor to generalize ability queue processing

* Convert effects to bound queue

* Refactor and cleanup

* A little more refactoring

* Support server-auth effects queued via GMC moves.

Note that this requires adding an SV_PreRemoteMoveExecution to your movement component, and calling into GMAS's PreRemoteMove call in that.

* Ensure that Queue-via-GMC effects work in standalone as well.

* Queue rework and cleanup finished!

* Last few tweaks to the queue setup.

* Further queue refactor and cleanup.

New queue types (ClientAuth, PredictedQueued) added.

* Add effect handles, so that PredictedQueued works right.

* Small cleanup on effect handle expiry.

* Correct desync for server-auth queue.

* Fix crash BL-SERVER-B

* Ensure we don't use the same ID if queuing two server-auth things in the same frame.

* Fix for Reznok's two-effects-in-one-frame issue.

* Correct issue with 2+ PredictedQueued operations in one tick, or 3+ ServerAuth queued.

* BL-453 Adding application must have tag.

* Fix for server compile

* BL-453 - Fixing AbilityData unset from ability instanciation

* Add Todo.

* - Allowing Predicted effect in Ancilary tick.

* [TO TEST] Moving tick of Actives Effect from Ancilarity to Predicted. Should fix the chain rollback with attribute

* Fixing Crash

* Re-added BL-453 Commit : fix for AbilitytData input activation tag missing from ability instanciation

* Fixing crash in ability task data

* Added EnsureMsfgIf to easier catch miss effect for users. TODO: Add effect tag.

* BL-527 : Fixing nested tag removal in active tag.
Issue reported as #98 in Reznok branch (#98)

--------------------------------------------

Issue was GetActiveEffectByTag() was looking also for depth in tag hierarchy. Fixed by adding an optional argument (bMatchExact), this argument has been set by default to true, and can mess with project who are calling this function if they are excepting in depht.

Not ideal for retrocompability, but i prefere to enforce a good practice over the time.

---------

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>
Co-authored-by: Younes Meziane <ys.aameziane@gmail.com>
Co-authored-by: Rachel Blackman <packetdancer@gmail.com>
Co-authored-by: Rachel Blackman <rachel.c.blackman@gmail.com>

* Fixing issue, fix crash on revive, adding

* Add CancelAbilityOnEnd to effects, allowing to stop abilities when the effect End.

* Fixing : Ability blocked by tag doesn't respect hierarchy.

e.g :
Before -> Ability.Item as blocked tag would not block Ability.Item.Use, Ability.Item.Consume but only Ability.Item
Now -> Ability.Item as blocked tag would block Ability.Item.Use, Ability.Item.Consume and Ability.Item

* Adding short wrapper of out ability effect, for c++ convenience.

* Adding Remove ability by tag

* Unreachable attempt to catch. Try to understand why, how, etc etc.

* Adding Starting effect and Ending effect event for blueprint.

* Virtualised Start Effect.

* Fixing bad class accessibility

* Fix log spamming (thank me later blue)

* Add better debug message for miss queue prediction of an effect (now display the list of concerned effect)

* Display selected actor's GMAS data in debugger (#103)

* Display selected actor's GMAS data in debugger

* Add methods to add/remove starting effects

* Server auth events 5.5 (#104)

Server Auth Events! They're like server auth effects, but for events!


* fix: merge conflict goofs

* Remove unnecessary header includes

* Keep StructUtils depdendency for older version support

* Display selected actor's GMAS data in debugger (#103)

* Display selected actor's GMAS data in debugger

* Add methods to add/remove starting effects

* Server auth events 5.5 (#104)

Server Auth Events! They're like server auth effects, but for events!


* fix: merge conflict goofs

* Remove unnecessary header includes

* Keep StructUtils depdendency for older version support

* Fixing missing category specifier.

* Fixing version compability with 5.4 and 5.5 for instanced struct

* Fixing issue, fix crash on revive, adding

* Add CancelAbilityOnEnd to effects, allowing to stop abilities when the effect End.

* Fixing : Ability blocked by tag doesn't respect hierarchy.

e.g :
Before -> Ability.Item as blocked tag would not block Ability.Item.Use, Ability.Item.Consume but only Ability.Item
Now -> Ability.Item as blocked tag would block Ability.Item.Use, Ability.Item.Consume and Ability.Item

* Adding short wrapper of out ability effect, for c++ convenience.

* Adding Remove ability by tag

* Unreachable attempt to catch. Try to understand why, how, etc etc.

* Adding Starting effect and Ending effect event for blueprint.

* Virtualised Start Effect.

* Fixing bad class accessibility

* Fix log spamming (thank me later blue)

* Add better debug message for miss queue prediction of an effect (now display the list of concerned effect)

* Fixing missing category specifier.

* Fixing version compability with 5.4 and 5.5 for instanced struct

* Remove outdated GMCAbilityOuterApplication.h

* Refactor deprecated RemoveAtSwap for UE5.4+

* Update Plugin details

* - Fix for linux compile on GMC

* - Fix for linux compile on GMC

* Add getter for ability map and blueprint read GetActiveTags (#109)

* Update Effect Duration comment

* Fixing crash in GMC Acknowledgments.

* Fixing crash in GMC Acknowledgments.

* Check Application Must/Must Not have tags for Effects

* Default abilities to use Anc tick instead of Movement

* Fixing crash in GetAllAttributes.
---

We taking copy of bound and unbound attribute struct, but for that we was using a for loop, storing the reference of the for ranged based iterator, instead of the element itself, resulting in UB once the stack was clear. The auto-inlined by the MVSC hidded the issue (i guess ?).

* Add Async Hit Data task (#115)

* Add UPROPERTY Categories to allow compilation as engine plugin.

* Adding Method CancelAbility, allowing ending an ability without triggering EndAbilityEvent.
Internally, FinishEndAbility Method as also been added and ensure logics (see GAS termination of an ability)

* Moving Activation tag requirement check before instantiation of the ability.

* Added Activity Blocked by ActiveAbility

* Fixing crash in HandleTaskHeartBeat.

* Change behavior for attribute ChangeCallback

- Callback OnAttributeChanged is now also called on SP/AP
- Callback is now also called when the value is affected outside for whatever reason (like by SetAttributeValueByTag)
- Support Replay
- SetAttributeValueByTag now also re-caculate the value.

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Clean before merge
- Removed Log message
- Removed irrelevant bounding

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>

* BL-279 Bug fixing and improvement for rep notify

* BL-279 Fixing Attribute notification

* BL-279 Adding Byte data type to Set Target for DW GMC Ability

* Improvement for tags, added duration

* BL-232 Progress

* BL-232 Initial work on External Effect/Ability Pending and Tag application

* BL-232 Working state.

* BL-232 Refactor and cleaning, handled now by Instanced Struct

* BL-232 Progress of the day

* Fixing a bug in remove effect.

They are now removing by specifique ID when outer removed, to ensure the list rest coherent client <-> server

* BL-232 Fixing removing effect

* BL-232 bug fixing in effect

* Bug fixing, adding accessor

* BL-232 Fix effect remove itself even is another instance is running

* Added getter

* Stability
- Fixed name space for SetTargetDataFloat,
- Fixed EEffectType of GMCAbilityEffect sharing same name than playfab
- Fixed wait for input key release with suggestion of Nas
- GetAbilityMapData now return a const ref.

For compability, you probably want to add to core redirect those lines :
```
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectType",NewName="/Script/GMCAbilitySystem.EGMASEffectType")
+EnumRedirects=(OldName="/Script/GMCAbilitySystem.EEffectState",NewName="/Script/GMCAbilitySystem.EGMASEffectState")
```

* Adding possibility for effect to end an active ability

* Changing Ability Blocking way.

They are now internally stored. An Ability store itself what ability it will block, instead of other ability who will block him.

This allow to modify during execution this behavior.
For example, you may be want to stop an ability activation only during X time in your ability execution.

* Adding a nicer way to end ability

* BL-225 Grenade 100%

* Fix clang error

* Adding Attribute Dynamic Condition to effect.

* Fix crash when an active effect has been destroyed

* Module upload

* GMC Update

* Addition of levitation actor

* Crash fix

* GMC Fix for starting abilities,
Fix for stamina,
Fix for crash,
Adding speed for orb,
Adding plugin for metahuman hairs.

* Update for log

* Fix for GetActiveEffect ?

* Typo fix

* couple of misc fixes from rebasing deep worlds fork

* Add SetTargetHit

* Revert "Merge remote-tracking branch 'upstream/dw_dev' into OMS_CustomTasks"

This reverts commit 1581283, reversing
changes made to 1fbe07a.

---------

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>
Co-authored-by: Eric Rajot <aherys@deepworlds.studio>
Co-authored-by: Peter Gilbert <petegilb@bu.edu>

* Allow for overriding block and cancel methods (#113)

* - Added SetTargetDataInstancedStruct and SetTargetDataTransform ability tasks. (#111)

* Various Listen Server fixes

* fix WaitForInputKeyRelease firing multiple times on timeout

* Slightly cleaner fix for WaitForInputKeyRelease

* Experimental: Have ability tasks tick before ability ticks

* Experimental: Move majority of Task logic to happen in Anc tick instead of Pred tick

* Experimental: ability executes BeginAbility before Ticking

* Experimental: ability no longer ticks after EndAbility

* Add a TimedOut pin for KeyRelease and KeyPress. Allow KeyPress to check if key is currently pressed at start

* feat: Add spawning of Niagara Systems and Sounds from the ASC

* Add option for sim proxies to delay particle spawning by GMC smoothing delay

* Add WaitForInputKeyPressParameterized and Cancel Abilities by a group of Tags (nas) (#118)

* Parameterized Input Key Press Task (#117)

* - Added Parameterized Input Key Press Task

* 5/6

* Give the Key Task OnTick and Timeout pins

---------

Co-authored-by: NarsBars <150587668+NarsBars@users.noreply.github.com>

* Bug fixes for WaitForGameplayTagChange Task (#112)

* Filter SmoothedListenServerPawn from checking tag and attributes on GenSimulationTick

* Fix typo where Unset tag change checks AddedTags instead of RemoveTags

* definition tags query (#119)

* - Added Parameterized Input Key Press Task

* 5/6

* Update GMCAbilityComponent.cpp

* Update GMCAbility.cpp

* DefinitionTags

* query fixed for effects

* Update GMCAbility.cpp

unnecessary warning

* Fix OnAttributeChanged double calling

* Remove extra logging. Make SpawnSound and SpawnParticles public

* Add Location for SpawnSound

* Add CurrentMontage to GMCWaitForGMCMontageChange output pins

* remove effects by definition query (#120)

* - Added Parameterized Input Key Press Task

* 5/6

* Update GMCAbilityComponent.cpp

* Update GMCAbility.cpp

* DefinitionTags

* query fixed for effects

* Update GMCAbility.cpp

unnecessary warning

* Remove Effects By Definition Query

* Tag queries for everything (#121)

* - Added Parameterized Input Key Press Task

* 5/6

* Update GMCAbilityComponent.cpp

* Update GMCAbility.cpp

* DefinitionTags

* query fixed for effects

* Update GMCAbility.cpp

unnecessary warning

* Remove Effects By Definition Query

* queries queries queries

queries for everything

* Fix OnAttributeChanged not being called on servers. Add PeriodTick event to Effects.

* Effect Applied/Removed Delegates (#123)

* - Added Parameterized Input Key Press Task

* 5/6

* Update GMCAbilityComponent.cpp

* Update GMCAbility.cpp

* DefinitionTags

* query fixed for effects

* Update GMCAbility.cpp

unnecessary warning

* Remove Effects By Definition Query

* Effect Delegates

Effect Delegates

* Remove extra params

* Rotate Yaw Towards Direction Task + Ability Task Categorization Unification (#122)

* - Added Parameterized Input Key Press Task

* 5/6

* Update GMCAbilityComponent.cpp

* Update GMCAbility.cpp

* DefinitionTags

* query fixed for effects

* Update GMCAbility.cpp

unnecessary warning

* Remove Effects By Definition Query

* Rotate Yaw Towards Direction Task + Unify categorization of Ability Tasks

* - Added timeout event on task to allow user to react to it
- Cleanup code for engine and linux compilation

* ** Input Handling Update **
- `ETriggerEvent`: Changed trigger event from `Started` to `Completed` for `AbilityInputAction` binding.
- Input magnitude check: Adjusted condition to correctly detect magnitude with `!ActionValue.GetMagnitude()`.

Signed-off-by: Aherys <aherys@deepworlds.studio>

* **Added**
- `KismetSystemLibrary` include in `WaitForInputKeyPress.cpp` for expanded functionality.

**Updated**
- Changed input trigger event from `ETriggerEvent::Completed` to `ETriggerEvent::Started` in `WaitForInputKeyPress` task for immediate keypress detection.

Signed-off-by: Aherys <aherys@deepworlds.studio>

* - `Rename` method `CancelAbilities` to `CancelConflictingAbilities` for clarity.
- `Enhance` documentation for `CancelConflictingAbilities` to explain its functionality, including tag-based and query-based cancellation checks.

Signed-off-by: Aherys <aherys@deepworlds.studio>

* **GMCAbilityComponent**
- `QueueAbility`: Added `bPreventConcurrentActivation` parameter to prevent concurrent activation of the same ability.
- Implemented local checks in `QueueAbility` to reduce server load and handle ability concurrency locally.
- Updated comments and function documentation for enhanced clarity.

Signed-off-by: Aherys <aherys@deepworlds.studio>

* **Code Cleanup**
- `GMCAbilityComponent.cpp`: Removed trailing whitespace to improve code formatting.

Signed-off-by: Aherys <aherys@deepworlds.studio>

* **Refactored Attribute Processing System**
- Introduced `ProcessPendingModifiers` and `AddModifier` functions for centralized modifier handling in `GMCAttributes`.
- Removed redundant modifier fields (`AdditiveModifier`, `MultiplyModifier`, `DivisionModifier`) in `GMCAttributes`.
- Added `ProcessAttributes` and `PurgeModifierHistory` to `GMCAbilityComponent` for improved attribute management.
- Reworked `ApplyAbilityEffectModifier` to use streamlined attribute processing.
- Introduced attribute-related unit tests (`FAttributeUnitTest.cpp`) for validating modifier application logic.
- Updated `GMCAbilitySystem.Build.cs` to add automation dependencies for testing.

** Attribute Refactor**
- Attribute over time work now based on delta time, each tick, instead of period.
- Attribute will now respect network prediction
- Modifier have now different priority (The phase, The priority and the Operator define the order), they can be set by the user at will.
- Order of Modifier operation is now deterministic
- List of Modifier for attribute :
 - Percent (Percent of the Actual value)
 - Addition (Addition of the current value)
 - Set To base (Reset the value to the base)
 - Percent On Base Value (Apply a percentage from base value to the current value)
 - Set to Value (Direct set to a value)
- Overflow of clamp is now properly handled, including for the replay, and negate at end.
- You can now set a modifier to have as value an attribute instead of a value Usefull for cross operations between attribute.
- Todo : Ability to set dynamically by the code the base value of an attribute at initialisation
- Todo : link back with effect system and event.

* **Refactored Modifier History System**
- Introduced `FModifierHistory` for cleaner separation of bound and unbound modifiers.
- Implemented `AddMoveHistory`, `CleanMoveHistory`, and `ExtractFromMoveHistory` methods for better modifier handling.
- Updated `ProcessPendingModifiers` to directly work with the new history structure.
- Replaced `PurgeModifierHistory` and obsolete functionality in `GMCAbilityComponent`.
- Enhanced test suite in `FAttributeUnitTest.cpp` to validate new modifier operations and interactions.
- Improved code maintainability and fixed edge cases related to modifier history management.
- Large Optimisation of the memory used by AttributeHistory (0.75mb -> 0.33mb on 50k test).
- Large Optimisation of performances for move history
- Split bound and unbound queue for attribute history, added the concept of agglomeration for attribute of the same action timer
- Writing more than 100 units test to ensure attribute constitancy.

* **Refactored Attribute Modifier System**
- Updated `ProcessPendingModifiers` to return a boolean indicating attribute modification status.
- Added logic to broadcast changes for unbound attributes when modified.
- Improved `AttributeDynamicCondition` handling in `PeriodTick` for conditional modifier application.
- Removed unused/obsolete code for cleaner implementation.

* Fixing typo in comment

* **Introduced Custom Modifier System**
- Added `UGMCAttributeModifierCustom_Base` class for modular and extensible attribute calculations.
- Implemented `UGMCModifierCustom_Exponent` with four exponent calculation types (`Mapping`, `Easing`, `Custom Power`, `Saturated`).
- Updated `ProcessPendingModifiers` to support custom modifier logic via `CustomModifierClass`.
- Enhanced `UGMCAbilityEffect` with `ProcessCustomModifier` function and caching for custom modifier instances.
- Improved input validation and error logging for attribute modifiers.
- Updated `GMCAttributes` to handle conditional and dynamic calculators efficiently.

* **Refactored Effect Application and State Management**
- Adjusted `HeartbeatMaxInterval` to 1.5f for improved network resilience.
- Introduced `EGMCEffectAnswerState` enum to handle effect prediction and confirmation states (`Pending`, `Timeout`, `Validated`).
- Enhanced effect lifecycle management with `DeclareEffect` and auto-removal logic during ability end.
- Improved effect application logic, including new `ApplyAbilityEffectSafe` and `ApplyAbilityEffectShort` overloads for optional handling ability.
- Added `GetActiveEffectByHandle` and `RemoveActiveAbilityEffectByHandle` methods to enhance effect access and removal.
- Updated effect logging and validation for better debugging and readability.

* **Enhanced Debugger and Metadata Usage, Attribute Refactor Improvements**
- Added detailed client-server consistency checks and metadata enhancements to gameplay debugger categories.
- Enhanced metadata (`TitleProperty`, `AdvancedDisplay`, `EditCondition`, `DisplayAfter`) for attributes, effects, and abilities for better editor usability.
- Improved string formatting for `ToString` methods across abilities, attributes, and effects for cleaner debug logs.
- Addressed `GMCAbilityEffect` property state coherence and added validation logic in `PostEditChangeProperty`.
- Updated numerical metadata representation in attribute clamp and ability map for enhanced clarity.
- Optimized memory usage and performance in modifier history and active effect systems.
- Enhanced debugger display to show numerical summaries for attributes, effects, and abilities.

* - new attribute system
- gunflare fix
- multiple helicopter extraction

Signed-off-by: Aherys <aherys@deepworlds.studio>

* Remove FORCEINLINE from AddModifier in GMCAttributes.h

Signed-off-by: Aherys <aherys@deepworlds.studio>

* Remove unused ToolMenusEditor include from GMCAttributes.cpp

Signed-off-by: Aherys <aherys@deepworlds.studio>

---------

Signed-off-by: Eric Rajot <aherys@deepworlds.studio>
Signed-off-by: Aherys <aherys@deepworlds.studio>
Co-authored-by: Peter Gilbert <33180578+petegilb@users.noreply.github.com>
Co-authored-by: Rachel Blackman <packetdancer@gmail.com>
Co-authored-by: Eric Rajot <aherys@deepworlds.studio>
Co-authored-by: Younes Meziane <ys.aameziane@gmail.com>
Co-authored-by: Peter Gilbert <petegilb@bu.edu>
Co-authored-by: dcharleston <dylancharleston@gmail.com>
Co-authored-by: utf8decodeerror <30543450+utf8decodeerror@users.noreply.github.com>
Co-authored-by: utf8 <uft8decodeerror@gmail.com>
Co-authored-by: Rachel Blackman <rachel.c.blackman@gmail.com>
Co-authored-by: Nas <37818222+Nasuru@users.noreply.github.com>
Co-authored-by: JustSomeGuyStudio <89358994+JustSomeGuyStudio@users.noreply.github.com>
Co-authored-by: Ryan Lim <crezetique@gmail.com>
Co-authored-by: NarsBars <150587668+NarsBars@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance Code cleanup, portability considerations, and such
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants