Announcement

Collapse
No announcement yet.

How do you implement a DodgeRoll like Dark souls?

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

    How do you implement a DodgeRoll like Dark souls?

    Hello everyone. Im trying to figure out how to implement a DodgeRoll like Dark souls or gears of war ones.

    I can't really find any tutorial, tho i found a thread on the forum with someone posting some screenshots.

    I tried to make them work but now i'm just stuck with the character Moving relative to the direction of the camera.

    All i want is decide the dodge direction with inputs, if im pressing D and then Dodge it should move on the right and so on.

    I'm really a newbie so hope someone can help me, thanks!
    Attached Files
    Last edited by Cold as Me; 04-05-2017, 09:39 AM.

    #2
    Try getting the forward vector of the actual character, not the mesh. Also, you might want to disable movement, while you roll, and then re-enable it after it's over (just movement as in forward/backward or strafing).

    Click image for larger version

Name:	rollhelp.jpg
Views:	1
Size:	37.3 KB
ID:	1126014

    Comment


      #3
      This isn't quite an entry level topic, but to break it down for you, you would start but getting the direction of your stick input. Dark souls always rolls the direction you are pulling the left stick, that's why you can still roll in any direction even when locked onto an enemy.

      Dark souls then does some math to determine the distance you can roll based on your weight limit and equipped weight.

      You define the end location of your roll based on this math and the left stick vector. Trigger a roll animation (this would look like the player is rolling on the spot if you saw it say in Maya). Then interpolate to the calculated location over a set time, say .5 seconds. Roll speed could be calculated or adjusted by stats too if you like.

      You would trigger a bool at calculated times for dodge invincibility so tell the game if the player can be hit. This would also take certain stats into account like Dexterity or equip weight.

      You would have to implement a 'stop rolling' function than cancels the roll lerp if you get hit outside of the invincible dodge period.

      So this is a general outline of how it works in Dark Souls, I've simplified it a bit but should be enough to get a decent roll system up and running.

      Comment


        #4
        i think i would use a root motion for that,make like 8 directions of a roll,it's good as it's minimal coding and let's the animation handle the movement so it can be timed correctly,for invincibility frames if you wish you could do anim notifications

        Comment


          #5
          Originally posted by Velocityx View Post
          i think i would use a root motion for that,make like 8 directions of a roll,it's good as it's minimal coding and let's the animation handle the movement so it can be timed correctly,for invincibility frames if you wish you could do anim notifications
          A root motion roll is not really the way Dark Souls does their rolls and the OP wants a DS style roll.

          Comment


            #6
            Howdy

            So this is what I came up with;

            https://gfycat.com/CarefulHairyAruanas

            It uses 4 root motion animations, Roll Foward, Backward, Left and Right

            https://gfycat.com/FrenchWeightyIbizanhound

            And this bit of code to determine which to play, depending on the characters direction and your movement input

            Click image for larger version

Name:	7b89b16cc83f2b7e9d5c480163754b3e.png
Views:	1
Size:	389.9 KB
ID:	1126117

            Comment


              #7
              Whoa! Thanks everyone for the advices and everything, tomorrow i will be finally home to try it out!

              I'll let you know and thanks again!

              Comment


                #8
                Hey try this one:
                With this u can roll/dodge when moving like Dark Souls:

                Comment

                Working...
                X