Search Unity

Duel Wielding ;o

Discussion in 'Animation' started by joshcamas, May 19, 2018.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    Hello friends :)

    I am working on a game with duel wielding, with several different combinations of weapon/animation types (long sword, dagger, axe, misc magic, etc). My current setup is simply having a layer per hand, and masking it to only effect the arms. This works perfectly for first person!!

    But for third person / npcs... this is not so simple. Having an axe swing only effect the arm is incredibly funny to see, and not at all realistic, since swinging an axe means a lot of weight distribution and body movement.

    This of course would be pretty easy to handle if the player could only hold one weapon at once... but this is not the case.

    One solution could be to make animations for each possible duel wield outcome - 2 short swords, 1 short sword, 1 short sword 1 dagger, 2 daggers, 1 dagger, etc etc. However this adds up very very quickly, especially due to all of the magic animations...

    Another solution could be to somehow... mix these animations... somehow. I'm not sure how one could do this.

    And finally, another (sad and not optimal solution) would be to just dump the duel wielding system. Perhaps it's too complex, and I should stick to a simpler system.

    Any thoughts? Am I missing something?

    Thanks!
    Josh
     
  2. Goatogrammetry

    Goatogrammetry

    Joined:
    Apr 27, 2017
    Posts:
    197
    Well is the problem that they can activate each weapon at any time, or can they just use them in combos? I think most games avoid letting people use each arm individually due to the exponential animation complications you're beginning to discover. Even the difficulty of having a spear/sword/shield/dagger/xbow that could be in either hand, and the many combinations make it pretty crazy. I'd say at best you could try some additive layers and see if you could get away with it. I've never used animation overrides myself, but you'll probably need to use that too, or end up with a super complicated animation controller.

    Frankly, dual wield is about 8x as difficult to animate, not just 2x, even if you're only allowing the extra weapon as an extra combo to the main weapon. Perhaps if someday we have AI to help with animations in a real-time way, it'd be no big deal. Until then.... if you're going to use dual wield, plan on budgeting a lot more for animations.
     
    SolarFalcon and joshcamas like this.
  3. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    Thank you, that's what I've been thinking. On a related note, do you happen to know how Skyrim does it? I've been trying to remember if they allowed attacking any hand at any time in 3rd person...
     
  4. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    So in your game, the player has the ability to control, either the
    left hand, or right hand of the character?
     
    joshcamas likes this.
  5. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    Correct, that is the current setup. And it can be in either third or first person.
     
  6. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Okay. Now I understand, why you're getting confused, on how to
    accomplish this.

    PS: But personally, a game like that, where you can control two weapons
    in each hand, might be better with 2 motion controllers in each hand.
    Which might be tough to code though. :p
     
    Last edited: May 25, 2018
  7. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    I don't know what 2 motion controls in each hand means xD
     
  8. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Just a thought -
    If this was my problem to solve I'd attempt to create a additive system where the motion of the torso was added to the base swing animation, was dictated based on the type of weapon/weight the character was using/swinging, per hand. This could be done through a blend tree weighted so when the character swings a hammer the torso would bend more extreme compared to when the character is swinging a dagger.
    The blend tree would probably be a mixture of 4 leaning/twisting torso motions. left, right, forward left, and forward right - representing the torso motions when the character would swing the weapon.
    Having a duel wielding character will always result in 'extra' animations, though if you are alright with mirrored animations, as opposed to accurate left hand back hand swings, the mirror function could be used to limit the amount of extra animations needed. But each weapon in each hand will always result in a new animation need, or a mirrored animation, the blending/weighted concept could help with blending the torso motion, to allow for a zero to extreme motion to be weighed based on the weapon used per hand.

    Sorry if this concept is vague - as a concept it seems doable, it is up to the creator to implement it in engine. :cool:;)

    PS - Skyrim did allow duel wielding in 3rd person view. I think they used natural motion for the animation/rig setup. Final IK could be used as a solution for this problem.
     
    joshcamas likes this.
  9. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,278
    Sounds very complicated :')

    I have decided to rip out my duel wielding system, and instead allow for 1 weapon, and only certain items allowing for a weapon and shield. So instead of two weapon layers, only one. (And separate animations for the shield and weapon combo)
     
    theANMATOR2b likes this.