Able Ability System Info and Support Thread

@ Hi , I wanted to alert you to another problem we’ve encountered with Passives. If you have a passive ability that uses PlayAbility to spawn a couple more passives on the same actor, there is a crash (exception in editor) that can occur. If you look in the TickComponent code where you update Passives, you’re using this loop with an iterator:

for (UAblAbilityInstance* Passive : m_PassiveAbilityInstances)

If any of the InternalUpdateAbility(Passive,…) calls spawn new passives (like in the case above) then the m_PassiveAbilityInstance array will be modified. We’ve had a few crashes when this happens so I changed the code to do a reverse iteration like so:

for (int idx=m_PassiveAbilityInstances.Num()-1; idx >= 0; idx–)

This should allow for removals and additions (though adds will be skipped in the current iteration) without throwing any exceptions. You may choose to solve it a different way, but I wanted to let you know there was a problem.

Thanks,
Mike

Hey Mike.

That change makes sense. The only problem I see is if you do a reverse iteration, your new passives may not be updated (which may or may not be intended) that frame, which may or may not be fine.

I’m slightly shocked you were able to modify that passive in place, they should be queued up to be applied the next frame. How are you applying the passives? Just calling ActivateAbility?

Thanks @. Even with the change I’m not having any success with the CancelAbility task.

Aside from that, in my multiplayer match when a game ends I am getting a crash here:

Assertion failed: !IsUnreachable() [File:D:\Build++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp] [Line: 1158] None None.None Function: ‘/Script/AbleCore.AblAbility:OnAbilityEndBP’

ProjectName!FDebug::AssertFailed()
ProjectName!UObject::ProcessEvent()
ProjectName!UAblAbility::OnAbilityEndBP()
ProjectName!UAblAbilityComponent::BeginDestroy() [d:.…\able\source\ablecore\private\ablabilitycomponent.cpp:227]
ProjectName!UObject::ConditionalBeginDestroy()
ProjectName!CollectGarbageInternal()
ProjectName!CollectGarbage()
ProjectName!UEngine::TrimMemory()
ProjectName!UEngine::LoadMap()
ProjectName!UEngine::Browse()
ProjectName!UEngine::TickWorldTravel()
ProjectName!UGameEngine::Tick()
ProjectName!FEngineLoop::Tick()
ProjectName!GuardedMain()
ProjectName!GuardedMainWrapper()
ProjectName!WinMain()
ProjectName!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283]
kernel32
ntdll

I’m not actually overriding the functionality of OnAbilityEnd in any of my ability BP’s, I’ve even tried deleting the node from the ability event graphs but I still get this at the end of every match. Any clues?

Not off the top of my head. If possible, can you zip up your project (or create a quick sample) and upload it here. That will help me diagnose things and make sure I get the proper fix out.

On the reverse iteration, yes that’s what I meant when I said the adds would be skipped for the current iteration. That IS okay for my specific case, but maybe there is an issue for others? Not sure.

I do see where you have protection in ActivateAbility while processing an update, so I started digging into the issue all the way through the stack and found the issue. I added a picture of where the problem is. It’s in the ActivateAbility IsNetworked() block when the game IS authoritative. There is no IsProcessingUpdate check.

On a completely unrelated topic (or two), is there a reason you chose to make this an engine plugin instead of a project plugin?

Also, I know you like data driven design, so I was curious why your AI tasks take an explicit ability reference rather than using a FBlackboardKeySelector to get the ability from the blackboard. I actually modified several of the AI tasks to use the BB and it works out nicer for my case. I have a shared Attack tree that just plays whatever Ability is on the blackboard for the AI using the tree. That lets me put data in a data table and push it to the BB.

Yea, I think I’d prefer to have it delay the application of the new abilities till the next frame during an update. And yes, that line is the offending line. It should check if we’re in the middle of processing an update and defer like the non-authoritative logic does above it. I’ll get in a fix this weekend.

As for the Engine Plugin vs Project Plugin, UE tends to play nicer with Engine Plugins in my experience. That’s the only reason.The AI feedback is really good, I’ll look into adding that rather than the explicit version (or give you an option for either - I can see use cases for both).

Submitted Able v2.26

@Rthomp1 I was able to successfully cancel Abilities through the Cancel Ability Task in this update, so let me know if it still doesn’t work for you.

@mikecoker Still looking into the AI changes you proposed. However, the bug you were experiencing should be fixed now.

Great.
i like it

OK, thanks. Also, did you look at that first issue I asked about regarding the server not replicating new passives? I did add that boolean you suggested to let me know when a passive was added on the frame to force PassivesChanged to be true, however, I think it could be resolved by moving the CachedPassiveSize above the active update, since the active was spawning the passive.

The root cause was that actives were adding passives during a processing update when the client was authoritative. With the latest, they get delayed till the next frame so they won’t be added mid update and cause issues with that logic.

Able v2.27 Submitted:

Able v2.28 Submitted:

Able v2.29 Submitted:

is there an easy fix that the content browser for selecting the preview? Often when I select the class as character - hes not suggesting me any blueprint for preview.
STILL a problem with blend in and blend out for anim montages on play anim as montage. or somehow Im using it wrong. in order to play in a specific slot you should feed anim montage as input animation however as its “play as dynamic montage” it should take anim instance so maybe that’s what Im doing wrong? still… in any combination - not working blend out. 4.20 newest update.

Hi AngelV,

I think you’re talking about multiple issues here, so I’m going to split them up and respond to each.

Try turning on “Show Internal Classes” and see if that pops it up. I’m still not happy with the Preview Selection workflow, so it’s something I’m actively looking at how I can simplify things right now. Just to verify, this isn’t something that broke, it’s something that you would like to be easier?

You should be passing in an AnimMontage (it just happens to inherit from AnimInstance) if you are using Dynamic Montages. Other than that, everything is handled on Epic’s end (I’ve even exposed the slot name used for the Dynamic Montage if you want to change that). If you want to blend in/out Anim Instances dynamically, I would suggest using the “Ability Animation Node” option and just setup the Ability Animation Node within your Animation Blueprint:

https://extralifestudios.atlassian.net/wiki/spaces/ABLE/pages/4882437/Setting+up+an+Ability+Animation+State+Node

Hi,
On the first topic… Unfortunately in 4.20 its broken. it takes forever to load any object into the browser and loads nothing. However I can make abilities without checking preview if I know what im doing :wink: I will check the “show internal classes”
I am passing anim montage to montage slot, yet still it happens. As I pass the montage it uses the slot already in the montage as it should. It should blend-out as it does on montages used in blueprint right? the effect should be exactly the same?
As for the animation node - I had problems with bad read of “isrunningabilityAnimation” and I had problems with using the node outside of a state machine. or when I used it in a state machine inside a state machine.
I just don’t get why the montage blends out dirty :frowning:

And just on the margin: I love your plugin. I suggest it to everyone. its a solid 5/5. I was using it to run pickups, inventory management, and it helps manage multiplayer so much, as well as fragment code and allow to utilize “is playing ability” instead of “anim instance - is playing montage”. The use cases are limitless!
But this one thing is still bugging me out somehow. :smiley:

Hmmm, Let me play with things over the weekend. If you have a sample project setup that I could reference, send me a PM or such with a link and I’ll use that specific project to see what it could be.

EDIT: Also, which Blend Out time are you trying to use? The one in the Montage itself, or the one you set in the Ability with the Play Animation Task?

I have the montage and ability use the same blend in and out just in case. it blends out, but on the last frame the entire pose kindof… resets.

Resets as it goes back to the animation beginning and then stops (jerking motion basically)? Or your character goes into a T-Pose?

hard to see if he tries to go into T… looks like he forgets the state he has of the animgraph. like the anim instance is being set again for anim blueprint or something.