Search Unity

Help: Self balancing Character Physics Animation blend

Discussion in 'Physics' started by MichielAdriaansens, Jul 18, 2017.

  1. MichielAdriaansens

    MichielAdriaansens

    Joined:
    May 27, 2017
    Posts:
    3
    Hello, this is my first post. I was wondering if anyone here could point me in the right direction to get started with creating a self balancing system (Example: Sumotori dreams).



    Now i did some research and figured out it's a mix of blending animation and physics.
    I've come as far as being able to blend between ragdoll and animation with Mecanim (fall(physics)/Get up(Animated)).
    But i'm qlueless how to go about the whole self balancing thing:(
    i'm guessing the blend should be constant right? or with very rapid intervals.
    and how to even make the character maintain balance?

    ps: i work with C# and my programming skills are mediocre at best (Mainly animator/rigger).
    But if someone could explain the key ingredients, like the basic concept of how to approach this it would help me a great deal.

    Goal: Mobile app Game/portfolio

    Thanks in advance, Michiel
     
    DeepMotionPhysics likes this.
  2. FuzzyShan

    FuzzyShan

    Joined:
    Jul 30, 2012
    Posts:
    182
    I have been doing research on my own, but writing a self balance algorithm sometime can be very hard, I believe Puppet master has a demo about doing it. In the demo you see that they are taking very small steps, when having a huge step they fall(so not so smart algorithm right now)

    As far as what I am doing though, is something similar to gangbeast, have a ball rigidbody attached, and let the ball rotate, while the body walking pose can be either animation or procedural coded. To do balance for the ball, simply add up force for spine and a equal down force for hip, and when you think it should be out of balance reduce the tense that's keeping the body up straight.
     
  3. MichielAdriaansens

    MichielAdriaansens

    Joined:
    May 27, 2017
    Posts:
    3
    hi Fuzzy, Thanks for the reply.

    I'm not sure if i understand correctly.. so the ball influences the ragdoll?
    while the ragdoll is Lerp'd and Slerp'd to the animation but in a slight blended kind of way?
     
    DeepMotionPhysics likes this.
  4. FuzzyShan

    FuzzyShan

    Joined:
    Jul 30, 2012
    Posts:
    182
    Well couple things you can do:
    1. You could get previous position for certain bone and current position for the bone, to calculate the force needed to move rigidbody from one position to another, so implementing this method you will have a n animation to drive physical rigidbodies.
    2. You could write your own visual movement pose from balance to unbalanced transition by writing your own code( gangbeast did it that way)

    As far as logic concerned two things to consider:
    1. One is how do you actually move your character for me I have a ball attached to a primsmatic joint, where it is also attached to hip. So when I need it to move the ball moves down to the ground and start rotate, while walking animation(but it is physical so physical simulation will affect my movement)just make my character seems like it is moving.
    2. How to keep the body up straight and balanced, I added an force upward for chest, then add an equal downward force for hip, so you can think it is a rag doll attached to a string, when string is tensed by this force the ragdoll will seems to be standing up.
     
    DeepMotionPhysics likes this.
  5. MichielAdriaansens

    MichielAdriaansens

    Joined:
    May 27, 2017
    Posts:
    3
    Thanks fuzzy,

    I roughly have an idea of how to approach this.
     
    DeepMotionPhysics likes this.
  6. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Sumotori Dream type of physics simulated character games can be developed with DeepMotion Avatar Character Physics Engine. Avatar simulates self balanced physics based characters with physically modeled character rig controlled by advanced robotic balancing algorithm and machine learning. You don't need to apply fake force at the root of the torso to maintain the character's balancing and the characters balance themselves and stumbles to regain balance when pushed or impacted by environment, etc. Also Avatar features full control for physics based character locomotion while maintaining self balancing. It is currently in close Alpha stage. Welcome to give it a try.

     
  7. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Creating a tutorial that can potentially lead to the Sumotori Dream ...

     
  8. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
  9. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
  10. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
  11. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
  12. DinozSayRAWR

    DinozSayRAWR

    Joined:
    Jan 28, 2016
    Posts:
    2
    Hey Devs,

    I made a written tutorial covering how to target rotations with configurable joints.



    Here's what you can do with it!
     
    zeropointblack likes this.