Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Motion Controller

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

  1. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    I buy games like I buy books, once I find one I like I buy the entire series, and have it ready for when I find time(Which is never.).lol
     
    TeagansDad and Tryz like this.
  2. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    A common use case for this would be any creature that uses natural weapons (claws, bite, tail whip, etc). For human fists, I'd probably just equip a weapon that has no visible mesh on it, unless the game features only unarmed combat.

    I haven't tried any of this, but I believe all you'd have to do is:

    For #1, I'm doing this in the IWeaponCore implementation that is used on the fixed weapon (a claw in my case). The model I'm setting this up on doesn't have different "combat mode" movement and idle animations, so for #2 I simply removed all of the checks against EnumControllerStance.COMBAT_MELEE_SWORD_SHIELD in the motions I created for that model.
     
    Tryz and kurotatsu like this.
  3. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    I was big on boxes always had them and wanted them for PC, Xbox 360 and PS3....Now with XB1, I have over 175 games, and I have one box...and I hate it.... So I hear you on that funny how your mind set changes...No room anymore... Plus I don't have to worry about a disc breaking or not working, which happens with that one game rarely works... Plus you can share games with digital ..
     
    Tryz likes this.
  4. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    But how can you argue against this:



    Or this (not the game, but the extras in the box):



    Or this:



    (These aren't my pictures, but I do have all of these in my collection)

    EDIT: Origin Systems from 1985 until about 1994 was freaking amazing. They stood head and shoulders above virtually every other PC game studio at the time.
     
    Last edited: Feb 8, 2017
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    The Wing Commander series is one of my all time favorites... and I loved the blue prints.
     
    christougher, Hans, antoripa and 2 others like this.
  6. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    Yup, I have that stuff, and much more, but my house isn't that big anymore lol... Having years of consoles, games, and much more, hard to keep up anymore... was hard to do , but just cant anymore, my wife loves gaming, but she was like ok enough.... I have every console ever made, atleast 3k-4k games. PC, Console, hand held.. and 4 computers, over 8 phones and tablets.... Should see my basement, I had to make shelving for all the old stuff lol....
     
  7. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Hello,

    Did you dropped the module for Behavior Designer?

    http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=144

    Just the document page is found on the above but no sample can be found on the 'sample' page even with downloading.

    Edit:
    Found both of extension module for Node Canvas and Behavior Designer on the Vault page.

    http://www.ootii.com/UnityMotionVault.cshtml

    BTW, is there any reason you choose Node Canvas instead of Behavior Designer? I mean Behavior Designer's is written by someone other than you. Yeah, even the plugin which were on opsive site were dropped now.

    Just my curiosity, I have both of asset but much prefer Behavior Designer on my side. :)

    ps. Just bought Sword Shield motion pack from the assetstore. Great job you did! But I had small problem when run the demo scene. When I ran the demo scene, moving with 'WASD' is ok but no other keys were not binding, so I could not target the enemy with 't' and even attack with left mouse button. I should bind myself that keys to run demo scene.
     
    Last edited: Feb 10, 2017
    kurotatsu and Tryz like this.
  8. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    No. That's Opsive's site. He has control over what's there.

    Glad you found it on the Vault:
    http://www.ootii.com/UnityMotionVault.cshtml

    The Node Canvas version of actions and conditions are newer and you could port them over, but the BD version works just fine. I just prefer NC. I used BD years ago and liked it fine, but NC felt cleaner to me. I think it's just personal choice.

    I'll check out the SSMP. Did you setup the pack with the inputs? It should have added everything.

    This is what the input should be:
     
    TeagansDad and kurotatsu like this.
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I thought I'd share some new spells with you today:



    Next up... Levitation and Poisonous Cloud
     
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    Ahhhhhh! I'm most enthusiastic about this add-on. It's looking like the best thing ever. :D
     
    Hans and Tryz like this.
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    Brilliant. This is way more than I expected. I was only expecting simply offensive spells, but this is so much more than that. Thanks for making this pack.
     
    Hans, Tryz and TeagansDad like this.
  12. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    At a certain point, @Tryz may need to consider branding this as "ootii RPG Framework" rather than just a Motion Pack. ;)

    Both this and the Sword & Shield pack really push the scope of what constitutes a "motion pack." Not that I'm complaining, mind you. But SSMP is pretty much a full melee combat system, which isn't reflected in the title and some folks looking at the various options for third person character controllers might not realize that MC also has a melee combat framework in place. The Spellcasting Motion Pack is also a complete spellcasting system, right down to providing the tools to build your own spells.

    Which is awesome, of course. Motion Controller + Archery + Sword & Shield already blows the doors off the two biggest competitors, IMO.
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    That brings up another thing that just came to mind. It could be beneficial to release a new asset that packages all the MC essentials into one bundle at a small discount.
     
    Hans, Tryz and TeagansDad like this.
  14. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    Yeah, I think that Archery + Sword & Shield + Spellcasting would be a very popular combo. They'll all share some common framework pieces that allow them to work together (the Combat Message that is passed back and forth, interaction with the AttributeSource, etc.).
     
    Tryz likes this.
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    Well, I was actually thinking more like Motion Controller, Camera Controller, Archery, Sword/Shield, and Spellcasting as a bundle and it would be called something like you were suggesting. Maybe 3rd Person RPG Framework or something like that.
     
    Malbers, TeagansDad and Tryz like this.
  16. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I think you and @magique are probably right.

    I've always tried to keep things modular, but there's enough pieces that really do fit together that it makes sense to have a larger package. I think updates get a bit more tedious, but it's manageable.

    I certainly don't mind a discount on it too.

    Once SCMP is out, I'll put some brain power to it. :)
     
    antoripa and magique like this.
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Right. Me too.
     
    TeagansDad and magique like this.
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    I didn't necessarily mean those three MPs exusively. ;) People who buy one of them are quite likely to want the other two as well, which is why I mentioned them specifically.

    Bundling them with MC and CC would be a good choice.
     
    Tryz and magique like this.
  19. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    great game, I been testing more, comes out on the 14th, I plan on making some animations like the ones in For Honor .. combat, blocking, and adding to them, and adding my own flair on them of course.. I'm not into copying .
     
    kurotatsu likes this.
  20. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I was just playing this today. I like that the combat was a bit more in-depth.

    The knight model and animations are great too.
     
    recon0303 likes this.
  21. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    770
    Hey folks. Now that I've managed to get some of my game mechanics working fairly smoothly, I thought I'd share a WIP demo of Motion Controller, Camera Controller, and the Sword & Shield pack, used with Kurotatsu's AI Warrior. Besides the S&S pack's abilities, and AIW's combat, healing, and gathering features, it also demonstrates a few other tricks, like using ziplines, teleporters, zero-g elevators, and vehicles, as well as asynchronous level switching (via a "space warp"). While this is just a tech demo, some of these features and assets could make it into my game. ;)

     
  22. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Very very cool. I love seeing all the different assets come together.

    It's one thing to see individual asset demos, but when you see them come together that's when you really get the sense of a game.

    Nice job!

    BTW, @kurotatsu has a great asset with his AI Warrior. I've been on the sidelines watching it a bit, but it really is pretty cool!
     
    TeagansDad and kurotatsu like this.
  23. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,628
    kurotatsu likes this.
  24. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    @Tryz so I've got several of your assets and just thought I'd ask to pick your brain. I'm looking at my next project having multiple different mini game modes. Think the old DOS game Sword of the Samurai.... 1v1 duels, and 1 vs 30ish missions. Anywho, the fighting in say the sword and shield pack involves trading blows and sometimes having an exaggerated, delayed response to being slashed down the middle with a claymore, whereas I'm looking at more of a responsive 1 on 1 slashing/parrying a la OG Prince of Persia. Any thoughts on how best to achieve this with your framework?
     
    kurotatsu likes this.
  25. reocwolf

    reocwolf

    Joined:
    Aug 1, 2013
    Posts:
    182
    Haha when I see the transportation spell all i can think of is the ff15 warping.
     
    Tryz likes this.
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    It's been years (meaning almost 10) since I've played any Prince of Persia game. So, I'm sort of guessing at what you're talking about.

    When you talk about responsiveness I think what you're meaning is that you can't button mash and attack non-stop. Here's an example of what I think you mean (at 2:06):


    With SSMP, it is closer to 'trading blows', but you can swing at the same time. However, the first one to hit interrupts the other and causing damage triggers the damage animation. All that means the combat is slower than what we see in the video.

    With the chaining ability, you can start follow on swings before ending the first swing, but you do have to time that just right.

    Some things you can do to get more of an arcade kind of feel:
    1. Extend the animation events on the swing animations that define when chaining is valid
    2. Shorten the transition time when recovering from a swing (this way you can swing again faster).
    3. Increase the animation speed of the swing animations and damaged animations
    4. Remove the hit response motions (PSS-Damaged)
    5. Create a custom Combatant that modifies the OnPreAttack, OnAttacked, OnPostAttack functions.

    One other thing I've been thinking about is queuing attacks. Basically, the idea being you can press the attack button before you've completely recovered. This may help ease the timing restriction.

    Let me know if I'm understanding what you're asking. Hopefully, I am. :)

    [EDIT]
    I've been playing For Honor and they have more of a 'trading blows' approach... albeit MUCH faster, smoother, and featured. As SSMP evolves, I'd like to have it closer to that... without the million dollar budget. :)

    Of course, that doesn't mean there can't be an 'arcade' approach (like the video).
     
    Last edited: Feb 11, 2017
  27. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Hello @Tryz - I have a quick question about idle animation in Motion Controller. My character doesn't seem to be moving at idle, even though the Idle motion is enabled. I am using the Adventure Style for motion, and I'm using an MCS character. Do you have any hints about how to get the character to move at idle?
     
  28. notbilldavis

    notbilldavis

    Joined:
    Feb 25, 2016
    Posts:
    7
    So I'm trying to implement this now and having some trouble. I'm setting the stance to 11 but my character never actually enters the stance. Perhaps something is setting it back to idle? If I keep the equip sword motions and trigger that then the character does strangely equip the already held sword and go into the stance but I can't seem to start there in the first place. Any ideas? Ideally I wouldn't need any of the normal idle and walk motions since I'll always be in combat mode and just use those ones.

    Thanks!
     
  29. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Do you mean, that he's idle and when you press 'W' he won't walk forward?

    If that's the case, make sure you have a WalkRunX motion in your motion list. Also, make sure you don't have "Use Transform" checked in the Actor Controller.
     
  30. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Hello, again.

    @Tryz, thanks your reply for my previous question even with such a lightning speed. :)

    I've been watching video clips of Motion Controller on your yutube page in this weekend.

    Is that available to get the Node Canvas's behavior tree which is used for the following 'Motion Controller & NPCs #2 - Simple Combat' clip?



    Thanks.
     
  31. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Sorry, I was not very clear. I meant to say that when I'm not moving the character, the character appears to be completely still. How to I add an idle animation in order to make the character more life like (e.g. shifting around a bit and looking around).
     
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    @notbilldavis Sorry it took so long, but I was trying to figure out why the stance wasn't staying. There's two things going on. First is a race between the AC's Start() function and us setting the stance. Second, the stance needs to be initialized on all instances of the AC's state (which is an array).

    I went ahead and gave this a try. Here's the steps I did:
    1. Removed all motions from the character except PSS motions
    2. Added a Sword_01 instance to the scene and put it in the characters hand
    3. In the Basic Inventory's "RIGHT_HAND" slot, I typed "Sword_01" in the Item ID
    4. Added this component to the character and set the sword in the PrimaryWeapon property.

    Code (CSharp):
    1. using UnityEngine;
    2. using com.ootii.Actors;
    3. using com.ootii.Actors.AnimationControllers;
    4. using com.ootii.Actors.LifeCores;
    5. using com.ootii.Actors.Combat;
    6.  
    7. public class SwordAlways : MonoBehaviour
    8. {
    9.     public WeaponCore PrimaryWeapon = null;
    10.  
    11.     private bool mIsInitialized = false;
    12.  
    13.     // Use this for initialization
    14.     void Start()
    15.     {
    16.         Combatant lCombatant = gameObject.GetComponent<Combatant>();
    17.         if (lCombatant != null) { lCombatant.PrimaryWeapon = PrimaryWeapon; }  
    18.     }
    19.  
    20.     // Update is called once per frame
    21.     void Update()
    22.     {
    23.         if (!mIsInitialized)
    24.         {
    25.             mIsInitialized = true;
    26.  
    27.             ActorController lActorController = gameObject.GetComponent<ActorController>();
    28.             for (int i = 0; i < lActorController.States.Length; i++)
    29.             {
    30.                 lActorController.States[i].Stance = EnumControllerStance.COMBAT_MELEE_SWORD_SHIELD;
    31.             }
    32.         }
    33.     }
    34. }
    With that it worked.

    You can see in the code, that I wait for the Update() function to initialize the state. That handles the first issue. Then, I set the stance on all the state values. This way it won't be reset.

    Give that a try and let me know how it goes.
     
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Ahhh....

    I talk about that exact thing in the User's Guide FAQ:
    http://www.ootii.com/Unity/MotionController/MC2Guide.pdf

    Check out page 34. That talks about adding your own alternate idle animations.

    Basically, there's a couple of steps:
    1. Add your alternate idle animations to the Idle-SM sub-state machine in Mecanim.
    2. Copy the Idle.cs file and re-name it so I don't overwrite your changes.
    3. Add the new idle motion to your MC character's list.
    4. Auto-generate the code and replace/paste that at the end of your new motion
    5. Add code to your new motion to go into your new animations based on time, etc.

    The last two are probably the biggest unknow for you. They aren't hard... you just have learn what they mean. Check out the Motion Builder's Guide: http://www.ootii.com/unity/motioncontroller/MCMotionBuilder.pdf

    Auto-generating code (page 19)

    Adding code to your new motion would go in the Update() function. That's where you'll call the SetAnimatorMotionPhase() that I talk about on page 34 of the User's Guide.

    You just have to decide when you want the alternate idles to trigger... randomly, sequentially, etc.
     
    hoodoo likes this.
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    That BT is part of the character. So, I can't just share the file.

    However, NC can export it to JSON. So, try this:
    https://www.dropbox.com/s/dwgzfezw3llktos/Combat.BT?dl=0

    You should be able to do an import into an NC BT.
     
  35. notbilldavis

    notbilldavis

    Joined:
    Feb 25, 2016
    Posts:
    7
    @Tryz Thank you, worked perfectly!
     
    Tryz likes this.
  36. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Hi Tim, I've gone through these steps but having trouble making it work. When I run it, I see it is in the Idle Pose state on the WalkRunPivot SM, but I put my new sub states on the Idle SM. I copied Idle.cs to IdleCustom.cs and changed the Activate method to randomly call one of the two sub-states for idle that I added:

    Code (CSharp):
    1.  
    2.             int randomIdle = Random.Range(1,3);
    3.             int idlePhase = PHASE_START_IDLE1;
    4.             if (randomIdle == 2) {
    5.                 idlePhase = PHASE_START_IDLE2;
    6.             }
    7.             mMotionController.SetAnimatorMotionPhase(mMotionLayer.AnimatorLayerIndex, idlePhase, true);
    8.  
    I also added IdleCustom as a new motion on the MC character and unchecked the existing Idle motion. I then generated the code for this new motion and replaced the generated code at the end of the IdleCustom.cs (since I had copied this file from Idle.cs).

    I attached the debugger and I do see that my IdleCustom.Activate method is being called. I'm thinking it doesn't work because the sub-states I added are not on the WalkRunPivot SM?
     
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    I think you're like 90% of the way there.

    You don't want to do your logic in the Activate() method. There's two reasons:

    1. Since your new states don't start from the "Any State", there's no transition that can fire. You have to be in the existing "IdlePose" state in order for your transition to work.

    2. You really don't want your animations to start from the "Any State". The reason is that transitions are usually based on timings of the animations. My IdlePose is quick and all timings I've done is based on that. I'll bet your alternate idle animations are much longer. So, that would change all the incoming transitions.

    So, think of the IdlePose as your "hub" or "center". You will always start in the exiting IdlePose. Then, in your Update() method, you'd add the logic to trigger one of the alternate idles. When that's done, it goes back to IdlePose. Then, you wait another second or two and choose a new alternate idle. And so on.

    I hope that helps.
     
  38. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Thanks Tim. Got it working by moving the code to Update(), which is awesome!

    One more problem I don't know how to fix though, is that while it's in the main IdlePose state, I call SetAnimatorMotionPhase to trigger the transition to one or the other of the two new idle states I added, and it seems to be ignored. I have this on a delay so it only runs after several seconds, since I don't want it on every frame, but it takes several of these calls before one takes and the new animation is triggered. Not sure why. In the Animator parameters pane, I can see the L0MotionPhase change to the new phase for one of my triggers, but then it immediately goes back to 0.
     
  39. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Thank you, downloaded and imported the json file.

    But some of .cs script files are missing.

    combat_bt.png

    As shown on the above image, some of conditional node such as 'CheckAttributeFloat' and action node are missing.

    Did I miss something? If not, should I implement those nodes by myself?
     
  40. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Ignore it, sorry for that annoying post. :)

    Found that. I've downloaded Node Canvas sources again from the vault page at http://www.ootii.com/UnityMotionVault.cshtml and that contains all that needs.

    Thank you.
     
    Tryz likes this.
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    One of two things is happening:

    1. You've got the "Has Exit Time" checkbox checked on the mecanim transition. With this checked, the transition won't occur immediately. Instead it will wait for the animation to hit the appropriate Exit Time. That's just the way mecanim works.

    2. When calling SetAnimatorMotionPhase, set the last parameter to 'false'. This will keep the MC from resetting the value. However, this means you'll need to reset it yourself when you enter your animation states. You'd do something like this in update.

    if (mMotionLayer._AnimatorStateID == STATE_Idle1 || mMotionLayer._AnimatorStateID == STATE_Idle2)
    {
    mMotionController.SetAnimatorMotionPhase(mMotionLayer.AnimatorLayerIndex, 0);
    }
     
    hoodoo likes this.
  42. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Thanks Tim, I appreciate the help and I know this is only Unity stuff and me needing to learn better how Mecanim works.

    Unchecking Has Exit Time did the trick!
     
    Tryz likes this.
  43. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    955
    @hoodoo - I have an Idle motion that transitions into one of six different idle animations that I can share with you (if it's okay with @Tryz). I'm out of town at the moment, but I'll be back tonight. (Mine uses Movement Animset Pro but you can easily adapt it to whatever animations you use)
     
  44. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    Totally cool with me. I like that people share motions. :)
     
    hoodoo and rubble1 like this.
  45. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    I like this idea. It would provide for instant chained attacks without any delay.
     
    Hans, Tryz and TeagansDad like this.
  46. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    It's easy to love what you do when you spend the day tossing around lightning bolts! :D



    BTW... Levitate is done and so is Poisonous Cloud.

    Now, I want to see if I can do chain lightning.
     
    Last edited: Feb 14, 2017
    kimsama, antoripa, hopeful and 4 others like this.
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,013
    Ooh, I always loved this spell.
     
    Tryz likes this.
  48. hoodoo

    hoodoo

    Joined:
    Oct 19, 2012
    Posts:
    154
    Thank you @TeagansDad, that would be great! And thanks again Tim for all the help! :)
     
  49. webgrapx

    webgrapx

    Joined:
    Jul 21, 2015
    Posts:
    22
     
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,399
    @webgrapx

    If the player is not found, then the MC must not have been imported correctly. That character is used in nearly all my assets.

    I do have a video that shows getting the Sword & Shield Motion Pack up and running. It's pretty much the same with Swimming and Archery:


    I'm really just going through the steps in the User's Guide. So, if you follow that, you'll be fine.
     
    BackwoodsGaming and kurotatsu like this.