Search Unity

Motion Controller

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

  1. Tryz

    Tryz

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

    I don't think that we can take someone's mocap, tweak it, and redistribute it. :(

    What you can do is use the mocap as a reference and create your own animations from scratch... those are yours. I know I do that sometimes. If someone has a really good looking animation (ie Tomb Raider), I study it and then key-frame it. Like you said, it's painful... but less painful than a lawsuit! ;)
     
    ISH_the_Creator likes this.
  2. ISH_the_Creator

    ISH_the_Creator

    Joined:
    May 8, 2013
    Posts:
    165
    OH snap your right, I just checked. Since I was never intending to make an asset but make a game this does apply
    to asset developers, my bad.

    So I will have to animate motions rather than use mocap refinement lol np I can do that.

    thx.
     
    Tryz likes this.
  3. ISH_the_Creator

    ISH_the_Creator

    Joined:
    May 8, 2013
    Posts:
    165
    I forgot to mention this http://ipisoft.com/

    Its very cost affective. hiring an animator might be the same depending on number of animations needed.

    if its just locomotion then not.

    But its always good in the long run software to have.

    4 low cost ps3 cameras might do the job having 2 deep scanning camera's can go upwards of 250$ each.

    hope that helps.
     
  4. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Very cool. I'll look into it.

    Any thoughts on the quality and how much clean-up you need to do? Since it's not my primary skill, I'm thinking it may be better (and cheaper in the long run) to pay a professional.

    I saw that the average animator makes $53,000 (US)... that's about $25 an hour. That doesn't seem bad for hiring a professional animator.
     
  5. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Especially if you happen to do mocap and use your animator to just clean up the animations, if your wanting to go with that AAA look, that would be the direction that I would go in...
     
    Tryz likes this.
  6. ISH_the_Creator

    ISH_the_Creator

    Joined:
    May 8, 2013
    Posts:
    165
    most clean up I had to do is floor contacts but if the lighting is right, distance, scans its easy. Then an animator can clean very little. Other solutions with Ikinema for clean up alot better than motionbuilder and cheaper or free if you have under 20 animations I think. AAA animations are very had when just key framed. You can also buy royalty free AAA animations I think mixamo is but it may not allow for products only games and movies.

    But this guy may have what you need he got me on to ipisoft 3 or 4 years ago

    http://www.truebones.com/

    Email:
    peaklevels@yahoo.com

    Phone: 1-248-390-8442 Its not alot of money and thats the goal.

    Sad to say but :( we live in a mocap world.

    Still think facerobot is still best facial key framing solution ever though lol (Got Autodeathed)
     
    Last edited: Aug 28, 2015
    Tryz likes this.
  7. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
  8. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    I would be cautious of using Truebones. IIRC, the vendor's animations were removed from the asset store and he was banned from the Unity forums due to unauthorized use and sale of other animators' work. That's just what I've read here, so I can't be certain it's true, but you might want to steer clear to avoid any potential copyright issues.
     
  9. Phenomonaut

    Phenomonaut

    Joined:
    Sep 30, 2012
    Posts:
    61
    Just getting back to this. So I'm having trouble understanding what to do here. When you say to do this in the Jump motion, you mean the Jump.cs script? I'm not finding an UpdateRootMotion function there. If I'm supposed to add this function, where/when is it called?
     
  10. ISH_the_Creator

    ISH_the_Creator

    Joined:
    May 8, 2013
    Posts:
    165
    Didn't know that. Sorry Mr Ootii only trying to help
     
    Tryz likes this.
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    All good! I appreciate it. :)
     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I had to go back to the original post. Just to make sure I'm answering the right question... As you are replacing the jump animation, your character has forward motion in the animation. This seems to be root-motion that is part of the new jump animation you want to use and you want to get rid of that forward motion.

    Assuming that's right, you have a couple of options:

    1. Remove it from the animation itself.

    2. In Unity's animation inspector, bake the movement into the pose (Root Transform Position (XZ)).

    3. Clear out the root-motion in the MC motion.

    The first two are probably the preferred method, but as a coder I find it easier to do it in the third.

    Unfortunately, I've been jumping between multiple projects and I gave you the wrong function. In this version of the MC, it's "CleanRootMotion" (at line 911 of Jump.cs).

    That code is already there, so I'm wondering if the movement you're seeing is something other than root motion. Please check just to make sure. If the code is there, try #2 above. If that doesn't work, I can look at your animation if you want. Just send it to tim@ootii.com.
     
  13. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Sorry if this has been discussed before... but has anyone tried motion controller with UMA 2?
     
  14. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    UMA will work with it, of course, because it is just a controller and animations. Is there a specific aspect of using UMA and Motion Controller you're curious about?

    (BTW, just look at the previous page of this thread for some UMA + MC discussion.)
     
    Tryz likes this.
  15. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Thanks, and no I was just wondering since there was some discussion about it on another controller thread and it seem there where some integration issues, and I was just wondering if you have a custom character creator for your player using UMA2 and then go into the game with your custom player if there where any pitfalls?
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    tldr: There are no true pitfalls I can think of. But while I've fiddled with it here and there, I haven't really implemented UMA for my game yet, and I could be overlooking something.

    Unity has a restriction that you cannot assign an avatar at runtime. (There is an experimental feature for runtime avatars, IIRC, but it doesn't work yet.) Because of this, you cannot construct an UMA character completely from scratch, component by component, at runtime. The avatar assignment must happen in the editor.

    I believe UMA gets around this restriction by keeping a copy of each Race (male and female) in a folder, and it brings this model into the scene and then modifies it. So every male UMA that is generated is based off the male prefab, and every female off the female prefab.

    This means that if you have some custom components that should be in place for all of your UMAs, you can add them to your Race prefabs and get them brought into the scene at generation time. An example would be to add the MC component, under the assumption that all of your characters will be using it for animation.

    However, typically you'd need different components and settings for players and NPCs. Thinking of the Motion Controller specifically, NPCs are going to run off of AI, and players are going to have a camera on them and run off input. So some features that are different could be assigned or changed programmatically after generation.

    For easier prototyping, I guess what you could do is create a Player prefab that has both male and female Race models attached, and turn off by hand whichever model you don't need. This prefab could have the MC, character controller, and camera attached, and eventually maybe a script for a GUI that allows choosing male/female, modifying DNA, slots, and overlays, and saving off recipes.

    Then you could make one or more enemy prefabs to represent the different types of enemies you are developing. Like, maybe one goblin has a crossbow attack component while the other has dual knives. These UMA prefabs could be set to generate models according to random DNA (within your selected constraints for the enemy type), so that upon loading they will generate in the scene with individual looks for that specific type.

    So ... I suppose the way to begin is by setting up your player in the editor by taking the male or female UMA Race prefab into the hierarchy, and hooking up the MC, character controller, and camera, and saving it off as a Player prefab. Then set about figuring out how to change the slots, etc., on it, or go in whatever direction you wish to go after that.

    BTW, if I completely missed the sense of your question, let me know. :)
     
    Licarell likes this.
  17. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    No your not far off, I'm a modeler/rigger/animator and I plan to create my own base mesh with a generic cage that will be for both male/female with a super rig, basically using the base rig as my template. I plan on mimicking the blender rig and make a CAT equivalent for 3ds max matching scale and parent/child relationships of both base and adj bones, sounds daunting... I know... but I feel confident I can match it up if I have the scale correct when I bring in the fbx. I will use morphing to switch the character gender (in game) then once I create prefabs I can use the adjustment bones to customize the character for the in game customization, I guess once I have the motion controller and ragdoll and IK setup using a (in game) wizard to customize the character prefab then save it out to the game should work right?
     
  18. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    If I was a professional who had done such things before, I would say, "Sure! Sounds great!" But since I'm not very experienced in any of this, I'd say you should ask the pros on the UMA thread. :)

    I think the key in development is to set up character prefabs that have all the components you need, then change the character art once you have it loaded.
     
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    @Licarell - Let me address a confusing aspect of UMA1 -> UMA2. A change with UMA2 is that the Race prefabs are no longer being used, though they are still in the kit. I don't know how they get around the avatar assignment problem now (magic?), but I'm thinking the Race prefabs can still be used as I outlined above.
     
  20. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Don't want to go too off-topic here, but the race prefabs aren't used at all in UMA2, if you want to add a controller you can do it in the character completed callback or by making a special slot that attaches it as the character is being built. The avatar is built at runtime, the limitation that hopeful is referring to is actually about modifying the avatar assigned to an animator, which doesn't work; that's why the animator needs to be recreated when the skeleton changes.
     
    hopeful likes this.
  21. Chronoson

    Chronoson

    Joined:
    Feb 23, 2014
    Posts:
    2
    Having a GameObject with a scale of (1, 1, 1) seem to be a prerequisite when using MotionController. I notice that in the MotionController.cs script, the values of the CharacterController (radius, height) is used with transform.position and transform.rotation without first be world scaled.

    I found this will i investigate a bug with my character falling for no reason while walking...
     
  22. Tryz

    Tryz

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

    I just opened a new project and scaled the character in the demo to x2 (2,2,2) and I'm not having an obvious issue. But, you could have run into something deeper that I need to fix. It's fair to say my focus has been on characters with no scaling, but that was just more out of habit and not an intentional prerequisite.

    I'll keep testing. Is there a specific scale you're having problems with? That may help me see exactly what you're seeing.

    In thinking about this, there would definitely be an issue with climbing as there are sized based settings for that. So, you'd have to adjust things like HandGrabOffset to fit your specific character's size.

    With the character falling for no reason, I've usually found that to be an issue with "Skin Width" being too large. Having that set to something like 0.01 helps.
     
    Last edited: Sep 14, 2015
  23. Chronoson

    Chronoson

    Joined:
    Feb 23, 2014
    Posts:
    2
    Thanks for your reply.

    Actually, the character is scaled to (84, 84, 84) and the rendering bounds indicate an height of 14.
    The original character from the demo doesn't seem to have this issue. I try to change the "Skin Width" but it didn't resolve the issue.

    I modify the MotionController.cs script with the following code to calculate the mActorHeight, mActorCenter, mActorRadius and mActorToGroundDistance and it actually resolve the issue :

    Vector3 center = mCharController.center;
    center.x *= transform.lossyScale.x;
    center.y *= transform.lossyScale.y;
    center.z *= transform.lossyScale.z;
    float height = mCharController.height * transform.lossyScale.y;
    float radius = mCharController.radius * Mathf.Max(transform.lossyScale.x, transform.lossyScale.z);

    // Calculate the distance to the ground as we may have a gap from our collider to the ground
    mActorHeight = (height / 2f) + center.y;
    mActorCenter = new Vector3(center.x, mActorHeight / 2f, center.z);
    mActorToGroundDistance = mActorCenter.y;
    mActorRadius = radius;
    mMaxStepHeight = mCharController.stepOffset;
    mMaxSlopeAngle = mCharController.slopeLimit;

    But anyway, we decide with the artist to reimport the models to respect a scale of 1 unit = 1 meter.

    Btw, i really like your system. Already add my own motions for random idle, moving crouch and when the character die. I planned to add one for climbing ladder.
     
    Tryz likes this.
  24. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks for that info. I'll make sure to implement it going forward.

    I'm super excited to hear you're implementing your own motions. I think that's one of the powers of the system and something I hope others will do too. :)
     
  25. Dark-Muppeteer

    Dark-Muppeteer

    Joined:
    Feb 24, 2013
    Posts:
    26
    Hi, any new updates on the AC and MCv2?
     
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The AC is pretty much done. A couple of people are doing some final tests and things are looking good. Besides bugs that pop-up, all that's left is cleaning up the editor and doing the materials for the Asset Store.

    MC v2 is about 50% done. I'm adding key motions now. I'm hoping to have it out for testing in 2 or 3 weeks.

    If you (or anyone) is interested in helping test the AC before it's officially released, just shoot me an email with your MC order number and I'll reply with a zip file.

    A special thanks to @hopeful ! He's been a massive help with the testing. :D
     
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Aw, shucks! :)

    I really do like the way AC is shaping up, BTW. I think it's going to be a big hit.
     
    Tryz likes this.
  28. solideuk

    solideuk

    Joined:
    Nov 29, 2014
    Posts:
    41
    Hi,

    My character is running extremely slowly, The model supplied with the demo runs fine. However when I use my own model it is extremely slow. I have increased 'Max Speed' which did not work.

    I had to increase the scale of my model, perhaps that's the reason?

    Any suggestions on how I can increase the running speed for my character?

    Many thanks
     
  29. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
  30. Tryz

    Tryz

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

    The speed actually comes from the root-motion of the animations. You mentioned that you changed the scale. That could be it, but root-motion typically scales with the model.

    Unity typically likes "one unit equals one meter". So, if you scale your character by 10, gravity would be 1 / 10th the normal value.

    Are you able to test your model at normal scale (just to see the speed)? How much of a scale change did you make?

    If it turns out that the root-motion isn't multiplying with the scale changes, you can update the motions in the "CleanRootMotion" function. Simply multiply the values with the scale. I'm stuck for a couple of days, but once I get free, I'll see if I can test it too.
     
    Last edited: Oct 3, 2015
    solideuk likes this.
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Very cool stuff. I love the soldier falling down and getting back up. Nice!
     
    hopeful likes this.
  32. solideuk

    solideuk

    Joined:
    Nov 29, 2014
    Posts:
    41
    Thanks for your prompt response.

    i was able to identify the problem, as you mentioned the root-motion multiplies based on scale, as the character model was scaled and then parented to the the gameobject with the script etc, I simply moved the script over to the actual model.

    Thanks again
     
    Tryz likes this.
  33. solideuk

    solideuk

    Joined:
    Nov 29, 2014
    Posts:
    41
    Also, how do I control how fast the character runs, which option can I change to slow the characters running speed?
     
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    All speeds come from the animations themselves.

    The best way to do this is in the Animator. Select the node containing the animation and change the speed from "1" to something you prefer.

    You'll find that node either in "SimpleForward-SM" or "AdventureForward-SM" depending on which forward motion you're using.

    If that doesn't make sense, shoot an email to tim@ootii.com and I can explain in more detail. :)
     
    solideuk likes this.
  35. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Tomorrow I'm going to be submitting the Actor Controller to the Asset Store. I thought you guys might like a preview...





    I'm about 1/2 done with MC v2. Just as a reminder, you'll get the AC for free as the new MC will be based on it instead of the old Unity character controller. :D
     
  36. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    I'm glad to see the first of your new toys is finally (almost) ready to play with. After seeing the introductory videos, it may offer solutions to a few problems I've recently encountered (OK, created for myself) such as non-uniform gravity direction, and moving platforms that have non-uniform speed, direction, and rotation. It also may help with old problems, like swimming, crawling, and sliding (prone). I have a number of scenes I'm looking forward to testing AC out in, to see how it fares against my existing (somewhat flawed) solutions. I'll let you know how it goes. Now bring on MC2! :)
     
  37. adiohea

    adiohea

    Joined:
    Mar 10, 2014
    Posts:
    16
    Looking good!
     
    Tryz likes this.
  38. Dark-Muppeteer

    Dark-Muppeteer

    Joined:
    Feb 24, 2013
    Posts:
    26
    Looking awesome, can't wait to try it out hooked up with the MC.
     
    Tryz likes this.
  39. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Dark-Muppeteer likes this.
  40. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Everything seem to be shaping up, Tim.

    What's the ETA on MC2, I'm dying to run some tests when it hits a good point.
     
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks! Yeah, it's taken way longer than I expected. Of course having the kids home over the summer tends to tank my productivity. :eek:

    MC v2 should be out mid November. I've ported over the existing motions and have it running smoothly with the AC. Now I'm adding new motions (ladder, tight-rope, etc.) and fixing bugs I find. Nothing like eating your own dog food.
     
  42. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Swimming (above and below water) and diving, too? Maybe? Pretty please? :p
     
    FargleBargle likes this.
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    By biggest challenge with swimming is getting animations. If you can get me some good animations (that I can legally distribute), I will make the motions for them. :)
     
  44. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    The only ones I have are the Mixamo ones that were made free for a limited time (not sure if they are still avail or not).. But you wouldn't be able to include them in the package.. :( Not sure if they have any swimming in the huge mocap package or not.. I think those are supposedly based on open source animations.. I'll look around..
     
    Tryz likes this.
  45. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I don't think that this will surprise anyone, but I figured I better say it just in case...

    Motion Controller v2 will NOT be compatible with Motion Controller v1.

    With Unity 5 and the Actor Controller, I'm really changing the guts. Logically, everything works the same (motion layers, motions, etc). The implementation and creating motions is very similar too. However, there's enough changes that we shouldn't expect to just drop v2 on v1. Instead, we'll need to delete v1 and import v2.
     
  46. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Speak with Dogzer, he has some on this model with a small swimming system, he may hook you up for a free copy of MC2.

    I added it to my wishlist, just for the anims.lol
     
    Tryz likes this.
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    It's a bit rough, but things are coming together...

     
  48. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Excellent vid man. Skype me if ya need, as I'm always up for beta testing.
     
    Tryz likes this.
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Thanks! Hopefully in the next week or so I'll be ready for testers. :D
     
    kurotatsu and hopeful like this.
  50. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    Are new motions easier to add, than the original?

    I was looking at your motions inspector in the video, was wondering if you plan to add a sprint as well for the basic movement, and maybe a long jump(while sprinting) that inherits the sprints velocity, and has say 1.25 to 1.5 times the force applied to height/verticle motion.

    And in sticking with trying to keep this to the locomotion criteria we've discussed in the past, I do want to put this out there to maybe hear some feedback from the other users, and maybe get some discussion rolling again, as we should all be pretty excited about this release.;)

    Thanks Tim.

    Edit:

    Also wanted to ask if you jump from wall walking, do you re-enter natural gravity, and fall back to the normal ground? as this would be my preference anyway. or at least a toggle in the inspector to make it so.