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

Motion Controller

Discussion in 'Assets and Asset Store' started by Tryz, Feb 21, 2014.

  1. sebekz

    sebekz

    Joined:
    Feb 7, 2017
    Posts:
    3
    I have a question about crosshair management. Your CrosshairFillCircle class is hardcoded as a required dependency in bow related motion classes, but what should I do if I need to replace CrosshairFillCircle with my own crosshair implementation? Replacing code in the class itself is a short-term solution, since it would be overwritten during each asset update.

    Great work with all of your assets!
     
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks! :)

    I think with Spell Casting, I'm doing it a different way. But for now you should be able to inherit from CrosshairFillCircle.

    Since all the Archery motion access it by using "CrosshairFillCircle.Instance", you could set that instance property to your inherited class. I think the one thing I may need to do is change the properties to 'virtual'... this way you can override them. I'll do that for the next update.

    If you email tim@ootii.com, I can send the changes.
     
  3. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Just did it as you said, it works only a short period of time, after that, I found the camera is not aligned with the character anymore. Say the character is about 90 degree on Y axis global, the camera can be 75, 106 or any other random degree and this difference will keep increasing as more times I perform turning.
    It seems to be caused by the inaccurate numbers from unity's transform component, they always get a little bit bias when you read the floats.
     
  4. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    ya glad you brought this up Thanks I forgot to bring this up to Tim. we where going to rewrite some stuff . But looks like Tim will fix it .
     
  5. TheWhiteWolves

    TheWhiteWolves

    Joined:
    Aug 18, 2014
    Posts:
    11
    That sounds like you're hitting a gimbal locking issue, by any chance, if you move you camera in circular motions (i.e. try and draw the letter O with your mouse) does it become offset and get worse the more you do it.
     
  6. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I'm noticing a difference of about 0.1 degrees, but that's it.

    It could be the bone the camera is attached to and it's offset that you're seeing.

    In my case, I set the anchor to Jones' root transform and the Anchor Offset to (0, 1.8, 0). I figured this was a simple case. With that and the changes above, the rotation is always within 0.1 degrees.

    If you want to send your project to tim@ootii.com, I can look at it. I'm sure the difference we're seeing is the difference in setup. If not, I'll find the answer.
     
  7. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Using Jone's root anchor has a problem, the camera will not adjust its position with the head, it'll cause first person view to see his own chest from behind when the character is running. And I'm using MAP, it's running animation makes the character lean forward even more.
    It also makes jumping, crouching motions that need the camera to move with character's head looks unrealistic. The camera can float over character's head when landing and crouching, sink in the head and sees his own eyeballs and jaws from inside when running.
    So I'll need to set the view's anchor to the head bone, but the camera controller can only use the rig anchor if Anchor Rotate is checked. I found the inaccurate rotation bug when unchecked Anchor Rotate due to reasons up there.
    I'm using the lab demo scene for testing BTW.
    The bias can pile up to 20 degrees and more:
    upload_2017-3-16_10-7-49.png

    upload_2017-3-16_10-8-2.png

    Here are the camera settings
    upload_2017-3-16_10-8-37.png
     
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks for that.

    I see what you're saying about "Anchor Rotates". That's seems like a bug, but I'll have to look at the code.

    I'll check it out tomorrow.
     
  9. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Glad to hear!
    You'll just make your awesome assets even more awesome ;)
     
    Tryz likes this.
  10. sebekz

    sebekz

    Joined:
    Feb 7, 2017
    Posts:
    3
    I think I might have found a small bug in the ArrowCore.cs script scaling compensation logic.

    // To compensate for scaling, we use a "connector". This way,
    // the projectile doesn't scale even if the target does

    Vector3 lLocalScale = lHitTransform.lossyScale; // <== here
    lLocalScale.x = 1f / Mathf.Max(lLocalScale.x, 0.0001f);
    lLocalScale.y = 1f / Mathf.Max(lLocalScale.y, 0.0001f);
    lLocalScale.z = 1f / Mathf.Max(lLocalScale.z, 0.0001f);

    When the arrow hits a target where one of its scale components are < 0 (e.g. X=-1 to mirror a game object on the scene), the resulting lLocalScale component will be 10000 and the arrow will appear on the scene as a VERY long streak after hitting such target.

    I think this should fix that, unless I miss a bigger picture here:
    Vector3 lLocalScale = lHitTransform.lossyScale.Abs()
     
  11. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    I haven't bought MC yet, so I can't find that out myself: Does MC already include shooting pistols and rifles and knife attacks?

    Also, I would like to ask if / how it could be achieved that the hero runs around having his currently equipped weapon in his hand.
    Is this part of the "motion"? Meaning my hero will just use the run / walk animation of that specific motion, and I have to use an animation where the hero walks / run with a gun?
    I'm still trying to understand how everything works.

    Thank you for a reply.
     
    Last edited: Mar 17, 2017
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    hahaha... yep. That would be a bug. I never thought about the scale being negative.

    I'll fix that for the next updated.
     
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @twda . No, the MC doesn't include pistols, rifles, or knives. You could certainly implement the knives by using the techniques I show in the Sword & Shield Motion Pack, but it's not something I include in the MC.

    It really depends on how you want it to work. In a lot of games, you'll have animations specific to the general weapon type you're holding. Sometimes you can use Mecanim layers, but your animations need to be built specifically for that.

    With weapons like swords and pistols, you can use the included movement motions. However, I think with rifles you'd want animations that handle the arms better. So, that would be something you'd create.

    Remember that the MC is a framework for building motions like this. I include a bunch and I have Motion Packs that expand the capability, but you may need to create your own motions to get exactly what you want. I include documentation and videos to help you do just that.

    Eventually, I do plan on doing a rifle and pistol motion pack. However, there's several things in front of that.

    I hope that helps.
     
    TeagansDad likes this.
  14. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    I mean it a bit differently.
    In Resident Evil 4, when the hero is very low of energy, he gets into a "wounded" animation where his left hand is on his ribs / heart or so.


    Please watch at 11:12.

    If we saw this animation as a kind of weapon that he is holding, then it would mean the motion's animation plus an additional weapon (that he holds in front of his heart or so), this means we would have to add several more animations.
    Do you understand what I mean?
    I would like to ask how you think the RE4 creators did it and how I could achieve this with MC.
    Or should that simply be faked by intercepting OnUpdate or so using FinalIK and place the hand at the body when the energy is very low?

    I hope somebody understands what I'm trying to ask.
    A "motion" should contain all the animations that could be required, and a motion should be seen as a single class without any connection to a different motion class, right?

    For example, if I wanted my hero to swim once with a weapon in his hand, and once without a weapon, I would have to create 2 separate motions, right?

    I have used Opsive's TPC so far, and he had an upper body layer and a lower body layer so that animations could quickly be combined. I didn't like the approach because these can give strange results, but I would like to ask how this should be handled with MCS.

    Ideally, each weapon (gun, rifle, laser, rocket thrower, bow & arrow) should have its own motion class, right?
     
    Last edited: Mar 18, 2017
  15. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Right. For additive animations (animations like an injury), I think you would do something with IK. That would give you the most control.

    If you have separate animations, you could create a separate "injured walk" motion and enable that based on health or something. My concern would be that you would have to do this for all your different walk motions. So 'tweaks' to animations are probably better done with FK/IK.

    Mostly. A motion does contain all the animations it needs, but the granularity is really up to the motion creator. For example, most of my walk/run motions include walking animations, running animations, pivoting animations, etc. All that in one motion. However, you could have a different "walk run" motion if there's nothing in your hands, one for if there's a bow in your hand, and another for if there is a rifle in your hand.

    You can use layers as you mentioned. However, using layers requires additive animations and I haven't had a ton of luck with Unity's avatar mask. They tend to create strange results as you mentioned.

    So, I've been creating motions like: WalkRunPivot, Bow_WalkRunPivot, Sword_WalkRunPivot, etc. You can image that there would be a Rifle_WalkRunPivot. This really depends on the animations you have and if they support additive features.

    For example, @TeagansDad found that Kubold's Sword and Shield animations had an additive shield animation and he was able to use layers with that. So, he can raise and lower the shield while walking...cool. The Mixamo animations are free, but not so nice. :(

    Right. But, it's more than just "one motion class". For example, Archery motion pack has Bow_WalkRunPivot, Bow_WalkRunTarget, Bow_BasicAttack, and some others. Each of these motions can be used together as the "Archery Motion Pack" or you could pick and choose how you use each motion. In this way, you could use a "Bow_Jump" or the normal "Jump".

    I hope that makes sense.
     
    hopeful and twda like this.
  16. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @twda - You will find that it is easier to set up all of these variant animations (walk, walk with sword, walk with gun, walk while sneaking, etc) on Opsive's controller. He's got a convention based setup where you can just name a state Sword Jump or Rifle Jump and the Jump ability knows what to do with it.

    However, as you said, sometimes the results are weird. This comes from combining animations across 4-5 layers plus having little ability to customize how those animations work on each variant. Other than the animation speed. The blending between animations is always done with Animator.Crossfade() and O don't think you get as much control over how each transition occurs.

    So it's a trade off. I was using TPC for a while, but I wanted more control over the animations. Plus TPC keeps locomotion as part of the controller, while MC just treats it as another motion.

    You will definitely be able to get the results you want with MC. Of course, your results will be hugely dependent on the quality of the animations you use. Kubold has both pistol and rifle sets, I believe. The rest of his stuff is top notch, so I expect these would be too.
     
    twda, Tryz and christougher like this.
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Update Day!

    Today I have a pretty huge update to the Actor Controller.

    I've re-written the guts of the AC to be more responsive, smoother, and "sure-footed". You won't really notice any new features, but I did change some of the properties.

    For example:
    - Step Up/Down Speed is now a percentage. I suggest something like 0.75.
    - Force Grounding Distance is best around 0.3.

    Most of the other assets just have minor changes to support the AC. If you do have any issues, I'm always here to help!

    As always, when you update... please update all assets.
     
    TeagansDad likes this.
  18. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    Hello everybody,

    I have a few questions, maybe someone can help me.

    Is Motion Controller and Unet compatibel?
    Are there any tutorials or guids how to implement it?
     
  19. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I haven't done it myself, but I know of a couple people who have. I'm not sure how much was UNet out-of-the-box vs. code they developed.

    From what I've seen, most people that are using the MC with networking have used Bolt and that seems to work well. Unfortunately, that's probably the one aspect of game development that I've never dug into.

    After I get the Spell Casting Motion Pack out, I'm going to learn multiplayer so I can actually help. :eek:
     
    TeagansDad likes this.
  20. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Multiplayer schmultiplayer. :p
     
    FargleBargle and Tryz like this.
  21. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Is there any Bolt integration which I've missed? Just asking before I'm starting from scratch :p

    p.s. You should add namspacing in the DemoUI script, as it seems to conflict with other assets.
     
  22. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    @Stanchion has helped others with the Bolt integration. Perhaps he can help you. :)

    One day when i'm clear on what needs to happen, I'll document the steps for everyone.

    Will do.
     
  23. Twoonebe

    Twoonebe

    Joined:
    Mar 30, 2013
    Posts:
    174
    i hope this takes not so long time :-(
     
  24. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    I have purchased MC and the Camera Controller because I feel very much "at home" with what I saw in the tutorial videos. Thank you very much to Tim and the great contributors on this forum.
     
    TeagansDad and Tryz like this.
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Very cool!

    There are definitely some great people on this thread. It's one of the things that keeps me motivated. :)
     
    twda likes this.
  26. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    @URMOM1 Could Tim make a poll perhaps?
     
  27. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Just out of curiousity, how many of you are using Kubold's animation packs and are interested in the motions I've been working on for them? (MAP, Female MAP, Sword Animset Pro, Sword & Shield Animset Pro)

    I could spend forever adding to them and tweaking them... So if others here want them, I'll make it a priority to clean up and package what I've done so far.

    (Also doing a set of motions for his buddy Riko's Two Handed Sword Animset Pro as well. Got the basics of that done today)
     
  28. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Totally!
     
  29. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Usually once I release an asset I'll put up a post of the things for me to work on next. I'll do that again after the Spell Casting Motion Pack is done.

    That one is going slower than I hoped due to other commitments, but it is coming. :)
     
  30. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    contact Stanchion on Bolt's forum or chat. He had helped me and I helped him understand MC...so I worked with him. and he helped us..

    So ever since then, he has a clear understanding on what needs to be done for it to work with MC, so I would contact . if he don't get back for some weird reason. let me know. But I did send the scripts to Tim if he wanted or plans to in the future to add to MC..Its not very much at all that needed to be added. But if he didn't for some reason, its not that bad at all to fix, its a very small script and had to edit one of MC's with a few lines of code.. fairly simple now that I understand the issue. better.

    plus Stanchion I believe is releasing, a sample pack for Bolt soon, which will include more stuff for Motion Controller and other assets with Bolt. Ask him about that as well. I asked if he could do that to help other Motion Controller uses who want to use Bolt.



    The issue mainly was the animations where NOT always working . or syncing properly..

    Our mobile game has been tested over and over, Open World game very large mobile game which is being ported to console possible PC..This has been tested on PC and works well..now..So he should be able to help you since its not much that needs to be changed at all.
     
    Last edited: Mar 24, 2017
    Tryz and silentneedle like this.
  31. GambitMonkey

    GambitMonkey

    Joined:
    Apr 5, 2016
    Posts:
    65
    I would love to see what you have TeagansDad. I own most of Kubold's animations packs and have not yet jumped into creating motions based on them. Still using the Mixamo stuff, but would really like to swap them out for the Kubold stuff.
     
    Tryz likes this.
  32. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    So. It's been a while since I dealt with UMA. But it seems to have improved a lot. so if any of you has experience. Which is better UMA or MCS?
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    My observation is that MCS has rarely, if ever, worked. This, that, or the other thing in their system seems to be broken. But they have some good body textures and hair models, and you might be able to use the clothing, depending on your game needs.

    UMA works, can be set up to use asset bundles, is network friendly (the server can send all the character recipe strings over the network to instantiate characters), and it's lightweight, so you can get maybe one or two hundred models in a scene on desktop (of course situations vary a lot). You can use your own art with UMA, or you can buy art made for UMA, or you can adapt other art you have already purchased to use UMA. For instance, if you like the MCS meshes and textures, you can adapt them for use with UMA (minor use of a 3D modeling program like Blender required).

    UMA characters are built as slots (meshes) and overlays (textures) that are combined at runtime and atlased for performance. You can use your own shaders or the standard ones.

    The main difficulty with UMA has been that models are created at runtime. While some plugins have become more friendly with UMA over time (Motion Controller seems to work with it out of the box now, so far as I can see), since many other plugins assume your characters are prefabs, you may need to write some bridge code to get those plugins functioning with runtime generated models. There are also a few plugins that specifically work with UMA, such as the Inventory Pro system, and Simple LOD.

    For more info, of course check out the UMA and MCS threads.
     
    TeagansDad likes this.
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    antoripa likes this.
  35. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    773
    No, but they look nice. Besides the usual locomotion stuff, they have lots of great climbing moves, and that last slide animation might help me get my water slide up and running. ;)
     
    Tryz likes this.
  36. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I picked them up when they were on the 24 hr sale a few days ago. Haven't had a chance to do much with them, but I think it's probably worth it just for a good, complete set of climbing animations.
     
    FargleBargle and Tryz like this.
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Another update to the Spell Casting Motion Pack.

    The feedback has been great and I'm trying to add some of the feature requests I've been getting...

     
  38. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182

    Man, this is so cool. Thanks Tim.
     
    Tryz likes this.
  39. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    BTW I'm having problems with my ocap setup. It had been in storage for a while and now something doesn't work. So, I'm not gonna be able to do the animations for a while. :( I just tried again to capture for the push and pull spells but yeah. its not working.
     
  40. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Really like how easy it will be to add magic resistance. Could easily be part of every spell. A thought that crosses my mind is what if you want to decrease damage based on some resistance float value? I.e. A spell does a base damage of 10 but decreases based on level of magic resistance rather then an all or nothing sleep approach.

    Also, just to make sure I understand the batching. If you had 2 batches targeting 10 guys it would actually send it 20 different times, twice per target right? Would a range of batches, say 2-5 have the same batch number per target? Or would one target get maybe 5 magic missiles and another 3?

    Nice additions!
     
    hopeful and Tryz like this.
  41. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I imagine it will be fairly straightforward to add new nodes for the spell builder that implement any additional functionality, using the existing ones as a guide. (Assuming it doesn't already have nodes that can be used for reducing damage)

    I've built this sort of custom content for Node Canvas, ORK Framework, Playmaker, and Behavior Designer, so I can provide assistance with this (if Tim is busy or just needs to focus on other things).
     
    Tryz likes this.
  42. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Super excellent .. I look forward to getting that ...together S&S my hero is going be ready for his journey ..
     
    Tryz likes this.
  43. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    I was watching the latest video posted and I realized something, this spell editor can also be the basis for a "chemistry engine" like in zelda breath of the wild but with wilder chemistry o_O I wonder if it is as generalizable that my first thought is making it seem. Putting that there in case in spark imagination.
     
    Tryz, reocwolf and TeagansDad like this.
  44. TheFoundation

    TheFoundation

    Joined:
    Jan 29, 2014
    Posts:
    20
    The Kubold animations are on my todo list. I would be super interested in checking that out!
     
    Tryz likes this.
  45. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    There are more of you than I thought interested in the motions for Kubold's animations. I'll focus on getting the MAP set (including FMAP) ready to share over the course of the week. I almost have a Jump motion that works and looks okay. That's definitely the trickiest one to tackle (Running jump is easy).

    I'm going to assume that pretty much everyone using one of Kubold's packs has Movement Animset Pro. The sword sets use MAP's idle pose in a few spots, and FMAP lacks the 180 degree running pivots and proper land-to-run animations.
     
    Tryz likes this.
  46. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    That is a really good idea.
     
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I appreciate you trying. :)

    I totally understand how that goes. I dusted off my laptop the other day thinking I'd use it, but it had other plans.
     
  48. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    That should be pretty simple for me to add.

    It may not be sophisticated enough for complex RPG calculations, but it would be a simple start. As @TeagansDad said, making new nodes for specific situations should be pretty easy.

    Great question.

    Say I find 10 guys. The "Batch Count" is the number of guys per batch (maybe I should rename that). If we set the random range to (1, 1) then 10 batches would be sent with 1 guy each. If we set the random range to (2, 2) then 5 batches would be sent with 2 guys each. So, I'll only send each guy once.

    The nodes that follow will determine what to do with the guys in each batch.
     
    TeagansDad likes this.
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Exactly! As you can imagine, you'll be able to create your own "nodes" and "link actions".

    Yeah, it's very close to those. As always, you rock! :)
     
    TeagansDad likes this.
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    When I built the Spell Editor, I built it in layers:

    1. NodeGraph
    General node and link asset that has all the core functionality to add nodes, create links, etc. It's the basis for other node-based tools.

    2. Spell Editor
    This inherits from the NodeGraph classes and does spell casting specific work flow.

    In fact, I used the NodeGraph classes as a basis for a "Sequencer" as well. This allowed me to create some cool cinematic flow for a client.

    So, some smart cookie could certainly use it as you suggest. ;)
     
    TeagansDad and neoshaman like this.