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

Physically Based Character, Active ragdoll, Beta

Discussion in 'Works In Progress - Archive' started by Kavorka, Nov 23, 2014.

  1. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Early prototype of a Physically Based Character controller, with hit reactions. Also does moving platforms and has realistic friction.





    Meta: Active ragdoll, bullet drop, pushing, pulling, IK, reaction forces, physics
     
    Last edited: Mar 1, 2015
    vintproykt and Nanako like this.
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I certainly like the idea, and I imagine a lot of others will too.

    The upper body looked a bit stiff, BTW. Probably need to combine this in some way with a ragdoll mask and weight balance algorithm? Seems complicated!
     
  3. x_african_warrior_x

    x_african_warrior_x

    Joined:
    Jun 24, 2014
    Posts:
    80
    impressive, i learnt something new
     
  4. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea this looks very cool...very interested
     
  5. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    This looks pretty cool! Looks like something @Nanako might find interesting.
     
    Nanako likes this.
  6. makoto_snkw

    makoto_snkw

    Joined:
    Aug 14, 2013
    Posts:
    340
    I like it, I want it.
    But like some guys said, the body is a bit weird. It's like he's being dragged.
     
    hopeful likes this.
  7. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    that's so cool how you did that. i hath been summoned
     
    Zomby138 likes this.
  8. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    the leaning thing seems pretty cool, although very overexaggerated.

    can you clarify a little more what is actually happening here ?
     
  9. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Looks cool, although I dont think you can have a 'physically based' character controller, like you have physically based lighting. As there really isnt any hard numbers or math for how the character reacts. With lighting its universal and the same all the time with the same math.
     
  10. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    What is happening here is maths and physics blended with a tiny bit of AI. I do the maths and make the character's motion obey the laws of physics. The leaning is not exaggerated but the the character's strength and the friction coefficient is high to make the character responsive. I can adjust a "Hollywood factor" for most physics to make the character feel right. The character also obeys the friction laws, not fake friction, real friction from the actual normal force. In the hit reactions the linear and angular momentum are preserved and there is some AI to get the character to regain balance. The environment also receives reaction forces and torques from the character, like in this older video.



    Tiny Man: Are you trolling me?
     
    Last edited: Nov 30, 2014
    vintproykt and Nanako like this.
  11. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    Is this going to be added to animfollow?
     
  12. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Part of what makes the upper body look stiff is the arms don't move out to counterbalance.
     
  13. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    blueivy: I don't know. For now, I am just working.
    hopeful: Yes, there are much to be said for details and sub animations. I currently prioritize developing stable fundamentals.
     
  14. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Minor update.



    Physically interacting character. Physical hit reactions on individual limbs, real friction, soft legs, recoil and head / gun bob is not programmed but physical, synced step sound, active ragdoll, ragdoll and back to animated state, mix ragdoll with animations, partial ragdoll, collider matches physical form, predictive foot IK, independent gravity direction, aim from gun's physical direction, true bullet drop (both speed and direction), true reaction forces in all directions, works with moving platforms, follows terrain smoothly, airs out from negative g-forces, legs compress from positive g-forces, all motions blend, jet pack (not shown), drag character with swipe motion. No scripts required on props or environment.
     
    hopeful and blueivy like this.
  15. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    I think his ability to follow terrain is a little goat like :p it causes his foot to bend un realistically sometimes, is there a way to lock his joints so his foot can't go at 90 degree angles. Also how was he able to climb up a ceiling? The character environment interaction is awesome alone but I feel like creating physically based movement could push it to a next level. Kind of like how this system simulates muscle activation. http://mrl.snu.ac.kr/research/ProjectManyMuscle/index.html
    it allows for some really cool features like pain avoidance.
     
  16. makoto_snkw

    makoto_snkw

    Joined:
    Aug 14, 2013
    Posts:
    340
    I like this so far, but I think after a fast speed jump, the impact should make the player body rolling over before standing up.
     
    Damianyyy likes this.
  17. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Thanks for your input. The character controller is built to work without having an army of animators. It currently only uses the free mocap animations from UT. One way to fix the feet is to blend up/down hill animations for steeper sections. Another way is to limit the angle, but it has not been on my prioritized list yet. I could fix the feet.... :)

    The character is able to climb up the ceiling because I can set the character's gravity independently from the physics engine. That opens up a few possibilities for being creative.

    The muscle thing, cool, but I have opted to make a character controller that can use standard mechanim animations. I do modify things on the fly, like step length, and have considered going procedural. But I think it is best to keep the possibility to use animations.

    Rolling landing, maybe.
     
    vintproykt and blueivy like this.
  18. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    591
    release date `?
     
  19. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    Thanks for the reply :D your work is amazing
     
    Kavorka likes this.
  20. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    BTW, I like the ceiling running bit. :)
     
  21. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    do you control any mecanim animation with input or with velocity ?
     
  22. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Yes, I use many parameters to control the animations.

    Can't say about release date. The possibilities are deep, I could work infinitely with adding features and polish. Can't say when I will call it enough. I currently spend most the time making stuff that works work better, be coded cleaner, with more robustness and less complexity. Then I may add things like better contextual animations and whatnot.
     
  23. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    ok see when is ready :)
     
  24. Alphalpha

    Alphalpha

    Joined:
    Oct 9, 2013
    Posts:
    74
    I've been interested in AnimFollow for quite a while and this looks like a more comprehensive version of that. I've seen you mention that this may be released as a separate package, in which case I would definitely go for this one. However, there is stuff I'd like to test out with AnimFollow in the meantime. Is there any chance you could release an early prototype on the asset store with AnimFollow rolled in so I could purchase and test while the features are being developed?
     
  25. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Yes, thank you, this package is seriously cool (in my own opinion).
    I am considering selling it privately, as an early release. Same EULA as if from the asset store. Price is $180, payment directly to my Paypal. Those who can provide proof of purchase for AnimFollow may get the early release for $90.

    This should be legal, right? I would need the weekend to clean up the new automatic setup.
     
  26. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    why not but trouble is for update later
     
  27. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Buyers will off course be on a mailing list and receive updates.as soon as they are ready.
     
  28. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    Will this be compatible with finalik?
     
  29. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Yes, I plan to do my best to make this compatible with other popular assets. Early releases will probably be only partially compatible. It's a work in progress.
     
  30. Alphalpha

    Alphalpha

    Joined:
    Oct 9, 2013
    Posts:
    74
    Hmmm, I might go for that. The trouble is, as kilik128 mentioned, is getting updates. The asset store is pretty inflexible, but it is a nice tool for organizing and updating your assets; any idea when you might release something on there (I understand it might be a while as you'd have to meet Unity's 'completeness' standards)? Still, I'll definitely consider it; thanks for the offer.

    Pleased to hear about planned FinalIK compatibility, as I intend to use them together. How difficult will it be to marry these two systems? As I understand it, AnimFollow was pretty much about adding physical reactivity through, well, following animation with ragdolls through the use of physics. This, however, also seems to be altering the animation through Foot IK, leaning to compensate for sliding, et cetera. I'm curious as to which aspects can be swapped out (such as perhaps Foot IK) and which are more intrinsic to the purpose of the package, and how these aspects play with external input.
     
  31. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    I don't see getting updates as problematic for you. You have access to download the asset from Google drive 24/7.

    The foot IK is purpose built, and I think replacing it will be a mistake.
    The aim and gun IK is also pretty advanced to have the correct feel and functionality on a tilting body.
    I'll consider including stripped versions.
    I view compatibility primarily as a way to add functionality rather than to replace stuff.
     
  32. Alphalpha

    Alphalpha

    Joined:
    Oct 9, 2013
    Posts:
    74
    I mentioned foot IK because finalIK's grounder script is very impressive:
    . FinalIK in general is a really powerful asset and I like it a lot, but it seems like it covers a lot of the same ground you're working on, so I'm not sure how well they would interact. I would love to see a high degree of compatibility but I have no idea how hard that would be.

    Anyway, you've sold me on the early access release idea so I'll probably pick up AnimFollow soon.
     
  33. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    Yes about jump when i set gravity false and play with ikweight i can optain somethink



    only work when i follow terrain and gravity look keep force to character have no time to jump
    and when i try active desactive gravity in run time it's take no effect on it
     
  34. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Yes, you should set IKWeight to zero when jumping. There is a post (#56) in the AnimFollow thread about jumping that might be usefull to you. The problem in the second part when the character doesn't get up, I know why that is.

    Please post your AnimFollow work in the AnimFollow thread. Please do not post your AnimFollow work here, this is a thread about another asset, the PBC.
     
  35. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    The new automated setup creates the active ragdoll and adds all the necessary components. I have tried it on a few different rigs. It works well and sets the joints and limits correctly regardless of the transforms' internal rotations.

     
    Last edited: Dec 4, 2015
    blueivy likes this.
  36. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    Wow, so simple! Can't wait for release :D
     
    Kavorka likes this.
  37. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    I made the foot IK optional and still managed to keep the functionality. Now, if you don't want it, just remove the foot IK script.
    I also put on the road map to make two versions of the foot IK. One full version and one super performance version.
     
  38. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Trying the compatibility with external IK. There is a class called UserCustomIK, wherein you may write any custom IK, and it will override the animations.

     
    Last edited: Feb 8, 2015
  39. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Way more in this than just active ragdolls.
    Please see the manual here.
    An alpha version (includes continuous updates) is available by contacting me. Price is $180, AnimFollow users pay only half price.

    Edit: A customer have applied accelerator and swipe control to this and used it on mobile. Mobile is planned to be officially supported for a limited number of characters on screen in future versions.
     
    Last edited: Mar 1, 2015
    blueivy likes this.
  40. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    physics change lot on unity 5 it's working on it
     
  41. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Yes, I am developing in Unity 5 now.
    Manual includes description of features and explanations for the scripts (not complete yet).
     
  42. Alphalpha

    Alphalpha

    Joined:
    Oct 9, 2013
    Posts:
    74
    Hey, I looked through the manual and it sounds super impressive! Thanks for adopting my custom IK suggestion, too. I've been trying to work out the animation side of things and I'm a little strapped for cash at present, but I'll certainly pick this up soon™.
     
  43. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Web player available here. I enjoy the realistic shooting. Try going to third person view with the cursor visible and drag and throw the character with middle mouse button. You can also see if you are able to hockey tackle the enemies to the ground. Jump onto the trolley and roll away. The ball launches at you and the character is set to fall only on a hard hit, otherwise it will just be knocked back. Don't hit escape, it will disable lock cursor.
    Still only alpha, see the potential not the occasional flaw.
    Manual
     
    Last edited: Mar 12, 2015
    vintproykt likes this.
  44. LudiKha

    LudiKha

    Joined:
    Feb 15, 2014
    Posts:
    140
    Very impressive!
     
    Kavorka likes this.
  45. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    What is the latest on this. Will it be in the store? How does it compare to AnimFollow and FinalIK ?
     
  46. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    Hello Punk
    I am still improving, changing, polishing, changing, developing, changing this, to get it the way I want it. I am pretty happy with the way it is going, but there are still things to work on.

    It compares to AnimFollow like AnimFollow with a PhD. I does what AnimFollow does, better and smoother, and it does a range of thing AnimFollow does not. I think it is the start of the future.
    It is not an alternative to Final IK, you want both.

    It may or may not be in the asset store, can't say for sure. Get it directly from me. $180 per seat for indie developers. If you are EA you have to pay more.
     
    theANMATOR2b likes this.
  47. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
  48. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    I glanced at the manual .. Is there the ability for the AI to determine when to go ragdoll and fall or does the user decide ? I am thinking about this in terms of messing with Endorphin (NaturalMotion) years ago.. so maybe that is confusing me
     
  49. Kavorka

    Kavorka

    Joined:
    Sep 15, 2012
    Posts:
    247
    The AI decides when to fall based on parameters the user can set. Outer force and collision speed are examples of parameters that can trigger a fall. Or it can be triggered manually, or by raycast. It is quite powerful, although it is still not fully developed.
     
    theANMATOR2b likes this.
  50. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    So a difference between this and something like endorphin when it comes to a biped falling is that in Endorphin the physics alone determine if the biped falls whereas in PBC the biped falls on a user command. Is that correct?