Announcement

Collapse
No announcement yet.

C++ Melee Combat (Couch Knights style?)

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

    C++ Melee Combat (Couch Knights style?)

    Hi there,

    Ive been trying to design melee combat for my game and have hit a huge bottleneck when it comes to actual melee animations (one handed weapons such as swords). With the advent of 4.5 and animation retargeting, i thought using the swings from couch knights would be ideal!

    I took a look at the project and found that the melee was actually very satisfying and want to replicate it. My game is mainly built on cpp with very little blueprint on top. I can think of a few methods of making a melee combo system - but i would love to know how to replicate Couch Knights. My problem comes in extracting meaning from their blueprints (i dont really understand blueprint flow as i am not experienced with them as i am cpp) my original thought being that perhaps the moving forward occurred as root motion on the animation, but it does not seem to be the case.

    I suppose my main questions are:

    1. Best method of moving a character forward per swing of the weapon? (Couch knights feels very good in this regard) is there more to it than adding velocity to the character capsule?

    2. Best method of comboing animations? (One swing leads into another etc, again, like couch knights). I understand aanim montages may be the way to go, but any resources (better yet, in cpp!) would be greatly appreciated.

    Thanks a lot, any and all help would be very appreciated!

    #2
    2. There is a UE4 tutorial video about making a 3rd person punching motion, including different punches, and so on. Take a look at it, its very detailed =)

    Good luck mate, I'll be working on something similar in some time.
    [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

    Looking for fellow programmers to develop a project.

    Comment


      #3
      Sounds great. Do you happen to have a link?

      It's a little frustrating how all of Couch Knights is in blueprints, haha. I'd have gotten to grips with it quicker if it were C++. The solution might be to study it for several hours, but it seems like a bit of an unintuitive web - I was kinda hoping somebody had done something similar in borrowing from the Couch Knights example.

      Thanks a lot for the suggestion, I will have a look

      Comment


        #4
        Sorry mate but I don't really have it.. I know its in the 3rd person BP tutorials and has to do with root motion, its probably the title.

        As for couch knights, yeah same here, I hate BPs, they are so unorganized its hideous, I'm always looking for C++ versions of this and never find 'em. Anyway, what they do is basically check if the sword collision component hits something when its swinging, if it does, get the actor = damage, get the shield = block.
        [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

        Looking for fellow programmers to develop a project.

        Comment


          #5
          Yeah - I've actually done the damaging part of the equation (I've got a collider that overlaps and then calls a damage function I've written on the character) so that's good. My problem is I'm relying on a terrible placeholder animation and it feels bad, so I'm trying to work out montages leading into further attacks in a combo and moving the character (probably with root motion, but again, Couch Knights doesn't seem to do this and that feels great)

          Thanks for the tips though, I will search for it!

          Comment


            #6
            There is a RPG kit somewhere on the forums, someone replied with some animations and a dummy sword, use them.
            Out of curiosity, are you using per-bone accuracy or just overall mesh hitting?
            [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

            Looking for fellow programmers to develop a project.

            Comment


              #7
              Maybe this helps https://docs.unrealengine.com/latest...age/index.html

              Comment


                #8
                A combination of C++ Logic and AnimMontages are the best, i did basic melee functionality for my ( on hold ) RPG Framework using just C++ and a Single Anim Montage that holds sections for my left to middle of screen swing and right to middle of screen swing



                As long you handle your combos VERY close to the end of the animation ( So you get smoother blending ) its very straight forward
                Offering my Freelance Game Design ,Counselling and C++ Programming Skills!
                https://forums.unrealengine.com/show...ner-Counseling

                Marketplace Assets
                Melee Tracing Plugin:https://forums.unrealengine.com/show...Tracing-Plugin
                Medieval Combat Starter Kit:https://forums.unrealengine.com/show...at-Starter-Kit
                Foliage To Blueprint:https://www.unrealengine.com/marketp...e-to-blueprint

                Comment


                  #9
                  @alvarofer0020- Where did you get the sword and armor/mesh?

                  I'd go with collision, not with tracing, tracing will be terribly expensive on a large scale, and well, the accuracy can't match a collision box's
                  Last edited by Horus; 10-26-2014, 09:35 AM.
                  [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

                  Looking for fellow programmers to develop a project.

                  Comment


                    #10
                    Meshes are from dead crusade, on hold game And on my experience i had in fact worst results with collision instead of tracing, i optimized my method as best as i could so i can have a large number of traces with no impact on memory
                    Offering my Freelance Game Design ,Counselling and C++ Programming Skills!
                    https://forums.unrealengine.com/show...ner-Counseling

                    Marketplace Assets
                    Melee Tracing Plugin:https://forums.unrealengine.com/show...Tracing-Plugin
                    Medieval Combat Starter Kit:https://forums.unrealengine.com/show...at-Starter-Kit
                    Foliage To Blueprint:https://www.unrealengine.com/marketp...e-to-blueprint

                    Comment


                      #11
                      When did you make such tests? Was it recently? Perhaps you are right, to be honest I haven't tested it, but I think they made several improvements in that field.
                      Out of curiosity, mind giving a overall idea on how your method works?

                      PS- Dead crusade is yours?
                      [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

                      Looking for fellow programmers to develop a project.

                      Comment


                        #12
                        I did the test in UE4 4.3 , Not too long ago could be worse or better now in the latest engine iteration,

                        The overall idea of the tracing method is to have just 2 sockets on the weapon ( start, end ) use simple math to make up the locations for the rest of the traces along the weapon and use VLerp between the last frame trace location and the current frame trace location , So far its worked pretty well and i really havent seen or noticed any relevant perfomance hits

                        And no, Dead crusade belongs to Aesthetic Games
                        Offering my Freelance Game Design ,Counselling and C++ Programming Skills!
                        https://forums.unrealengine.com/show...ner-Counseling

                        Marketplace Assets
                        Melee Tracing Plugin:https://forums.unrealengine.com/show...Tracing-Plugin
                        Medieval Combat Starter Kit:https://forums.unrealengine.com/show...at-Starter-Kit
                        Foliage To Blueprint:https://www.unrealengine.com/marketp...e-to-blueprint

                        Comment


                          #13
                          I am not familiar with Lerping, will take a look at it, thanks for the tip!

                          Asked about Dead Crusade exactly because of that, as I'm not grasping how you could have access to their meshes =) but thanks for the tip
                          [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

                          Looking for fellow programmers to develop a project.

                          Comment


                            #14
                            I've managed to get a montage to work fairly well - it just chains attacks quite simply. The problem I'm having is designing a decent solution for moving the character forward when attacking: is root motion best, or another method? As stated earlier, Couch Knights doesn't appear to use root motion and that works quite nicely. I don't think the "LaunchCharacter" function on character is ideal, as it gets interrupted by friction.

                            Any ideas?

                            Comment


                              #15
                              As this is far from my field of expertise, I can only offer the following: Root motion has been broken till recently (ref. the Advanced Anim Pack thread in the marketplace forum). This might be the reason why couch knights aren't using these, in stead of the reason being any tangible pros or cons one way or the other.
                              My knowledge on the matter stops with this little bit of information though.

                              Still, I am making a similar system, so an answer to both of OPs questions would be appreciated, here as well.
                              To summarize these questions:
                              1) What is the least costly (and by what degree) way of doing the (hit)physics of a sword swing: Trace(s) or collision?
                              2) Root motion; to use, or not to use? I am going to delve into animations soon enough, and I would love some pros and cons. Realism > performance on this one (within the limits of reason, of course).
                              This is actually a very important question these days (to me, at least), as it might be the deciding factor when deciding to go for the incredible movement set, just released in the marketplace, or not
                              Last edited by oasf; 10-27-2014, 08:28 AM.

                              Comment

                              Working...
                              X