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

Bone Controller [RELEASED]

Discussion in 'Assets and Asset Store' started by Tryz, Feb 16, 2015.

  1. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Can you post a webplayer of this?
     
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Yeah. Today and tomorrow I've got some client work to do, but I'll get it up as soon as I can.
     
    ZJP likes this.
  3. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    For the web demos, I use a Bezier path object that I created. It allows me to create a curved line/loop to show off motors (like Look At). That's worked out pretty well and is part of the package for anyone to use as they wish.

    I'm really trying to be careful about creating a second character controller. I think that's where path-finding would really belong.

    Note: If all of you think I'm making too much of a distinction between "character controller" and "IK controller", please let me know. In the end, I want to build things people use. I just think they should be modular so you aren't stuck with ONLY ootii stuff. You should be able to use your character controller with my Bone Controller...right?
     
  4. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    nice touch w integrating bezier path.
    and of course you're right to go for modularity!
     
    twobob and Tryz like this.
  5. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Path finding, IK and Character control are inextricably linked in any decent modern implementation.

    If you provide an extensible, modular character controller that is near-or-compeltely-Garbage-free, with auto-path-finding for the IK (to demonstrate possible moves, et cetera), IK to perform such moves and the resultant forces, and extra path-finding goodies for the NPC's not many people will care that the label(s) say "OOTI", all they will read is "WORKING, FEATURE COMPLETE, EXTENSIBLE". Wouldn't you?
     
  6. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Well ... accommodating pathfinding for everyone is tricky, isn't it? Some people want their baked 2D navmesh while others - like me - want dynamic pathing in 3D.
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    haha... I had a lengthy reply and then hopeful's came in... exactly.

    There are too many solutions out there for me to not be modular. I also don't want to try and compete with all the great solutions that already exist (and have a strong user-base).

    Better to be modular and support them all.
     
    Last edited: Feb 19, 2015
    Zaddo67 likes this.
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Some quick images of the MC & BC integration...


    In this one, I fell of the edge and landed in a good pose accidentally.


    Slowing stepping up. This is all IK, no animation.


    Sliding. The IK augments the animation much better. Feet are grounded to the slope much better.


    Stopped on a rotating platform. Character is just rotating with it.

    Not everything is roses and butterflies. I'm not liking some reactions I get with the overall character collider. I'm also finding putting colliders on every bone (for the impact motor) isn't worth it.

    So, I won't have a release this week. I just need to work through these things so when you do get it (as beta), it's all as smooth as we would expect.
     
    Last edited: Feb 19, 2015
    DMeville and hopeful like this.
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I've added a new scene to the web demo.



    You can move the box around and see how the characters react.

    Each of the characters is a skinned mesh with the Bone Controller... no character controller or rigid-body. So, they just float where I put them. :)
     
    hopeful likes this.
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Is BC working for both the eyes as well as the head on tracking?
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I didn't do anything with the eyes, but if they are attached to transforms in the skeleton it should work.

    I'll have to see how the Unity man's eyes are done.
     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Here's a quick video of the Bone Controller working with the Motion Controller.

    What you're seeing is the "Foot Motors" ensuring the legs bend correctly based on what they are standing on. The feet also rotate to match the ground (within limits).


    (I'm purposely walking on edges so you can see how things react in a real use-case scenario)


    Geeky stuff below...
    One thing that bit me in the butt was the capsule collider. By default, the capsule collider (from Unity's Character Controller) covers the feet of our avatar. That means, we can't ever reach the ground to re-position them because the capsule collider bumps us up.

    What I've done in the upcoming version of the Motion Controller is to rely less on Unity's Character Controller (and capsule collider). By doing this, I can control the actor much better.

    In fact, what I'm paving the way for is a complete replacement of the underlying Unity Character Controller with my own. This would give us complete control over character placement as well as features like walking on walls and ceilings... but, that's a different post. :)
     
    hopeful likes this.
  13. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    that's quite a big step forward. you also have the collisions figured out without character controller / capsule collider? if you do, that would make a lot of things simpler.
     
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @dibdab

    Yeah, having a controller without requiring a capsule collider is working out really well. I've been hung up on some client work, but I do have the "Actor Controller" sliding against wall, going up stairs and ramps, and reacting to forces like gravity without a Unity Character Controller or capsule collider. So, you can put a rigid body or collider on it if you want, but they are not required. I'm liking it so far.

    However, none of this will be part of the upcoming Bone Controller release or Motion Controller update. The "Actor Controller" will be a foundation for the Motion Controller in a future update whose release is TBD. It requires lots of testing and I don't want to monkey any existing users up.
     
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I'm glad to see a move away from the standard capsule / controller setup toward something more sophisticated.

    Looking forward to it! :)
     
    Tryz likes this.
  16. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I've submitted the Bone Controller beta... whoo hoo! Now it's in Unity's hands.

    While we wait, I'm putting together some intro and tutorial videos. Here's the first.


    I'l put more tutorial focused ones up soon. Enjoy.
     
    UnleadedGames and hopeful like this.
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    This is my first Bone Controller tutorial. It sets up a s simple motor from scratch in about 1 minute (and another minute of me jabbering). ;)



    I plan on doing a lot more of these. My goal is to be quick, but it needs to be useful. So, let me know what you think.
     
  18. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    interessed by Impact motor
     
  19. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    @kilik128 Thanks.

    It's taking a while to get approved by Unity, but the GDC and the Unity 5 release may have a tad higher priority than the Bone Controller release. ;)
     
  20. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    Waiting here too, like waited for unity 5. :)
     
    Tryz likes this.
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    hahaha... I only look if it's been approved about 5 times a day. :eek:
     
    msl_manni, AaronClark and DMeville like this.
  22. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    @ZJP This is for you... well not just you. :)

    As we're waiting for the Bone Controller to get approved, I thought I'd show a quick video of my upcoming character controller improvement. It will become the new foundation for the Motion Controller.

    Yeah, you can walk on walls. :)

     
    AaronClark, hopeful and DMeville like this.
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The Bone Controller is live! Whoo Hoo!

    Make sure you check out the Quick-Start Guide.

    Please remember it's in beta. Feel free to provide feedback here or through email: tim@ootii.com.

    I also submitted it before Unity 5 was release. While it does work with Unity 5, there will need to be some script updates. These updates will be part of my first update.
     
    AaronClark likes this.
  24. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    537
    $50 is the beta 'reduced price'??? If yes what will be the final price???
     
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    A comparable product is $90. I'm not sure it will be that high, but more than $50.

    A lot of work has gone into making this a solid product and I believe it has value. If you follow any of my other solutions, you'll see I am fanatical about support and seeing the products improve.

    (Also, please remember that Unity takes 30% off the top...and I like to eat. ;))
     
    Last edited: Mar 10, 2015
    Griffo and DMeville like this.
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey all,

    I just added a video on how to setup foot IK for a Mecanim humanoid character...


    One of the things I want to do is create tutorials and videos that are more than just tech demos. Instead I want them to be more usable for our games.

    So, please let me know if there's something specific you want me to show and I'm happy to do it.

    Thanks!
     
  27. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Wow! Subscribed!
     
    Tryz likes this.
  28. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    I must say, this is a very good project. :) keep it up
     
    halcyonideals and Tryz like this.
  29. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    Can't wait to pick this up :) Sucks to be broke right now :( lol Congrats on the release!
     
    Tryz likes this.
  30. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    My next purchase ( to support my MC) . ;)
     
    Tryz likes this.
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thank you guys for all the support! I really appreciate it. New videos coming soon... :)
     
  32. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    The walking on walls looks great. I'm not broke like UnleadedGames - I like to think of it more as an "inverseTransformCashFlow(Vector3.forward)" - so this will have to go on the wishlist for a little while. :)
     
    Tryz and Zaddo67 like this.
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Yup, it's on the ol' wish list and watch list here too.

    Looking forward to the integration of the new character controller and MC. I might even try to make a motion. :)
     
    Last edited: Mar 11, 2015
    Tryz likes this.
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Just a quick video showing off support for legacy characters and animations. This was at the request of someone else and I'm glad they did since it helped me find a foot IK issue.



    I need to test out the other motors, but things are looking good.

    I'm happy to test other characters if you want to send one my way...
     
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    So, this is why doing beta (for a short time) is a great thing...

    One of the users said he was having a problem with his character and I saw this...

    kids, close your eyes...

    Needless to say, that's not right and I was totally baffled.

    It turns out he imported his Maya rig along with the character. So, all the IK and FK nodes came along with the bones and created a lot of extra "stuff". He didn't do anything wrong. It just wasn't what I expected.

    Thanks to this, I've implemented filters for when the skeleton is imported:


    With the next update, these extra pieces won't be part of the skeleton and all will be good again.

    I would never have found this without Steve's help. Heck, I wouldn't have known you could do this with Maya.

    I love this community! :rolleyes:
     
    hopeful likes this.
  36. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Whoo hoo! We've actually got some reviews coming in and they are positive! Thank you for being so patient.

    My goal is to get through some of the bugs and required feature requests (like the bone filters above) and then start working on the next motion...

    3 Bone to Ground motor (think quadrupeds)! :D

    Another motor I'd like to do is a "hand-to-wall" where the arm reaches out to the wall when you're walking. I saw that in a game and thought it added some cool interaction to the environment.
     
  37. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    I still need another month and a week before my budget replenishes so I can purchase, can't wait I'm dying to try it out!
     
    Tryz likes this.
  38. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Hi, great looking asset.

    I've used multiple payed IK assets from the store and one free one off the net over the last year and they all have good and bad points, and to be honest the free one simplifies what I need, some are just over complicated.

    I'd like to say yours looks as good as the best I've used so I might give it a try.

    The one question I have .. I'm interested in the in the hit reaction but I find it to look a bit wooden in the web demo, is it easy enough to effect the other bones in the chain? Like if the arm is shot for a small amount of force in the upper body and upper leg sort of twisting the character in the direction of the hit?

    Same with the head effecting the upper body making the character lean back when hit from the front.

    Thanks.
     
  39. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey Griffo,

    Thanks for the compliments! :)

    You bring up an interesting point about twisting the character. I don't have it twisting the bones as much as moving the bone in the "deflect direction". Then I push that movement up and down the chain.

    You can see the properties below...



    So, we can effect the chain (both up to the ancestors and down to the descendants) through the "spread" properties you see. However, I'm just doing swing and not twists.

    I got good results with this approach, but I could see where the twist would add more realism. It makes sense that there would be twist, but I'm not sure how the physics would be applied to the other bones. I need to do more research...

    Sort of a weak answer, but I hope it helps in understanding what it does today. :)
     
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Would this also apply to a "wall lean" animation?
     
  41. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272

    Try propagate-force, apply force at an offset from the child-center. That will make the physics object tilt in the force direction. You will have to experiment for the desired effect. I suppose this will help to gain the necessary effect we need. :)
     
  42. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    Thanks for the answers ...
     
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I am calculating an "offset from the child-center" collision response. That's what is providing the correct deflection direction I mentioned.

    When you say "propagate-force" is that something that's in Unity? I'm searching for it and can't find it.

    Something to also note... I'm not adding a rigid-body or regular collider to every bone. You could, but I felt like that was major overkill and could weigh down performance. The documentation explains my pseudo-colliders on page 25...if you want some late night reading. :)
     
  44. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    I thought you are using physx colliders.. There is no term such as "propagate-force" in unity, but you could apply % of force down the chain of colliders.

    Here the direction of impact point is of importance, so that the force is applied in the same direction (all axis). The way the impact is visible in demo is not acceptable, it looks fake.

    One thing you could do is rotate bones in the direction of impact. If you do it properly then it can be made more believable.

    I will read that document. :)
     
  45. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    I read that document, but could not get how the colliders react on contacts or how the force is transfered between contacting volumes. :)
     
  46. Goldrake

    Goldrake

    Joined:
    Feb 6, 2010
    Posts:
    148
    Hey Tim,
    can you explain any differences between your product and FinalIK?

    Thanks!
     
  47. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    The bone colliders sounds really interesting. I read the docs but can you mention what kind of functions are available to test against them? Sounds pretty perfect for a melee collision system. I'm guessing I could cast ahead along the direction of a swing to check for bone collisions?
     
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey all,

    Today has been a crazy day and I'm trying to catch up. So, I'll answer things as best I can...

    From what I've heard, FinalIK is great. But, I felt like there needed to be something that was more extensible and foundational for characters.

    The Bone Controller provides a framework for creating motors and standardizing bones across all models. What I mean by that last part is that some artists create bones along the 'up' vector, some the 'forward' vector, etc. The Bone Controller wraps all of that to make working with IK/FK easier and consistent.

    With the Bone Controller, you can also attach new bones and even create bones from other static meshes. This is great for pony tails, tails, turrets, animating objects in the scene, etc.

    So, the Bone Controller is a collection of IK/FK tools for bones (Foot IK, Arm IK, Look IK, etc), but it's also a solution to get at other bones in your skeleton and create new skeletons and motors.

    Hey Manni, I see. That % of force down the chain is exactly what I'm doing. You can control how far it propagates and the dampening through the properties I show in the image.

    I really appreciate the feedback. To be honest, that's one of the reason I'm a fan of these extensible solutions. If you don't like the motor and I'm too slow in improving it, the foundation is there for you to build one that fits your needs and plug it in (or share with others).

    I see. Right, I didn't go through the details of the actual code. I figured that would be good for the upcoming Motor Builder's Guide.

    Basically, I'm detecting the collision point of the ray vs. my pseudo-bone collider (think capsule). At that point, I do a physics based "sphere vs sphere" collision resolution to determine the deflect direction the bone would take. So a ray hitting the center of the bone would force the bone in the direction of the ray. A ray hitting the edge of a collider would cause the bone to deflect away from the direction of the ray. Then, I apply the movement caused by the impact. The overall change is propagated up and down the chain of bones per the properties.

    I hope that helps.


    Great question...

    On the skeleton, two functions exist:
    Code (CSharp):
    1. public override IKBone TestPointCollision(Vector3 rPoint)
    2. public override bool TestRayCollision(Vector3 rStart, Vector3 rDirection, float rRange, out IKBone rHitBone, out Vector3 rHitPoint)
    The first one will return the first bone that intersects with the world point.

    The second one will return the bone and actual collision point when a ray is shot.

    Then, the bones themselves have the following functions:
    Code (CSharp):
    1. public override bool TestPointCollision(Vector3 rPoint)
    2. public bool TestLocalPointCollision(Vector3 rLocalPoint)
    3. public override bool TestRayCollision(Vector3 rStart, Vector3 rDirection, float rRange, out Vector3 rHitPoint)
    4. public override Vector3 ClosetPoint(Vector3 rPoint)
    The last one doesn't really care if there is a collision, it just returns the closest point.

    With those, you should be able to get the test you mentioned.

    Note: While working on a new solution, I've come up with some improvements to these hit tests. So, I'll be moving that code over soon.


    Whew. I hope I caught all the questions. :)
     
    Last edited: Mar 16, 2015
  49. Silly_Rollo

    Silly_Rollo

    Joined:
    Dec 21, 2012
    Posts:
    501
    Is the cost of these casts about the same as a normal raycast? Also, if you start a TestRayCollision from within a bone will it hit the interior of the bone (double sided) or would you need to also check if the origin point is within it?

    I'm interested in your progress on that raycast CC. I've experimented with both Unity CC and rigidbody approaches and didn't like either one and the 2D sidescrolling raycast controllers definitely work way better than the physics based ones.
     
    Last edited: Mar 17, 2015
  50. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    I was sure that you are transforming the bones and not rotating the bones. There is where the fake ness is coming from.

    One thing you could do is rotate bones in the direction of impact. If you do it properly then it can be made more believable.

    I have done this in some of my earlier projects, where I would twist the bones in the direction of Impact. It would be fake but more convincing.

    Another Idea would be to use a temp IK that would add to the underlying animation. The IK goal should be set further in impact direction. This can also act as a convincing effect. I think that this would be a better solution as you can time the TempIK to last for a certain time or longer, like disabling a limb, dangling IK Goal.
     
    twobob likes this.