Announcement

Collapse
No announcement yet.

Distance Matching Locomotion : Giving it a shot !

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

    Originally posted by Muoio117 View Post
    postman09 Oh! You're Patrick. I was commenting on your video yesterday. Your progress from six weeks back looks good, even for not being complete. I notice a bit of foot sliding at the start and stop. I'm currently having the same issue with start transitions. (I haven't developed my own usable solution for stop transitions yet.). I'm certainly curious to see the current state of things on your end, but I bet you're striving to get things perfect before the "reveal."

    EDIT: Here is my newb attempt at predicting stop location. Obviously, the stop animations aren't working properly.
    Yup that's me lol.

    There is a slight amount of foot sliding in mine I can't get rid of using the prediction, even though its near perfect. There are a lot of things going on like turning animation warping off near the end, blends, accuracy of the curve that effect it. It's way worse for faster animations so in mine its a bit noticeable if you look at the video's since Aurora has a fast base move speed. I'm going to try and implement IK foot locking like Longmire did and add it to my IK solution. With that hopefully perfection can be reached.

    Your foot slide issues are either arising from your stop anim not completely transitioning to idle within the stop anim, or you are blending into idle too soon. Might be able to solve it with IK foot locking. But like I said above I haven't tried myself yet.

    Also are you using kubolds pack? It kinda looks like it from the video.

    Comment


      Originally posted by postman09 View Post

      Yup that's me lol.

      There is a slight amount of foot sliding in mine I can't get rid of using the prediction, even though its near perfect. There are a lot of things going on like turning animation warping off near the end, blends, accuracy of the curve that effect it. It's way worse for faster animations so in mine its a bit noticeable if you look at the video's since Aurora has a fast base move speed. I'm going to try and implement IK foot locking like Longmire did and add it to my IK solution. With that hopefully perfection can be reached.

      Your foot slide issues are either arising from your stop anim not completely transitioning to idle within the stop anim, or you are blending into idle too soon. Might be able to solve it with IK foot locking. But like I said above I haven't tried myself yet.

      Also are you using kubolds pack? It kinda looks like it from the video.
      I haven't the slightest idea yet of how to take into account all the things you've mentioned. The only small things I've tried are:
      1. blending N,E,S,W start animations using an alpha based on a ratio between a primary and secondary cardinal angle;
      2. creating a WarpAlpha curve that controls whether warping is on or off depending on foot placement (for start and stop anims).
      I've been working solely with walking animations for a while, so the base speed fluctuates between 163 and 178, according to the speed curve I extracted from the animation using the Root Motion Extractor. My base speed is much lower than what you're currently working with, and I still have issues. I've considered applying foot-locking, but I think there are things I need to fix first. I'm stuck though, which is extremely frustrating. My game dev hobbyist squad needs characters who can walk. Haha.

      Yup, I'm using Kubold animations. I mirrored some animations in Blender, since the Kubold pack didn't come with everything I want. (And I also constrained the freakin' ik_handgun bones.) The really annoying part is that Kubold didn't include start and stop animations for left and right running. I'm not an animator, so I don't know how I'm going to remedy my situation. (That is partly the reason I'm working with walking anims first, since WalkStartLeft and WalkStartRight are included.) Also, Kubold animations are kind of glitchy, which is unfortunate.

      If I knew of other animations that were better, I would try those.
      Last edited by Muoio117; 09-20-2020, 08:51 PM.

      Comment


        Originally posted by Muoio117 View Post

        I haven't the slightest idea yet of how to take into account all the things you've mentioned. The only small things I've tried are:
        1. blending N,E,S,W start animations using an alpha based on a ratio between a primary and secondary cardinal angle;
        2. creating a WarpAlpha curve that controls whether warping is on or off depending on foot placement (for start and stop anims).
        I've been working solely with walking animations for a while, so the base speed fluctuates between 163 and 178, according to the speed curve I extracted from the animation using the Root Motion Extractor. My base speed is much lower than what you're currently working with, and I still have issues. I've considered applying foot-locking, but I think there are things I need to fix first. I'm stuck though, which is extremely frustrating. My game dev hobbyist squad needs characters who can walk. Haha.

        Yup, I'm using Kubold animations. I mirrored some animations in Blender, since the Kubold pack didn't come with everything I want. (And I also constrained the freakin' ik_handgun bones.) The really annoying part is that Kubold didn't include start and stop animations for left and right running. I'm not an animator, so I don't know how I'm going to remedy my situation. (That is partly the reason I'm working with walking anims first, since WalkStartLeft and WalkStartRight are included.) Also, Kubold animations are kind of glitchy, which is unfortunate.

        If I knew of other animations that were better, I would try those.
        I have a video on my youtube of some basic animation and orientation warping of the kubold pack because someone wanted to see. It doesn't look good at all and I wouldn't recommend using them (the basic locomotion anyway).

        Use these instead: https://www.unrealengine.com/marketp...ity-mocap-pack

        They are the best on the marketplace, and they come with all the curve data pre baked like how the paragon anims are, which is nice. There is also a starter version for like $6 and a basic for $50.
        I'm thinking of using these for my own game prototype until I can afford my own Mocap **** lol. (didn't know there was profanity filter?)

        I also thought about somehow using the ALSV4 animations but creating curves manually will be fiddly and time consuming at best since he doesn't have any root motion to reference from.

        Comment


          Originally posted by postman09 View Post

          I have a video on my youtube of some basic animation and orientation warping of the kubold pack because someone wanted to see. It doesn't look good at all and I wouldn't recommend using them (the basic locomotion anyway).

          Use these instead: https://www.unrealengine.com/marketp...ity-mocap-pack

          They are the best on the marketplace, and they come with all the curve data pre baked like how the paragon anims are, which is nice. There is also a starter version for like $6 and a basic for $50.
          I'm thinking of using these for my own game prototype until I can afford my own Mocap **** lol. (didn't know there was profanity filter?)

          I also thought about somehow using the ALSV4 animations but creating curves manually will be fiddly and time consuming at best since he doesn't have any root motion to reference from.
          I saw that, actually. I've been checking out everything from everyone who is making warping and distance matching stuff. Haha. But, yeah, the Kubold animations didn't look good. In fact, they looked just as crappy with your setup as with mine, which doesn't give me much hope with regard to the anims. I thought I was just doing something stupid in my own setup (which is still possible), but to see the same look in yours leads me to believe much of the ugliness is from the anims themselves.

          Wow! Those MoCap Online animations look great! Dang... I wish I had purchased those instead. Though the small packs are tempting, I'd prefer to save up and purchase the big Mobility Pro pack for $100. I noticed turn-in-place in eight directions. I think there are also start/stop anims in eight directions, if I'm not mistaken. The Ninja Pro pack looks impressive and useful too.

          I also considered adding curves manually to ALSv4 animations, since those animations are freakin' great too, but I came to the same conclusion as you: the consumption of time may not be worth the effort. It's possible I'll change my mind, but ALSv4 doesn't have stop/start anims, which are anims I need.
          Last edited by Muoio117; 09-21-2020, 04:04 PM.

          Comment


            The new amplify animation pack looks promising. Root motion anims which means distance match compatible. Going to have to try it out. I might post a video if it looks decent.

            https://www.unrealengine.com/marketp...animation-pack

            Comment


              postman09 The variety looks great in that pack! The first thing I notice that I don't like is the lack of strafing animations. I didn't see any sort of right/left strafing. I'm not sure how big of a deal that is.

              The GREAT thing is the variety. The blender source files are included, which is cool.

              I look forward to seeing a video with the pack implemented with your plugin. I probably won't be buying anything soon, since I'm making sure I can purchase your plugin when it's released.

              Comment


                Originally posted by Muoio117 View Post
                postman09 The variety looks great in that pack! The first thing I notice that I don't like is the lack of strafing animations. I didn't see any sort of right/left strafing. I'm not sure how big of a deal that is.

                The GREAT thing is the variety. The blender source files are included, which is cool.

                I look forward to seeing a video with the pack implemented with your plugin. I probably won't be buying anything soon, since I'm making sure I can purchase your plugin when it's released.
                I just got home and tried his packaged demo. The anims are not really that good so I'm not going to bother trying to implement with them. There is some weird jitter with the sprint.

                Comment


                  Originally posted by postman09 View Post

                  I just got home and tried his packaged demo. The anims are not really that good so I'm not going to bother trying to implement with them. There is some weird jitter with the sprint.
                  That's unfortunate. It's difficult to find good anims. It looks like MoCap Online is still the best route to go.

                  EDIT: Also, I rewatched the video and found strafing animations. I'm not sure how I missed those in my first viewing. But walk strafing is missing, though run strafing is present.
                  Last edited by Muoio117; 09-29-2020, 11:02 PM.

                  Comment


                    Hi guys! I planned to share my solution, but I have no time to complete it, so I'm here to share a part of my solution. Many people ask me how I get time by distance from curve. Code below is not perfect, but I'm not a C++ programmer This code works only if you compress curve with "Uniform Indexable" compression type!

                    Code:
                    #include"Animation/AnimInstanceBase.h"
                    #include"Animation/AnimCurveCompressionCodec_UniformIndexable.h"
                    
                    DEFINE_LOG_CATEGORY(LogAnimInstanceBase)
                    
                    floatUAnimInstanceBase::GetCurveTime(constUAnimSequence*AnimationSequence, constFNameCurveName, constfloatCurveValue)
                    {
                    if (AnimationSequence ==nullptr)
                        {
                    UE_LOG(LogAnimInstanceBase, Error, TEXT("Invalid Animation Sequence ptr"));
                    return0.0f;
                        }
                    
                        // Get curve SmartName
                        FSmartName CurveSmartName;
                    AnimationSequence->GetSkeleton()->GetSmartNameByName(USkeleton::AnimCurveMappingName, CurveName, CurveSmartName);
                    
                        // Create a buffered access to times and values in curve
                    const FAnimCurveBufferAccess CurveBuffer =FAnimCurveBufferAccess(AnimationSequence, CurveSmartName.UID);
                    
                        // The number of elements in curve
                    constint NumSamples = static_cast<int>(CurveBuffer.GetNumSamples());
                    constint LastIndex = NumSamples -1;
                    
                    if (NumSamples <2)
                        {
                    return0.0f;
                        }
                    
                        // Corner cases
                    if (CurveValue <=CurveBuffer.GetValue(0))
                        {
                    returnCurveBuffer.GetTime(0);
                        }
                    if (CurveValue >=CurveBuffer.GetValue(LastIndex))
                        {
                    returnCurveBuffer.GetTime(LastIndex);
                        }
                    
                        // Binary search
                        int32 NextIndex =1;
                        int32 Count = LastIndex - NextIndex;
                    while (Count >0)
                        {
                    const int32 Step = Count /2;
                    const int32 Middle = NextIndex + Step;
                    
                    if (CurveValue >CurveBuffer.GetValue(Middle))
                            {
                                NextIndex = Middle +1;
                                Count -= Step +1;
                            }
                    else
                            {
                                Count = Step;
                            }
                        }
                    
                    const int32 PrevIndex = NextIndex -1;
                    constfloat PrevCurveValue =CurveBuffer.GetValue(PrevIndex);
                    constfloat NextCurveValue =CurveBuffer.GetValue(NextIndex);
                    constfloat PrevCurveTime =CurveBuffer.GetTime(PrevIndex);
                    constfloat NextCurveTime =CurveBuffer.GetTime(NextIndex);
                    
                        // Find time by two nearest known points on the curve
                    constfloat Diff = NextCurveValue - PrevCurveValue;
                    constfloat Alpha =!FMath::IsNearlyZero(Diff) ? (CurveValue - PrevCurveValue) / Diff :0.0f;
                    return FMath::Lerp(PrevCurveTime, NextCurveTime, Alpha);
                    }
                    P.S.: If you know how to improve code or found a bug, please let me know.
                    P.P.S: same in gist https://gist.github.com/rmerkushin/b...e1a8ea651c33dd

                    Comment


                      Thanks for sharing!

                      Comment


                        I tried implementing rmerkushin's code as a plugin, which I did successfully. And I added the "Uniform Indexable" compression type to my animation curves.

                        Click image for larger version  Name:	PluginPic.PNG Views:	0 Size:	48.3 KB ID:	1822977

                        But whenever I Play, my editor crashes as soon I try to move at all. I can look around, but when I add movement input, the editor crashes.

                        EDIT: The below pic is the error I get.
                        Click image for larger version

