Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Physics based walking

Discussion in 'Scripting' started by KhanTyranitar, Feb 6, 2008.

  1. KhanTyranitar

    KhanTyranitar

    Joined:
    Feb 20, 2006
    Posts:
    67
    I am trying to make some characters that don't walked based upon standard animation, but rather by actually applying forces to the various components. Any advise along these lines will be helpful

    The conditions these characters will run under and the reasons I want his type of movement is varying gravity and air densities. And I want the movement to change accordingly (e.g. faster movement and larger strides in low gravity, low or no air environments)

    The big challenge I seem to be facing is keeping the feet properly planed on the ground, in other words, the feet need to move and adjust to sloped surfaces to keep the character upright.

    Any pointers or helpful hints would be appreciated.

    If you need any further information about what kinds of objects I am animating, there are composed of multiple objects assembled as a unit, with joints binding them together. Each separate object has its own zero point centered on its rotational axis. So the forces with be applied as torque and there will be a script that applies these forces and goes through a complete sequence to move the joints through their full range of motion.
     
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    There was a US university project (the name of the school and project I can't remember) that I remember playing with a couple years back. The idea was to develop human characters that were driven by AI and physics, not canned animations. So you could pose the character, for example laying on the floor and tell it to stand up. It would try a number of ways to get up, roll on its stomach, get on its knees, etc. A very interesting project, dog slow, but very interesting. The lead developer posted updates from time to time on the Blender Users forum. I seem to remember its name had something to do with "dancing" and if I can find a link to it I'll post it here.
     
  3. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
  4. Obscurity

    Obscurity

    Joined:
    Nov 13, 2007
    Posts:
    203
    Sounds a lot like what Natural Motion does. I highly recommend playing with their Endorphin LE demo just for the fun of it . Seems like the future of animation might be more like directing a film than puppeteering or stop-motion.

    http://www.naturalmotion.com/endorphin.htm

    Oh yeah, and there's the awesome Sumotori Dreams where you fight with procedurally animated characters.

    http://web.t-online.hu/archee83/sumotori/
     
  5. spawrks

    spawrks

    Joined:
    Nov 16, 2007
    Posts:
    89
    I actually found a way to implement this in Unity, although I'm not done with it yet.

    I'm using animation and springs to drive a ragdoll character, and believe that I have overcome the major technical issues regarding getting it to work.

    The biggest issue facing this type of development I've found is not getting the character to behave how you would expect, but getting input to respond well. You can get characters to move complexly if you like, but translating what a player expects to happen into the complex setup becomes quite a coding issue.

    Long story short, I believe that scripting joint movement is going to be headache for you, for while you can reach some interesting movement, you're could be making a serious tradeoff with regards to translating a players intent to control that movement.

    If you are serious about developing a game with Unity like this, please let me know, as I'm learning a lot from the other developers about the limits of the engine and might be of assistance.
     
  6. KhanTyranitar

    KhanTyranitar

    Joined:
    Feb 20, 2006
    Posts:
    67
    The characters I am using are very simple, and the scripted physics animation is limited to walking. I will have to play around with it, and see what works best. I will follow up on your links and and experiment with it a bit.
     
  7. jeffcraighead

    jeffcraighead

    Joined:
    Nov 15, 2006
    Posts:
    740
    Well the point of the work by Terzopoulos and his grad students was to use a neural network which learned how to control the forces on the various springs of a body. Thus avoiding the very difficult task of hand tuning/coding around 100 "muscles". So you allow the neural net learn to walk, pick up objects, etc. Once it has learned how to walk, input simply consists of directing the object to walk/run/pick up/swim to some point in space (the net is trained by applying force to muscles and trying to get to some point in space). See http://www.cs.toronto.edu/~dt/
     
  8. hai_ok

    hai_ok

    Joined:
    Jun 20, 2007
    Posts:
    193
    How feasible is it to get a ragdoll to roll over and sit up into a pose that is the beginning of a stand-up-off-of-the-ground animation?
     
  9. spawrks

    spawrks

    Joined:
    Nov 16, 2007
    Posts:
    89
    very feasible. you can lerp the ragdoll to almost any animation point, might want to search for forum for discussions on that.
     
  10. careyagimon

    careyagimon

    Joined:
    Dec 20, 2007
    Posts:
    209
    http://www.spiderland.org/ has a prebuilt project that might be useful to you. Breve Walker, which you might have seen in a screensaver, learns to walk using joints with muscles. It's genetically derived, rather than a neural net. The source(a script for the Breve simulation environment) is available and I think I remember it being well commented on. Although it uses a specific API, it could very easily be implemented in Unity.
     
  11. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    I wonder how hard it would be to "blend" ragdoll stuff with canned animation -- so you could produce a shuddery, jelly-like version of a normal canned animation. This might be useful just as a style option OR for specific effects (e.g. spell effects).