Pause/unpause GameplayEffect has hiccups

hi there…

For my Project, i implemented GAS, including a Stamina system.
This System regenerates stamina over time with an infinite GameplayEffect applied to the Player.

Now, i want to pause this Effect while the Player is activating abilities, that drain Stamina. Doing that by adding a “StaminaDrain” Tag, via the Abilities itself, to the Player and the Regeneration effect has an OnGoing Ignore Tag Value of that.

This works… most of the time… but sometimes it happens, that the Drain Tag isn’t removed… only when activating the ability again… like it gets a hiccup on removing the drain Tag…

is there a more efficient way on adding the Drain Tag on ability call and remove it when EndAbility is called?

Just in case i’d like to clarify whether you doing it via GEs or by manually manipulating current tags container on ASC. While the latter case is possible, it’s not the best way of doing things.

Also please clarify how exactly you removing your tag. For example i had no problems with RemoveGameplayEffectFromOwnerWithHandle() on EndAbility, unless i was doing something incredibly wrong.

Another things to check:

  • are you actually ending your ability or it keeps lingering active, without doing anyting? (unhandled execution path that doesn’t end with “end\cancel ability”)
  • are you having network emulation enabled in your editor with quite bad settings that can cause different problems? (though gas is designed to solve most of the problems automatically)

Also you can use showdebug abilitysystem in console to check ASC state on your current pawn, this may shed some light on what exactly is going on

The StaminaDrain Tag is given and (so i understand it) removed via the “Activation Owned Tags” Array in the GPA BP.

Means… the Tag should be granted while the ability is active… but removed, if not active.

I can and could remove GameplayTags with the simple “RemoveGameplayTag” Node, giving the ASC Tag Container and remove it… but i understood it that way, that the ability should handle that by itself via the Owned Tags Array…

Every Ability has an EndAbility or CancelAbility Node, no open Nodes… everything is has an end node attached.

No Network emulation right now.

showdebug abilitysystem

didn’t know about that commanf… but got a problem there… The game needs to play in standalone for Redpoint EOS and servertravel to work… and… on my Windows PC, the console is not opening in Game…:sweat_smile:
Perhaps one knows why and how to fix that?

oh, i’m rarely use this, so already forgot about this method, but it’s a valid method for sure.

disclaimer: i didn’t work with eos

We are talking about multiplayer code here, right? If so, then in first place, for testing of combat you doesn’t need this. Unless your archetecture really prohibit it or you haven’t set up debug environment (i mean, bunch of “IFs” for game to work properly from editor without manual login and other stuff) - you can test it in PIE.

The few reasons i’m aware for console not to work are:

  • You testing on packaged build in shipping mode… but it cant be the truth, right?
  • You handling input improperly and catch tilda so it doesn’t make it to console handler. Though afaik it’s also hard to break it this way.
    So probably you should google this.
Just to make sure

Most of multiplayer features, including seamless travel can be tested in this mode


Not sure about EOS, but should probably work too

You can also just print to log\screen current active abilities\tags on both sides or put prints on every step of ability. If you confirm the problem isn’t in your ability code, then probably you should spend some time with debugger&ASC

Unfortunately i have no more ideas, goodluck with this

done printing…
and yes, th StaminaDrain stays applied if things go to quick…

But…
found out AddLooseGameplayTag and RemoveLooseGameplayTag exist…

i will give that a try to apply/remove via those Nodes manually on need… perhaps that runs better…

The Tilda isn’t overwritten… using EnhancedInput and nowhere use that key… Console isn’t firing on a complete empty project either… perhaps a bug situation in thr combination of my Win11 and UE5 :person_shrugging:t2:

and no… not on a packaged build… that would be time consuming af…

Ok… seems not to work

I now added a list of attributes and the Owned GameplayTags to my HUD… so I can track the list constantly.

And here is my current setup of the simple Dodgeroll Ability…

First… the Input call from the PC:


