Search Unity

Motion Controller

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

  1. eagleeyez

    eagleeyez

    Joined:
    Mar 21, 2013
    Posts:
    386
    Thanks Tim
     
  2. blockcipher

    blockcipher

    Joined:
    Jul 4, 2013
    Posts:
    19
    Awesome work buddy. It doesnt really suck to have to re-add motions. It takes less than a couple minutes even with settings, and prefabs are pretty necessary for runtime creation, so dont fret over that ;) Benefits outweigh the downside by light years.
     
  3. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Motion Controller v3 has been shipped off to Unity. They usually take 3-5 days for updates and I'll let you know when it's up.

    Here's what in it:
    - Support for prefabs (whew!)
    - Labels on inspectors
    - Cleaned up warnings
    - Cleaned up start animation
    - Fix for inspector index error
    - Fix for OnAnimatorStateChange error

    The next set of improvements (3/21 target):
    - Bug: Character randomly pausing when running, idle, and running again
    - Feature: Avatar doesn't rotate when standing still and moving view
    - Motion: Crouch Climb Shimmy (left and right)

    I just wanted to say thanks to those that helped test the prefab update and to everyone for understanding.


    The Motion Controller has been out for just under two weeks and the response, support, and cooperation on this thread has been incredible. Yeah, that sounds mushy. But, for a programmer like me, it's cool to see that people actually finding my tools useful. :D
     
  4. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    Well, I think you've really hit on something here that has been needed for a long time: a controller that not only works but is extendable. If you can take this thing to polish, I'll bet it becomes a standard like NGUI and DF have for GUI. You'll probably do very well. Congrats.

    BTW, I've just reviewed it on the asset store. Keep it going! A lot of folks need this.
     
    Last edited: Mar 12, 2014
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks DL!

    I'm in it for the long run and it will be cool to see this grow and get used by others.

    Thank you (and everyone) for the reviews. That helps a ton!
     
  6. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Yesss! The Shimmy! When will this be released around?
     
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    I'm targeting having it submitted to Unity on the 21st. So not this Friday, but next.

    If I can get ahead of schedule, I definitely will. :)
     
  8. Frantico

    Frantico

    Joined:
    Jun 1, 2013
    Posts:
    16
    is it fully open source? All code open to editing?
     
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Yes. No DLLs, just C# files...including the inspector/editor.

    Eventually I may move to a DLL, but not for a while.
     
  10. Frantico

    Frantico

    Joined:
    Jun 1, 2013
    Posts:
    16
    That is great, why are you planning to move to DLL. Would be so great if you kept this system totally open. Especially because it's a framework so it's a big deal for me that it will be open. If you are moving to DLLs when do you think that will happen? sorry for all the question but I am really at the fence at buying your asset but that is a big deal for me
     
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    I haven't put a whole lot of thought into it. I just figured it would be easier to deal with and it would help me avoid the "So, I modified the MotionController.cs file and now it won't work. Please help me fix it." emails. Yes, I get these. :)

    I don't have any plans (or time) to do it. It was just something in the back of my mind.
     
  12. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,723
    I hear ya - I am also a -1 on dll's. C# means I can mod - and if I do my expectation is that you wont support it :)
     
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Haha... fair enough. :)
     
  14. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    I'm surprised it's taking this long to get approved by Unity. I sent an update for four of my assets and this is the last one still waiting.

    If it's not approved by the end of the day, I'll shoot Unity an email.

    On that note, I spent the weekend cleaning up some things for the next release:
    1. Bug when you run, stop, and run again. It happened randomly
    2. Fixed the camera start position so it doesn't bounce at start
    3. Platform rotation issue.
    4. Camera support for no VSync
    5. Shimmy


    For you coders, some extra info...

    3. Platform rotation issue
    Turns out that if you have two Quaternions, you can't simply compare them like this:
    if (Quaternion1 == Quaternion2)

    Since different rotation values can equate to the same result, you have to do this instead:
    if (Quaterion.Angle(Quaternion1, Quaternion2) == 0)


    4. Camera support for 'no Vsync': Part 1
    It started because I was seeing some lag spikes in performance. I thought it was the garbage collector or something new that I did in the Motion Controller that caused it.

    Using the Profiler, I saw this and noticed that it was VSync that was spiking:


    After half a day of digging around, I finally found a post that talked about nVidia's Adaptive VSync issue. It actually caused spikes instead of smoothing out the frame rate.

    Sure enough, once I disabled the feature, the spikes went away. I notice they come back every once in a while, but I disable and re-enable vsync and it goes away. I'll have to keep digging.

    Needless to say, I was happy to see that the Motion Controller was only 0.4% of the frame budget and not causing the spikes.

    4. Camera support for 'no Vsync': Part 2
    This lead me down a far worse rabbit hole...

    When testing out the vsync issue, I noticed that the mouse didn't rotate the avatar when vsync was off. Frame rates were in the 500's, but I couldn't rotate the view.

    After a fair amount of digging, I found that the data I got back from GetAxis("Mouse X") was very different. For example, when I'd smoothly move the mouse to the right, I'd see this:

    With vsync on
    [0] x = 0.2
    [1] x = 0.2
    [2] x = 0.15
    [3] x = 0.2
    [4] x = 0.2
    [5] x = 0.2
    [6] x = 0.2

    With vsync off
    [0] x = 0.2
    [1] x = 0.0
    [2] x = 0.0
    [3] x = 0.0
    [4] x = 0.0
    [5] x = 0.0
    [6] x = 0.2

    After some Google digging (and finding very little) and tons of testing, I found that the mouse input is only valid every 0.016 ms. This tied to my desired frame rate. With vsync off, the frame rate was super high, but the mouse input was invalid (or maybe too valid) between those frames.

    So, using "Mouse.x * RotationSpeed * Time.deltaTime" to determine rotation, normally works fine. However, if the Mouse.X value is "0", rotation only occurred every 6th frame or so. Tack on the fact that on the 6th frames the Time.deltaTime is so low (0.002) and you get rotation that barely exists.

    Since the mouse movement is based on delta movement, it seem to be the only device that has this issue... that I've found.

    I then had to find a way to fill in those gaps without disrupting the input too much. I've got it working, but not a fun weekend. :(


    I hope these "gotchas" help someone else.

    Tim
     
    Last edited: Mar 17, 2014
  15. popawheelie

    popawheelie

    Joined:
    May 27, 2013
    Posts:
    23
    Wow, awesome! Great job hunting down those problems.
     
  16. URMOM1

    URMOM1

    Joined:
    Mar 6, 2014
    Posts:
    27
    And the shimmy is finally coming out? Great work, this is good news
     
  17. JohnPet

    JohnPet

    Joined:
    Aug 19, 2012
    Posts:
    81
    All is nice, but the main thing that makes it look bad is that there is no transition animations when rotating the character.. I hope you get what i mean.. That leaning animation that occurs when you rotate..
     
  18. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks everyone. I appreciate it.

    Yes on the shimmy (barring any surprises). I'll be pushing the latest version on Friday.

    BlackJonima,
    Do you mean the lean that Unity has when you're running-forward-and-rotating or an idle-rotation?

    I know Unity has a pretty intense lean for the run, but I didn't like it. Building a new motion to use it wouldn't be hard at all. It just wasn't what I wanted.
     
  19. PlayingKarrde

    PlayingKarrde

    Joined:
    Aug 19, 2013
    Posts:
    35
    Hey, a couple of quick questions as I'm considering buying this system to replace the one I built myself as it will save me a ton of time going forward.

    However, I'm curious, is it easy for me to use my current camera system with this? I built my own similar to your adventure camera that I'm pretty happy with, and don't especially want to buy another asset just to do something I've already gotten working already.

    My other question is about adding actions/states. You mention you are looking at this asset as a base from which people should be building on top of (which is exactly what I need) but how easy is it to add new states that I don't anticipate you to add in the future? Is there maybe a non-destructive way of adding these externally from your scripts so I can cleanly update your asset without having to diff the files and integrate my changes each time?

    Anyway keep up the good work. Regardless of if I take the plunge or not it's a great asset and I'm happy to see you supporting it as much as you are.
     
  20. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Latest release is out... whoo hoo. Working on the next. :)

    Hi PK,

    You can use your own camera. The motion controller just takes a Transform to get things like the camera's forward direction. Internally, it will use one of my CameraRigs if it's valid, but will ignore the calls if it's not. You shouldn't have to change any code.

    I definitely want people creating their own motions. I think it would be cool if others would share them too.

    Creating the motion just requires a class be inherited from MotionControllerMotion.cs. Then, you selecte it in the Motion Controller's inspector. You can see this in the Motion Builder's Guide: http://www.ootii.com/unity/motioncontroller/MCMotionBuilder.pdf

    The biggest sticking point so far is the Animator. Since avatars can only use one Animator, users have to copy/rebuild the sub-state-machines of new motions into their Animator. It's not horrible, but it's not ideal.

    I'm hoping to find a better way in the future,

    Hope that helps,
    Tim
     
    Last edited: Mar 18, 2014
  21. JohnPet

    JohnPet

    Joined:
    Aug 19, 2012
    Posts:
    81
    Well without it its just an animated character used in last gen games. It does not look realistic without leaning left or right when rotating. Even the latest lego games have leaning on their characters, and even mario in mario 64!
     
  22. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    For my game, I've been basing it off of Tomb Raider 2013 and she doesn't have that extreme lean of Unity's mocap. I'd say Tomb Raider is a next-gen game.

    If you like it for your style of game, that's a super easy motion you can build.
    http://www.ootii.com/unity/motioncontroller/MCMotionBuilder.pdf

    You could also look at the include scripts for examples. Walk360.cs is similar (and took less than two hours to implement and test).

    That's the beauty of the Motion Controller. We both get what we want. :)
     
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    $Thank-You-Stamp.png

    So, I'm finishing up the shimmy... But, I'm also working on something else.

    I can't tell you how much I appreciate the feedback, support, and patience. So, I figured you deserve a reward!

    Keep an eye on the thread. If you've bought the Motion Controller, I'll have something special for you in the next week...stay tuned! :D
     
  24. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    Oh man! I wonder what it is, any hints?
     
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    haha...
    Well I have to be careful not to ruin the surprise. Otherwise, what would be the... point. ;)


    (BTW, that's your first hint)
     
    Last edited: Mar 20, 2014
  26. Goldrake

    Goldrake

    Joined:
    Feb 6, 2010
    Posts:
    146
    we'll wait for the surprise :D
     
  27. eagleeyez

    eagleeyez

    Joined:
    Mar 21, 2013
    Posts:
    386
    Oh goodie goodie, a surprise? Oh, Yaeh. I feal like a child again. Just can't wait.

    EDIT: it sounds as if it could be maybe something medieval.,
     
    Last edited: Mar 20, 2014
  28. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    I don't mean to spoil it, but *cough* his youtube videos *cough*,
    It doesn't have to do with the motion controller though, a separate add on,
     
  29. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    I just put a video up of the shimmy. I still have some clean up to do in the animations, but I think it's a pretty good base.
    https://www.youtube.com/watch?v=gbr8mSzuMbc

    Some features:
    1. Will go left or right (duh)
    2. Will keep you from shimmy-ing off the wall's edge
    3. Will follow the contour of the wall (within reason)
    4. Will stop if you're blocked

    Limitations:
    1. Won't make 90-degree turns as these require custom animations


    This is an improvement of the 'ClimbCrouch' motion, not a new one. I figured that made more sense than creating a whole new motion. Although if need be, I could do that instead. Feel free to share your thoughts.
     
  30. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Awe...3...you're taking away the fun. :)

    But, he's right. 'Mount Points' is a tool I built that makes objects act like Legos. If you define mount-points on objects, you can then snap them together.

    You can do this now with the Unity hierarchy, but if you've ever tried to do this with a skeleton that has 50+ bones (like a human)... you know it's a pain in the butt. Basically, this is a tool for helping to manage object parenting. It has some advance features like:
    1. Preserving the child scale
    2. Precise snapping and auto-positioning
    3. Predefined orientations
    4. Works on any GameObject
    5. Code access to mount/un-mount objects

    I do plan on putting it on the Unity Asset store. But...

    I'm giving it to you for free!


    Since you've bought the Motion Controller and really helped support it, I wanted to say 'thanks'. I'll have more details next week, but this is what I'm thinking:
    1. If you own the Motion Controller
    2. Email me your "MotionController.cs" file by 3/28/2014
    3. I'll send you the current version of Mount Points for free


    It's not ready yet, but that's the plan. I hope you like it!
     
  31. 3

    3

    Joined:
    Sep 16, 2012
    Posts:
    387
    The shimmy looks fantastic, and this new thing is free? Tim I think you've got a new biggest fan, sorry I keep posting on here, but it does bump you up every time I do haha. I just can't resist checking the thread hourly for updates, this is absolutely awesome,
     
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks! And, yep...free...
    (well, for those who have bought the Motion Controller before next Friday).

    On that note, the latest Motion Controller has been submitted to Unity. Updates includes:

    1. Climb shimmy...as promised! :)
    2. Cleaned up editor - won't report scene as changed when it didn't
    3. Support for no VSync
    4. Fixed platform rotation issue
    5. Fixed when you run, stop, and run again. It happened randomly
    6. Fixed the camera start position so it doesn't bounce at start

    It will probably take 4 or 5 days before it's released.

     
  33. URMOM1

    URMOM1

    Joined:
    Mar 6, 2014
    Posts:
    27
    This is great news, thank you
     
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    I've put up a new thread for the 'Mount Points' asset:
    http://forum.unity3d.com/threads/235816-Mount-Points

    You'll find a link to documentation and a little demo there.

    After this post, I'll post Mount Points info there.

    I plan on submitting it to the store for $25. But, as promised, if you email me your MotionController.cs file, I'll give it to you for free. :)

    A couple of rules to keep things nice and tidy
    1. You have to email me by EOD Friday (3/2)
    2. You have to attach the MotionController.cs file

    As always, I'd love feedback.

    Thanks,
    Tim
    tim@ootii.com
     
    Last edited: Mar 23, 2014
  35. Elit3d

    Elit3d

    Joined:
    Jan 25, 2014
    Posts:
    21
    Cool! Can I have a look at the swimming? Also is this going to allow me to drag the water object to it so when I press a key in the water I swim when I let go I do something else?
     
  36. negativecap

    negativecap

    Joined:
    Jan 27, 2013
    Posts:
    99
    Uh, unless I missed something you can program your swimming motions to do whatever you like... you need to set up the blend tree, animations and scripts to function how you would like them to. Make sure your swimming animations work through root motion though, that's an important part of making it so easy.

    I've been programming some basic motions and none of this is terribly difficult, much easier with the motion controller framework than without. I'd have no clue where to start w/o this package, it's really remarkable.
     
  37. dl_studios

    dl_studios

    Joined:
    Oct 14, 2012
    Posts:
    76
    I'm way excited about the Mount Points! That addresses a couple of things I've been trying to figure out! The price is awesome too(can't beat free:)). Thanks for these awesome packages. Btw the shimmy looks great!

    I have dumped a month or two down the drain trying to come up with a great controller. It's hard stuff. Thanks for saving me from going mad by making these.:)
     
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks DL. :)

    I'm ready with Mount Points. Shoot me an email with your MotionController.cs file and I'll send it to you.



    Elit3d Negativecap:

    Negativecap is exactly right. The goal with the Motion Controller is that you'd build the motions you need for your game. Swimming isn't one I need so I don't expect to get to it any time soon (if ever). I do plan on sharing Motions I build, but I have to prioritize my game first.

    (Thanks for the great compliment Negativecap)
     
  39. sleepingwalrus

    sleepingwalrus

    Joined:
    Jan 6, 2013
    Posts:
    9
    Playing around with your demo, I jump on an rotating platform with a pillar then jump up and hang from the ledge of the pillar. From this point if I shift the control stick (I'm using XBox 360 controller) left or right the character will shift left/right and the following happens about 50% of the time. The same behavior occurs when using the Adventure Camera.

    $motion controller ledge hang.gif
     
  40. JohnPet

    JohnPet

    Joined:
    Aug 19, 2012
    Posts:
    81
    But still a leaning takes animation to the top..its really important..i insist on adding this, or at least make it a boolean so that people can choose between on or off..
     
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey SleepingWalrus,

    (I love the user names...hahaha)

    I just got it to happen too. I think I know what's going on and it should be limited to the rotating pillars.

    I thought I was pretty thorough in my tests, but I obviously didn't shimmy on these pillars enough. :(

    The package is already at Unity for submission, but I'll have a fix for it right away. This way when you do get the update from Unity, you can get the fix from me and not have to wait another week.

    Sorry about that,
    Tim




    Hey BlackJonima,

    Feel free to add the new motion if you like it. Just shoot me an email if you get stuck and I'll be happy to help you.
     
  42. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Hi Tryz,

    email send.


    sefou
     
  43. JohnPet

    JohnPet

    Joined:
    Aug 19, 2012
    Posts:
    81
    Tryz,

    Alright.. Its a small bit but already implemented on the beta sample assets. I will find it..
     
  44. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Just a friendly reminder...

    Since you've bought the Motion Controller and really helped support it, I wanted to say 'thanks' by giving you the Mount Points system for free. I've already received about 12 emails... if you haven't sent the request already, don't forget! :)

    More info on Mount Points here:
    http://forum.unity3d.com/threads/235816-Mount-Points


    1. If you own the Motion Controller
    2. Email me your "MotionController.cs" file by EOD 3/28/2014
    3. I'll send you the current version of Mount Points for free


    For those of you that have used it, please feel free to email the good, bad, and ugly. My goal is to create top-quality tools.
     
  45. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    I've fixed the bug SleepingWalrus pointed out when you're shimming on a rotating object. Turns out I wasn't updating the contact point during the shimmy.

    I've updated the web-demo: http://www.ootii.com/Unity/MotionController/Web.html
    Note: you may have to clear your cache

    When Unity releases the latest update, you'll see this issue when you shimmy on rotating objects. There's three ways I can get the fix to you:

    1. You can wait for the next update.

    2. You can make the code changes yourself. It's 1 line to delete and 1 line to add.

    3. You can email me your MotionController.cs file and I'll email you a file with the changes.

    Totally up to you. Again, I apologize for this.



    For you brave coders, you'll be modifying the Scripts\ootii\MotionController\AI\Controllers\Motions\ClimbCrouch.cs file:

    --------------------

    Remove lines 832 833:

    // Clear the avatar contact position so it can be reset
    mAvatarContactPosition = Vector3.zero;

    --------------------

    Between line 561 and 562 add:

    // If we're rotating, we need to adjust the contact position. This way
    // we rotate correctly with the platform
    mAvatarContactPosition = Quaternion.Inverse(mClimbable.transform.rotation) * (mController.transform.position - mClimbable.transform.position);

    --------------------
     
    Last edited: Mar 26, 2014
  46. Goldrake

    Goldrake

    Joined:
    Feb 6, 2010
    Posts:
    146
    Well done Tim! :)
     
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Thanks Goldrake! :)

    We'll, it's been over a week since I submitted the package to Unity. I'm assuming they are closed for the weekend, but I'll email them and ask why it's taking so long.

    They must be swamped. I'll let you know when it's up.
     
  48. blockcipher

    blockcipher

    Joined:
    Jul 4, 2013
    Posts:
    19
    Son of a bitch ;) I missed the 28th!
     
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    Hey blockcipher,

    I'm pretty sure you're Matt and we've shared some emails. If so, it should be in your inbox.

    If not, we'll someone is going to wake up to a free surprise. :)




    Side note for everyone. I follow a couple of other threads and it sounds like Unity is being slow on releasing a lot of assets. I'll share once I know more.

    [edit]
    If it's not released by tomorrow afternoon, I'll provide a link so you can download the latest version from Dropbox. Obviously I won't post it here, but I'd be happy to email it to you if you send me your MotionController.cs file.
     
    Last edited: Mar 30, 2014
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,382
    You shouldn't have to wait over 10 days for Unity to release an update. So, I'm releasing it for them.

    To get the latest version, email me your current MotionController.cs file and I'll send you the latest Motion Controller. This includes:

    1. Climb shimmy (with the fix)
    2. Cleaned up editor - won't report scene as changed when it didn't
    3. Support for no VSync
    4. Jump now correctly respects Momentum Enabled and Control Enabled
    5. EdgeSlip now has property to determine the foot gap before slipping
    6. Fixed platform rotation issue
    7. Fixed when you run, stop, and run again. It happened randomly
    8. Fixed the camera start position so it doesn't bounce at start

    To import it, select 'Assets | Import Package | Custom Package...' from the menu.


    If you're starting a new project, don't forget to setup the Unity Input Manager per the instructions.


    I did test with both a new project and importing it into an existing project that had an older version of the Motion Controller and everything was fine. However, always back up your whole project before updating like this.


    Thanks,
    Tim
     
unityunity