Announcement

Collapse
No announcement yet.

Inverse Kinematics (freeIK) [beta 2]

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

    Inverse Kinematics (freeIK) [beta 2]

    Name: freeIK (Inverse Kinematics system for UT2004)

    Version: Beta two.zero
    Compatibility: UT2k4 + latest patch (3369)
    Description:
    An universal IK-solver for UT. This version is mainly a test, although it can already be used to achieve many interesting effects. If you want to use it for your custom vehicle/monster/whatever just read the instructions included in the pack. It's completely free (hence the name), just drop me a pm or post here, so I know what cool mods it can be used for.

    Current features:
    - IK-solver adjusting a chain of bones, so that the last one (the tip) constantly touches a specified point. This point can be set dynamically by overriding GetTarget() in subclasses of the solver. Clear and simple.
    - Blending with animations. The solver can take the animations into account and therefore adjust the bones of a fully animated mesh. However it's also possible to make a fully IK-driven movement by providing some calculated positions for legs for example.
    - Two methods of rotating the bones - multi-directional or hinge-like. See for yourself and choose what you like.
    - Handy debug-display, showing the calculated positions of bones, along with the target.
    - Interpolation functions to lower the IK-calculations rate - it's not necessary to go through those performance-costly algorithms every tick - interpolation will ensure smooth movement between the cycles.
    - FULL NET SUPPORT. freeIK works in netplay now.
    Features planned for the next release (when? in two weeks):
    - Rotational constraints (so the knees don't bend backwards).
    - Adjusting the tip bone to a specified normal (think: foot on terrain).

    Screenshots:
    [SHOT]http://img502.imageshack.us/img502/4662/ikscreenjo7.jpg[/SHOT]

    Credits:
    matariel for advises on how to convert global rotations to bones and for some very helpful bits of code.
    Epic for the engine.
    me for the code, test map, test vehicle etc.

    Download:
    -freeIK - get the basic IK-solvers and full source code here.
    -IK tests - and here's a test map with a couple of meshes and examples on how to use the system.

    Enjoy!

    #2
    Never say no to free inverse kinematics!

    Awesome work. How did you do this? I wouldn't have known where to begin.

    It's a bit... twitchy in places. Is that normal?

    Comment


      #3
      If by "twitchy" you mean that the meshes in the test map don't move smoothly - then yes, it's normal. I was just too lazy to implement some interpolation mechanism in this release, so the bones are updated only when calculations occur (every 0.1 second by default). The animations of the test mesh are crappy as well, but they were only prepared to show that the system works with animated meshes.

      How it is done? The IK-part itself is really simple - most appropriate rotation for each bone is found by a method similar to gradient following - just a couple of dot and cross products. Look up the code, it's pretty clear.
      The hard part was to apply this rotation to the real bones in a skeletal mesh. This is done by refering to bone's individual coordinate system and the coordinates of its parent. The functions responsible for that weren't really written by me - credit goes to matariel from BU forums. It's a funny story btw, that guy already made a functional IK-solver about a year ago, just didn't released it. I found his thread on BU when I was searching for a way to convert those calculated rotators to bones' rotations, talked to him a little, and now it's very likely that you will soon see two sets of IK-solvers released - his and mine

      PS. I tried to apply IK to pawns in ordinary gameplay. And kinda realized it's completely useless, unless you try to stand on a slope and stare at your character in tpp. Otherwise the subtle adjustments done by IK aren't really noticeable in the middle of a firefight. So the IK-pawns mutators has been (temporarily) cancelled, I will work on an interpolation system instead. Features list updated.

      Comment


        #4
        awesome tried to think of somthing constructive to say but i think awesome covers it

        Comment


          #5
          Originally posted by Farseer View Post
          If by "twitchy" you mean that the meshes in the test map don't move smoothly - then yes, it's normal.
          I mean that they freak out all over the place. Sometimes they'll nicely follow me at 0.1 second intervals, at other times they'll flail every which way.

          Comment


            #6
            That's weird, I didn't notice this kind of behaviour. I've tested it extensively for the last half an hour and it failed to assume correct direction only once - when I dodge-jumped right through the middle of a test mesh. And that could be easily fixed by increasing solver's accuracy.
            Can you provide a screenshot (or better a couple of screenshots) of what happens? I assume the log shows nothing? (it can't show anything, it really couldn't be caused by some accessed nones...)

            Comment


              #7
              This loops over and over:

              Comment


                #8
                Thanks for the screens, now I see what you're talking about. It's not a bug, though. I should've specified that somewhere in the readme, but the two of the test meshes in the map have animations applied to them. If you check in the editor, you'll see that these test-actors have a configurable field for animation name. They'll play it continously, in addition to IK-driven behavior. That's what you saw - IK system kicking in every 0.1 sec + crappy animation that is too fast to be precisely adjusted by IK without interpolation methods. If you take a look at the second animated mesh nearby, you'll see how it works with less chaotic animation (anim is being played and at the end of the sequence the tipbone will touch the player for sure).

                Comment


                  #9
                  I see. I should have RTFM.

                  *hides in shame*

                  Comment


                    #10
                    RTFM wouldn't help here, cause there's no real manual, only a 3_lines_long_readme_file I'm gonna describe the test actors better in the next release, so noone gets confused.

                    Comment


                      #11
                      whatsup guys, couldnt help but notice that my name got dropped and I just had to come say HI

                      Man this whole IK business is wicked, anyhow I suggest that if you have an animation that must be offset by IK, then have the solver update every tick so that it becomes unnoticeable. Otherwise as you can see, how smooth it looks becomes affected by how chaotic the animation is.

                      Comment


                        #12
                        ^ He's speakin' the truth, at least a part of it Updating the bones with IK every tick would indeed result in smooth movement. But, if my thinking is correct, it would also suppress the animation completely and that's not what I want to achieve here. So I will just stick to the idea of some clever interpolation function. Will see if it works.

                        By the way, I've came up with a concept for a possible vehicle that can demonstrate capabilities of the IK system. Meet the Overlord. Matariel said it's a walker so it probably looks like that at first sight, but I was thinking more of a flying platform, propelled vertically by the giant fans in the middle and horizontally by the mechanical legs.

                        Comment


                          #13
                          Cool! I'd love to see something like that in action!

                          I wonder how the Darkwalker works... it seems to float, then position its feet pretty much randomly on the terrain beneath it, then use some sort of inverse kinematics to trail the legs between the hub and the feet.

                          Comment


                            #14
                            yea its pretty bad as far as IK goes. Its basically superficial, the easiest way to implement a walker in a game. Ive been trying to come up with something more "solid" for a long time.... infact its why I made the IK-solver in the first place, we'll see if I can come up with something simple real quick

                            ^^ and yes, it WOULD suppress the affected parts of the animation. that cant easily be helped... I mean a nice way to do it is to maybe apply a sort of mask to the rotations [so something like ((required rotation - current rotation) * mask) + current rotation]. that should do it, wouldnt you say? that might be a little laggy though considering that we're working with coords and thats basically like comparing 6 vectors every bone... anyhow upto you, I wouldnt do it

                            Comment


                              #15
                              This stuff is way over my head, but I was wondering if you would be willing to help me (milk) use this on the RBTT Venom we made a while back. There are 8 legs (it's a spider) and the calculations would be crazy. I'm fairly certain that replication would be almost impossible for that much data, but ya never know :P

                              Comment

                              Working...
                              X