Announcement

Collapse
No announcement yet.

Distance Matching Locomotion : Giving it a shot !

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

    postman09 Thanks for the idea! Thankfully, our current curves have a lot of data points, so the errors don't seem highly noticeable. (But I'm not exactly sure what the errors would manifest as.) That said, the method you suggested will be added to the to-do list.

    My current progress with distance matching is shown in the below video. The start transitions aren't terrible. But, as you'll see, the stop transitions are non-existent. The red/blue debug sphere show predicted stop location, but the error increases as character speed increases.
    (Sorry if the video is loud. I'm still using the ALSv4 test level.)

    Comment


      Originally posted by Muoio117 View Post
      postman09 Thanks for the idea! Thankfully, our current curves have a lot of data points, so the errors don't seem highly noticeable. (But I'm not exactly sure what the errors would manifest as.) That said, the method you suggested will be added to the to-do list.

      My current progress with distance matching is shown in the below video. The start transitions aren't terrible. But, as you'll see, the stop transitions are non-existent. The red/blue debug sphere show predicted stop location, but the error increases as character speed increases.
      (Sorry if the video is loud. I'm still using the ALSv4 test level.)
      The errors might not be too noticeable depending on the animation. All they would do is cause more foot sliding.

      Comment


        Hello everyone, I have a question after watching the Distance Matching video. When I switched from run to stop animation, I found the timestamp on the curve of the stop animation based on the distance to marker; however, my current pose did not match the pose of the stop animation that I found from the curve. To be more extreme, my left foot is in front during the transition period, but the stop animation frame found is right foot in front. How should I handle the transition between run and stop?

        Comment


          Originally posted by 小鱼人袁华 View Post
          Hello everyone, I have a question after watching the Distance Matching video. When I switched from run to stop animation, I found the timestamp on the curve of the stop animation based on the distance to marker; however, my current pose did not match the pose of the stop animation that I found from the curve. To be more extreme, my left foot is in front during the transition period, but the stop animation frame found is right foot in front. How should I handle the transition between run and stop?
          sounds like your distance calculation is wrong, or your curve is wrong, or your getting the wrong value for the curve. screen shots and videos help if you still need help.

          Comment


            Originally posted by postman09 View Post

            Thats not bad but if there arn't alot of data points in the curve it won't be that accurate since you are just lerping. The actual code for interpolation between points is much more sophisticated and takes into account tangents and what not, and still works with few data points.

            What I did was just rite a quick animation modifier to swap the time and distance axis and save it as another curve so I could use the normal get float curve value function. That way I can use Epics black magic and not have to worry about the curve value being accurate.
            How do you retrieve curve value by time? Get Curve Value - returns only value for current time. You still need to use FAnimCurveBufferAccess and power of C++ to extract value by time. Of course you can use Float Curve, but AnimModifiers can't create objects of this type.

            Comment


              Originally posted by rmerkushin View Post

              How do you retrieve curve value by time? Get Curve Value - returns only value for current time. You still need to use FAnimCurveBufferAccess and power of C++ to extract value by time. Of course you can use Float Curve, but AnimModifiers can't create objects of this type.
              Anim modifiers can create float or vector curves inside animations. Create one to swap the x and y axis of the distance curve. Then get curve value will will give u time at certain distance.

              you do need to make your own c++ func to get the value of the curve of a certain animation though.
              Last edited by postman09; 01-18-2021, 03:16 PM.

              Comment


                Originally posted by postman09 View Post

                Anim modifiers can create float or vector curves inside animations. Create one to swap the x and y axis of the distance curve. Then get curve value will will give u time at certain distance.

                you do need to make your own c++ func to get the value of the curve of a certain animation though.
                Yep, I know how AnimModifiers works. But you still need to use animations compressed with Uniform Indexable, because after build you can't access this curves without FAnimCurveBufferAccess and you should search two nearest values on curve and apply interpolation (or any kind of magics) to find desired value between them. It makes no sense to swap time and distance on curve, because you need to do the same in both cases to retrieve time or value. FAnimCurveBufferAccess give you a limited number of points on curve and you should use interpolation to find desired value. I know my solution is not the best, but it's just example how to access to curve times and values. I want to adapt code from FRichCurve::Eval to this purpose.

                Comment


                  Originally posted by MaximeDupart View Post
                  Oh i'm open to talk about what i've done and how to set it up on your own. As far as code sharing not so much, still spent a couple serious hours on this.
                  Yet, Epic might distribute their own solution as mentionned a couple times on stream anyway.

                  I think the hardest part is to solve the first order derivative equation of the characterMovement component, to predict where the pawn will stop/Pivot.
                  Highschool math right there, otherwise it's rather straight forward:
                  1. Compute Distance to point
                  2. Search the animation file' distance curve for proper time to be at
                  3. Play the animation on single frame mode and provide the time you found as input
                  4. Repeat
                  Have you changed your mind about sharing the project files? Would be a great learning resource.

                  Comment


                    Hey guys! I've been trying to implement my own DistanceMatching with Paragon assets, but I'm having issues.

                    Once the character stop accelerating I calculate the distance between the character and the stop point. In the image it's -106.
                    So having that, do I have to play the animation from the frame which matches the number (-106)? If that's true, how can I do that? I'm little confused. Thanks in advance guys.

                    Click image for larger version

Name:	ss.jpg
Views:	140
Size:	94.6 KB
ID:	1858095
                    Click image for larger version

Name:	curve.jpg
Views:	129
Size:	250.5 KB
ID:	1858096

                    Comment


                      Originally posted by MaximeDupart View Post
                      Oh i'm open to talk about what i've done and how to set it up on your own. As far as code sharing not so much, still spent a couple serious hours on this.
                      Yet, Epic might distribute their own solution as mentionned a couple times on stream anyway.

                      I think the hardest part is to solve the first order derivative equation of the characterMovement component, to predict where the pawn will stop/Pivot.
                      Highschool math right there, otherwise it's rather straight forward:
                      1. Compute Distance to point
                      2. Search the animation file' distance curve for proper time to be at
                      3. Play the animation on single frame mode and provide the time you found as input
                      4. Repeat
                      I've got the distance to the point when the player has stop accelerating but, how can I play the stop animation now? I guess my distance is a value from the distance curve and then I have to play the animation from that value. How do I convert that value in the start position of the specific animation?

                      Comment


                        Originally posted by Atagualpha View Post

                        I've got the distance to the point when the player has stop accelerating but, how can I play the stop animation now? I guess my distance is a value from the distance curve and then I have to play the animation from that value. How do I convert that value in the start position of the specific animation?
                        You should calculate the distance every tick and get the time by this value from distance curve in animation.

                        Click image for larger version

Name:	stop.png
Views:	123
Size:	345.1 KB
ID:	1858446

                        Comment


                          Originally posted by rmerkushin View Post

                          You should calculate the distance every tick and get the time by this value from distance curve in animation.

                          Click image for larger version

Name:	stop.png
Views:	123
Size:	345.1 KB
ID:	1858446

                          I got the idea but, how can I do that? I mean in C++ or blueprint just for prototype

                          Comment


                            Originally posted by Atagualpha View Post


                            I got the idea but, how can I do that? I mean in C++ or blueprint just for prototype
                            https://forums.unrealengine.com/deve...94#post1821294

                            Not the best solution but it's working

                            Comment


                              Just curious, did you guys make your physics calculations in a custom CMC and pulled the data from there in the anim graph or in a custom anim instance?

                              Comment


                                Originally posted by Slavical View Post
                                Just curious, did you guys make your physics calculations in a custom CMC and pulled the data from there in the anim graph or in a custom anim instance?
                                i used the default cmc and litteraly copied the calcvelocity function to use 4 prediction

                                Comment

                                Working...
                                X