Name:	error.png
Views:	37
Size:	39.5 KB
ID:	1822978

                        Does anyone have any suggestions for how to fix the issue? I know almost nothing about c++.
                        Last edited by Muoio117; 10-16-2020, 11:21 PM.

                        Comment


                          Try to use this header file with my previous code:

                          Code:
                          #pragmaonce
                          
                          #include"CoreMinimal.h"
                          #include"Animation/AnimInstance.h"
                          #include"AnimInstanceBase.generated.h"
                          
                          DECLARE_LOG_CATEGORY_EXTERN(LogAnimInstanceBase, Verbose, All)
                          
                          UCLASS(Abstract)
                          classPROTOTYPE_API UAnimInstanceBase : publicUAnimInstance
                          {
                          GENERATED_BODY()
                          
                          public:
                            /**
                            * Returns the time of a named curve for corresponding value
                            *
                            * Animation curve should be compressed with Uniform Indexable!
                            *
                            * @paramAnimationSequence
                            * @paramCurveName          Named curve
                            * @paramCurveValue         Curve value for search the corresponding time
                            */
                          UFUNCTION(BlueprintPure, Category="Animation")
                          staticfloatGetCurveTime(constclassUAnimSequence*AnimationSequence, FNameCurveName, floatCurveValue);
                          };
                          Just create custom AnimInstance C++ class and inherit your BP AnimInstance from it and make sure you apply Uniform Indexable curve compression to your animations. Sometimes you need to reapply compression to animation curves, i don't know why, but compression resets to default when I get my project from Git (when I copy my project to different folder or different PC)
                          Last edited by rmerkushin; 10-17-2020, 05:36 AM.

                          Comment


                            Thanks for the feedback! I'll try to implement that as suggested.

                            And I'll also check on the curve compression, since I did move something things around. I may need to reapply the compression curves.

                            Comment

                            Working...
                            X