(I know autobind of inputs exist… but this one works… so… I will stay with that for now…)

Leads into ActivateInput:

Leads into the HandleDodge of the Pawn:

Now, we stay in the Pawn and Play the Dodge:

First, we play the Montage and then Grant the Blocking Tag to stop the Stamina regeneration. Here, the Montage:

This Starts the Montage and OnCompleted sends the finishing Event to the Dodge Ability, removes the Stamina Regeneration Block and resets the DoOnce of the Dodge in the PC.

Now… this is the BlockStaminaReg Event:

Since i wasn´t sure how to remove a Tag, I used both… the one from the ASC and the RemoveLoose… but… both fail… the Block Tag stays remaining.

Just for clearance… this is the GameplayTag Graph of the GameplayEffect StaminaRegeneration:

No matter what happens… the “regenerate.Stamina.Block” Tag stays on the list (and yes, the list gets cleared every time I update it… and it gets updated after every call of the BlockStaminaReg Event).

Well, you definitely overcomplicating a few things:

  1. you don’t need to pass input to server, you can TryActivateAbility*() directly from client. ASC will handle forwarding ability to server (unless prohibited) and calling it here, as well as cancelling client ability if activation was rejected by server by some reason (for example, you was stunned, but client didn’t know that yet).
    To be clear: you should call InA_JumpDodgeTryActivateAbility*() instead of InA_JumpDodgeServerActivateInput()
    Though depending on your goals passing inputs can be a valid approach

  2. that do-once\reset thing - if you don’t want ability to be able to activated simultaneously twice:

  • You set GA’s instancing mode to instanced per actor
  • You set ability tag to something like ability.dodge
  • You set GA’s block abilities with tags to ability.dodge
    This way you will only have a single instance of ability ever and you won’t be able to relaunch ability.dodge abilities while you have this ability running due to it block other ability.dodge abilities
  1. you having your ability logic (play dodge, play montage, events, etc) outside of your ability.
    You supposed to go into GA_DodgeRoll and override ActivateAbility() or ActivateAbilityFromEvent() event here. And put all the ability logic like playing montages, applying GEs, etc here. After you have done with ability, you calling EndAbility() on all possible execution paths

In case you missed it, i can suggest tranek’s doc as well as epic’s ActionRPG example project(you can download it from launcher), where they setup and use GAS.

1.)
oh… i need to… since Dodge and Jump won’t be the only Abilities in that system, and each one needs to pass diferent Mode Configurations later… so… to not Duplicate 40+ Nodes over and over again… i prevent that by using this event to get some organized Graph.

Same problem as the init op one… Tags are not applied/removed properly… so… i tried that… but needed to use DoOnce…

i know. Currently that all is a bit messy… But… Playing Montages and Character Sided Systems, stay there… But will get placed into an interface system…
reason:
i need to play many different montages for many different aczors, skeletons and bonetypes… so… i let the montages play character sided, so each character can be individually setup. I will later just call an Interface event for “PlayCharMontage” if the interface is implemented…

But… since currently… the GameplayTags still won’t get removed properly… i can’t go on changing things… if even this hard to fail path is not working… :sweat_smile:

tried it with a simple add and remove call… without any other effect, montage, attribute change…etc…

just an ability that should add the Regenerate.Stamina.Block Tag on Activating… and remove it after 3 seconds…

applies Tag, yes…
removes Tag, nope…

just an uodate… and… solution… since it worked for me…

okay…
i created a new public, accessible Container of GameplayTags in my GAS_CharacterBase.

I then used this Container->Add-/RemoveGameplayTag
And then… i added that container to the ASC GameplayTags.

This… worked… what i still don’t knie is, why

Get ASC -> GetGameplayTags -> Add-/RemoveGameplayTag

is not working… GetGameplayTags returns the ASCs GameplayTags Container… but is not allowed to receive or remove Tags… just push or pull another container to or from it…

But… it works for me now… perhaps someone knows more here… i finish this :smile: