x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Animation blueprint switch desktop-crashes engine

(version 4.12.5)

Hi everyone, I have a question I am actually pulling my hair over. In our game we have lots of different animation blueprints, which we apply on main pc for various conditions (as opposed to a master animation gigablueprint which would have tons of nested state machines). Our approach however causes engine to desktop crash at times when it's necessary to switch ABP (not always but very often). Sometimes it helps to put delays after the ABP switch but I am not going this way since it would make the whole game unpredictable.

It boils down to this method:

UE4Editor_Engine!USkeletalMeshComponent::ApplyAnimationCurvesToComponent() [d:\build++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\components\skeletalmeshcomponent.cpp:1419]

specifically this line: if (SkeletalMesh && InAnimationMorphCurves && InAnimationMorphCurves->Num() > 0)

My main question is:

what is a preferred way to handle this? In our game we have lots of event specific animations (as opposed to a standard simple state machine). I have a feeling that we might be doing this all wrong otherwise nobody would be able to make an actual game. :)

I will be grateful for any advice how to approach this or for any idea how to workaround those crashes.

Thank you!

Product Version: UE 4.12
Tags:
more ▼

asked Jul 27 '16 at 01:53 PM in Bug Reports

avatar image

metamorphium
107 7 13 23

avatar image Matt.Williams Jul 29 '16 at 07:50 PM

Hi metamorphium,

I've tracked down your crash in our system, but I'd like to get a decent repro internally. Are there specific AnimBPs that you're switching from that appear to cause this more regularly? If so, is there anything unique about them that may help me reproduce this?

I'd also like to address switching AnimBPs.

When you say event specific animations, are these animations that could be covered by firing an AnimMontage?

State Machines within State Machines isn't an unheard of thing, but typically what I see as an efficient way of working is to have separate state machines for different actions. Then you blend between them in the AnimGraph to produce the desired effect. I really wish I could post

For example, you have a Locomotion State Machine, but you do a LayeredBlendPerBone on another state machine that controls the upper body and grips for different weapons. Alternatively, you can have a BlendbyInt inside of any given state that switches to different weapon grips.

Maybe that's not your case, but I'd definitely suggest posting on the forums to get opinions about the best way to tackle your animation system needs.

Also watch this: https://youtu.be/3NK97psTA8g?t=9m36s

-Matt W.

avatar image metamorphium Jul 29 '16 at 08:27 PM

Hi Matt,

Thanks a lot for looking into my issue!

In my case I prefer to have ABP as simple as possible so it's always a relatively simple state machine without any complex logic or nesting.

But! I believe I've tracked down the always-reproducible case.

Basically the engine always crashes if an animation is playing while you change the animation instance class. The tricky part is that for Unreal the ApplyAnimationCurvesToComponent is being called even after the animation is no longer playing. This nondeterministic amount of time is basically where the crash occurs because my game thinks that the animation is over and I can switch but it is not.

My workaround is that I've added a small delay (0.5 s) after the animation is over before I switch the Animation Blueprint and the crash went away. I also alternatively tried to stop the animation but it didn't help (respectively, even after calling the manual Stop, I still have to put there that delay).

If I would repair this, I would probably make sure that Set Anim Instance Class terminates all animations and waits for a proper closure. But I didn't look deep enough into the engine code yet. :(

avatar image Matt.Williams Aug 03 '16 at 07:54 PM

Hey metamorphium,

Any way you can reproduce this in a Third Person Template project? I'm having trouble getting this to occur on my end. If you get it to work, you can either send screenshots or the project itself.

-Matt W.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

-2 answers: sort voted first

It is a bit hard to gather the necessary info without seeing a stack trace, but the ApplyAnimationCurvesToComponent() function is called from the AnimInstance, i.e. the Animation Blueprint. So the fact you switched your AnimBP with another is causing issues for the original one, which seems to still be around.

What might help is to add a 0 second (aka single frame) delay. That way there isn't any unpredictable behavior and the previous AnimBP has time to clean up. Alternatively, you might want to see if there's a way to stop the previous AnimBP logic before switching to a new one.

more ▼

answered Jul 27 '16 at 02:22 PM

avatar image

DamirH
589 22 23 41

avatar image metamorphium Jul 27 '16 at 02:50 PM

Thank you, DamirH,

unfortunately neither of those suggestions worked. :( I tried both setting the animation to default state (just idle) and adding single frame delay. Crashes are still there.

avatar image DamirH Jul 27 '16 at 07:38 PM

I did not mean to reset the anim BP to idle - I meant to actually disable, or even destroy it. I haven't done this myself and won't be able to give it a shot until I get to the office but I can't think of a different way to do this.

avatar image oxyg1n Apr 25 '17 at 11:20 PM

Adding delay of 0 before Set Anim Instance Class helped me out in my case. Thank you DamirH.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question