Announcement

Collapse
No announcement yet.

Animation Blueprints: How to manage multiple NPC's with different animations?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Animation Blueprints: How to manage multiple NPC's with different animations?

    Do i need to create separate Animation Blueprint for every NPC/Monster that has, for example, different walking animation? Or can i somehow create one 'master' animation BP and then derive from it in child classes, only changing variables determining certain animation assets? I can't find a way to do something like this.
    Basically, every NPC/monster with different animation/behavior would have different State Machine, but how to do it? The only thing i know is that we can select different State Machines in Anim Graph -> Final Animation Pose via Select node depending on variable, but of course it has only two elements available to hook up. Or is there some other way to implement it?

    #2
    You can create a child blueprint based on your anim blueprint, and there is an "Asset Override Editor" that lets you select any player nodes in the parent anim graph and override the asset references in them to refer to a different asset.

    You cannot modify the structure of the graph, but you can do things like add a Blend By Enum or Blend By Int node in the parent graph driven from a variable, and override the value of that variable in each child in order to choose different subgraphs for certain things.

    Cheers,
    Michael Noland

    Comment


      #3
      Thanks, the Asset Override Editor is something what i was looking for

      Comment


        #4
        I have another similar question:
        My player and NPC's have different attack animation (around 10). Every character has it's own availableAttackAnimations array. In attack function, i pick a random animation sequence from that array and send it through Event Dispatcher to Animation Blueprint. I have a "Selected Attack Animation" state which plays this animation, here is how it looks inside:

        Click image for larger version

Name:	diffAnimEveryTime.jpg
Views:	1
Size:	99.6 KB
ID:	1080965

        I had to drag in one of the animation sequences and expose it's pin to hook up this random-selected AnimationSequence variable. It works, but the problem is, in transition rule (from "Selected Attack Animation" state to "Idle" state) i have "if remaining time (ratio) of attack animation <= 0.1" (saw this in documentation, but maybe there is a better solution) - but it gets this remaining ratio based on original animation sequence that i've dragged in, not on the random-selected one - which causes problems, because attack animations have different lengths.
        Is there some better way to transfer random-selected animation from character's BP to his Animation BP? Probably the problem would be solved if "Final Animation Pose" node would accept Animation Sequence variable as an input, I don't know why it does not allow to do that...

        Comment


          #5
          Hi Slavq,

          There have been some improvements made to transition rules to make them more robust/flexible, which will be in 4.9: https://forums.unrealengine.com/show...view-6-29-2015

          The reason the output node can't take an animation sequence is because they're totally unrelated things. The animation asset is a thing that contains many frames of animation, while the white lines in the animation graph are an instantaneous pose. A sequence player keeps track of time/advances it/etc..., and samples an animation to produce a pose.

          Cheers,
          Michael Noland

          Comment


            #6
            That's great, so i'll wait for 4.9, these new getter nodes should do the job
            Thanks for clearing these things up!

            Comment


              #7
              Slavq, you can bypass this problem by manually setting float values used in the transition rule. So you have to calculate using Animation.CurrentTime and AnimationLength (which you set manually). It's a bit of a hassle, but it works until the fixes are out.
              www.dennylindberg.com - My RnD / WIP thread
              Mortal Online 2 - Kitten'd - Guardians of Valor (Android, iOS)

              Comment


                #8
                Originally posted by Denny View Post
                Slavq, you can bypass this problem by manually setting float values used in the transition rule. So you have to calculate using Animation.CurrentTime and AnimationLength (which you set manually). It's a bit of a hassle, but it works until the fixes are out.
                Good idea, thanks! This workaround should handle it, until 4.9 will come

                Comment


                  #9
                  Hey, guys, I'm having trouble creating animation sequence with a working character player bp that properly blends back into gameplay mode. how would i work my way around something like this?

                  Comment


                    #10
                    Originally posted by Kirsten_G View Post
                    Hey, guys, I'm having trouble creating animation sequence with a working character player bp that properly blends back into gameplay mode. how would i work my way around something like this?
                    I'd like to help, but I'm out of loop when it comes to the current animation toolset, as far as I know, it has changed quite a bit. Last time I used animation tools like that was in 2015. Maybe someone else can help with that

                    Comment

                    Working...
                    X