Search Unity

Motion Controller

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

  1. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    Mixamo is being a little tedious. For reason the files are not exporting as Y_Bot@blahblah, and they only include the names of the animations. When I add the animationmeta folder to the mixamo folder, it says

    Removing Assets/ootii/MotionControllerPacks/Archery/Content/Animations/Mixamo/AnimationMeta/Y_Bot@fall_a_land_to_standing_idle_01.fbx because the asset does not exist

    I've probably also done something wrong.
     
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Hey again @mattockman ,

    I just tried it and I could duplicate your issue.

    When you get to Mixamo's "Download Settings" window, you have to choose "FBX for Unity (.fbx)", not "FBX (.fbx)".

    Choosing "FBX (.fbx)" had no "Y_Bot@...", but "FBX for Unity (.fbx)" did.
     
  3. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    @Tryz thank you! That fixed the naming issue, but I'm still getting that error. I suspect I'm following the instructions incorrectly in regards the animationmeta folder.

    I go to the extras folder in the archery package and drag the animationmeta zip folder onto the desktop. I unzip it to the desktop and then drag the (empty) animationmeta folder to the mixamo folder in the archery package. The correctly named archery animations were in that folder before I did this.

    Is that right?
     
  4. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    try this:

    Make sure unity is closed when you put the mixamo anims, and meta data in the appropriate folders.

    if you put the anims in with unity open it will write it's own metadatas, or overwrite your new ones.
     
    TeagansDad, devstudents and Tryz like this.
  5. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Cool!

    Close...

    1. Import the Archery Motion Pack and copy the Mixamo animations to the Mixamo folder.
    2. In file explorer, just double-click the AnimationMeta.zip that is in the Extras folder.
    3. The *.meta files aren't in a folder. So, extract the 40 files into the Mixamo folder the animations went in.
    4. Click on Unity's title bar to make the window active and it will import the animations with my meta files.
    5. Close Unity and re-open it. That refreshes the Animator.

    There shouldn't be any folders under Mixamo other than "Materials".

    I went ahead and beefed up the documentation on this (see page 40):
    http://www.ootii.com/Unity/MotionPacks/Archery/ArcheryUsersGuide.pdf

    Hopefully that makes it more clear. :)
     
    Last edited: Nov 3, 2016
    TeagansDad and devstudents like this.
  6. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    671
    The important thing is that the animation names match the metadata names exactly. So for instance if you have a metadata file called "Y_Bot@swimming.fbx.meta", the corresponding animation must be called "Y_Bot@swimming.fbx". When you start Unity, any metadata files that don't match an identically named asset will generate an error, and be deleted.

    The good news is that you don't need to download your animations as "Y_Bot@xxxx.fbx.meta". Simply renaming them afterwards will accomplish the same thing. Since I already had most of the animations needed for the Swimming pack, that's all I did when importing them. But if you're downloading them all from scratch, you can save a step by getting them with the proper names in the first place. ;)
     
    TeagansDad, Tryz and devstudents like this.
  7. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    Thanks everyone! Issue is totally resolved now. Double clicking on the animationmeta zip folder and dragging the contents into the mixamo folder when Unity was closed solved it. When I dragged them in while unity was open, it threw this error:

    Failed copying file Y_Bot@standing_turn_90_right.fbx.meta to Assets/ootii/MotionControllerPacks/Archery/Content/Animations/Mixamo/Y_Bot@standing_turn_90_right.fbx.meta.

    Cheers @FargleBargle. I'll remember that if I can't get the right names for an animation in the future.
     
    hopeful, kurotatsu and Tryz like this.
  8. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    @Tryz thought you might find this interesting:



    The mods showcased in the video dramatically improved the combat in Skyrim. I never realised how annoying 'heat-seeking' attacks were until they were removed! Being able to dodge attacks at the last minute really adds to the intensity of combat, and makes the whole experience more rewarding as it involves actual player skill, timing, and strategy. I can't imagine a third person combat system without it!

    It would be awesome if Mixamo's 'standing dodge right' and 'standing dodge left' (or something similar) were integrated into the upcoming sword and shield plugin.

    No worries if the integration is not feasible at this stage. Just thought I'd throw it out there to see what everyone thinks :)
     
    Tryz and kurotatsu like this.
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Great video. The interesting thing is that I've already got several things in that they talk about:

    1. Locking on
    2. Non-heat seeking attacks (for the PC and soon for the NPC)
    3. Attack styles

    I'll check out the dodges. The big thing will be to see how they blend. My limit is always the animations :(

    I'll do another pre-release video early next week.
     
  10. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    Hey guys ...
    I am gonna share a short video about Motion Controller and Behavior Design Integration. Player and 50 NPCs are driven by that combination. I am very happy about perfomance from that combination. The scene in the video is a 4Km2 area uisng SpeedTree, HQ Photographic Textures Grass Pack Vol.1 and 3DForge Exterior. And resolution is 4K... No optimitation so far , so higher than 60FPS is easy to reach out even at that resolution. One more point that you cannot see in the video .. somewhere in the Area there are around 50 Wolfs wandering looking for food ( 101 caharacter overall ) ... Thanks to Tim for his excellent assets... see you guys ...

     
    TeagansDad, kurotatsu and Tryz like this.
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    That is awesome! It's cool that you've got so many NPCs running around as well.

    Really great job. I'm excited to see more! :)
     
    antoripa and TeagansDad like this.
  12. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    I would try to have a combact demo with Behavior Design ...but is not a commitment, just an ambitious plan :)
     
    Last edited: Nov 4, 2016
    Tryz and TeagansDad like this.
  13. DanielKW

    DanielKW

    Joined:
    Nov 11, 2014
    Posts:
    35
    @Tryz I bought your bow pack.
    I was wondering can your system be adapted to a rifle for example, and does the projectile still have that old physX bug where if it's moving too fast it unity won't register a hit?
     
  14. keepthachange

    keepthachange

    Joined:
    Oct 15, 2014
    Posts:
    80
    I have to say this Product and it's community is top notch. I have bought a-lot of assets and this one is by far the best..opsive got nothing on this asset.
     
    antoripa, TeagansDad and Tryz like this.
  15. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Thanks @DanielKW !

    Unfortunately, it really isn't suited for rifles and bullets. Typically, you don't instantiate an object as a bullet as it simply moves to fast to see and it's not worth wasting the resources. I do plan on doing a shooter pack, but I think that will be more Dec or Jan time frame.

    With the arrow, there shouldn't be an issue as I'm not using volume-based collisions. They were giving odd results. Instead, I do a "predictive raycast" approach. This has been much more reliable and handles very fast arrows.
     
    TeagansDad likes this.
  16. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    I appreciate that. :)

    The community is definitely the best... Having so many helpful and friendly people is super motivating.
     
    keepthachange and TeagansDad like this.
  17. keepthachange

    keepthachange

    Joined:
    Oct 15, 2014
    Posts:
    80
    I do have one weird thing going on tho...And its the first time i seen it, when i use my character with mc2 like the back of him does this?

    backofcharacter1.jpg backofcharacter2.jpg backofcharacter1.jpg backofcharacter2.jpg
     
  18. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    The MC doesn't do anything with the meshes or vertices.

    If I had to guess, that vertex has a bad weight. Meaning it is weighted to a bone it shouldn't be. as the character animates, that bad bone weight causes the vertex to move.

    This isn't really anything to do with the MC, but the models vertex weights and animations in general.
     
    TeagansDad likes this.
  19. keepthachange

    keepthachange

    Joined:
    Oct 15, 2014
    Posts:
    80
    Yea I just figured that out myself as-well.. funny I have had this model for months and i never noticed it til now, but yes your right.
     
    Tryz likes this.
  20. DanielKW

    DanielKW

    Joined:
    Nov 11, 2014
    Posts:
    35
    @Tryz no prob. Probably will run with my own implementation until the shooter pack comes out.
     
    Tryz likes this.
  21. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    ....and the sneak wall cover system()....cough, cough...
     
    Tryz and antoripa like this.
  22. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    507
    Is there a shooter pack planed with cover system?
    Didnt knew that. Any rough ETA? :)
     
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Yes.

    A sneak/cover system will be next after the Sword & Shield pack I'm working on.

    Shooter pack will come probably late Dec. or early Jan. I definitely want to do it, but I can't guarantee when.
     
  24. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    825
    I'm working on a set of motions using Movement Animset Pro and Female MAP, based on the new WalkRunX _v2 motions. The idles also randomly cycle through the different idle animations in each set. I'll be submitting them to the Vault when I'm done.

    The first release will just be the Idle and WalkRunX motions; I want to do a Jump using those animations, but it's a more complex motion and just subbing in new animations looks terrible. That will come later.

    I want to get these done within a couple of weeks, but that's not a promise. :)
     
    kurotatsu, antoripa and Tryz like this.
  25. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    Hey guys ...
    I have been working on Behavior Design integration for the last few days. You can download a first release from ootii's Vault ( http://www.ootii.com/UnityMotionVault.cshtml ) it's v 0.2.1 ( alpha release ).

    upload_2016-11-5_20-44-52.png

    Just create a new brand project with MC and BD installed. After add the integration package you downloaded.
    You can take a look to the demo scene and check setting out for the Motion Character. I will release a documenti whti the final release that will have more actions and more complex examples.
    Just to mention that I am working even on a integration with Apex Path and SharpNav. I do not have any ETA, but I will do somewhere in next few weeks.

    upload_2016-11-5_20-48-12.png

    Last but not least .. thank you very much to Tim for all his oustanding assets ...
     
  26. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    @antoripa , You rock!! Thank you for helping everyone. :)
     
    antoripa and TeagansDad like this.
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    I'm playing around with some mechanics for melee combat and and I thought I'd get your opinion...




    The green area represents the 'hit area' that is valid for the sword's swing. Obviously this could change based on the type and direction of the swing.

    The red line is the actual movement of he sword as the swing animates.

    I could go a couple of routes with sword swinging:

    1. At a specific time in the animation (say mid swing), test if there's something in the green area. If so, that's what we're hitting. It's pretty cheap and setup is easy as I just define the "field-of-attack" that goes along with the swing.

    2. Put a collider on the sword an use Unity's OnCollisionEnter events. I'm not a fan of this as I've found it's unreliable with small fast collisions (like a sword's blade). It also requires people to set colliders on the swords.

    3. Do raycast as the sword swings. This approach is very accurate. However, you have to setup each weapon to say where the blade is and where rays should come from.

    Most games do something like #1. It's fast, but provides reasonably accurate hits. With my "hit area" approach, the attack can still be dodged... which is cool.

    #2 & #3 are very accurate (especially #3), but more expensive. They also requires properties and setup time for each weapon. So, if you add a new sword you'll have to 'decorate' it with the properties and colliders I need. Not horrible, but there's work.

    What are your thoughts?
     
    Last edited: Nov 6, 2016
    devstudents, kurotatsu and antoripa like this.
  28. keepthachange

    keepthachange

    Joined:
    Oct 15, 2014
    Posts:
    80
    #1 I see that a-lot Like gac does the same thing
    #2 i have used before and I had it set up so it was only enabled if the player was swinging and disabled if he just walking around and stuff or if the sword was mounted on the players back.
     
    Tryz likes this.
  29. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    825
    @Tryz, I assume that Hallow's Deep uses #1?

    I've used #2 before. ORK Framework's real-time combat uses that. So do both Opsive's and Invector's controllers. I haven't used #3.

    I don't have any problem with setting up weapon prefabs with colliders and setting properties on components. I'm used to it and it doesn't really take that long to do.

    Does #1 give many hits when it looks like the weapon didn't actually contact the target?
     
    keepthachange, devstudents and Tryz like this.
  30. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    Funny thing .. I already use #3 ....I created from my idea, by myself, just few weeks ago and you can integrate with whatever controller ..
    thinking if put on Asset Store for end of November beginning December ..
    Immagine.jpg
     
    TeagansDad and Tryz like this.
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Thanks all.

    Hallow's Deep uses #1, but grabs the closest point. So, there typically isn't an issue with multiple contacts.

    That looks cool @antoripa .

    I'll have to try #2 with Unity 5. Unity 4's collisions couldn't deal with the fast animations and small hit box. I know Unity 5 uses a more advanced version of PhysX.
     
  32. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    If you go with #2 you can think to put multiple colliders and give each one a damage point...For a sword 2 are cool .. one on the point with higher damage point. You can use a transparent mesh and give a color from a gradient according to damage. :).
     
    TeagansDad and Tryz like this.
  33. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    Guys ..I am a bit off topic .. but I would share what I did in the morning ( here it's been raining, so weekend at home) ....
    They will supports asap building navigation meshes during runtime.
    I've been playing around with 5.5.0b11 along with their open source library to control the navigation mesh and it works very well.
     
    kurotatsu, Tryz and TeagansDad like this.
  34. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    So, this is a good example of what I mean:

    In doing #2 (a collider on the sword), the red line is the path of the sword. The pink arrows are collisions that Unity detects (along with a direction of the swing).

    In this image, you can see we have 3 collisions:


    That's what I'd expect. However, sometimes Unity don't report all of them:


    I'm in the same position, same swing, etc. This time only one collision was reported.

    The RigidBody is set to Interpolate and Continuous Dynamic. I've tried other settings too, but it's never 100% (so far). :(

    I'll keep trying different settings, but if you have any ideas... I'd appreciate them.
     
    TeagansDad likes this.
  35. kurotatsu

    kurotatsu

    Joined:
    May 10, 2012
    Posts:
    588
    My vote is for #1

    That's my preferred method, and thanks for the sneak, cover, I've been waiting ever so not patiently for.lol, ....;).
     
    antoripa and Tryz like this.
  36. biohazard9990

    biohazard9990

    Joined:
    Oct 18, 2016
    Posts:
    6
    #1 seems to be simpler and more reliable. Besides it will probably be the same solution for all similar weapons without having to individually set up each weapon object. It will probably also save you the extra support time that would come with the other two.
     
    Last edited: Nov 6, 2016
    Tryz and antoripa like this.
  37. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    825
    I'm not picky about which method is used. If #1 is more reliable than #2 and is accurate enough that commercial games use it, then I'm all for it.
     
    Tryz likes this.
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,005
    I think what I'd need for my game - which is more of a rule-based RPG - is simply to see how many targets are in the cone-like area of effect, and (after calculating "to hit vs defense" and such) apply the damage to the closest X-many of them (as defined in the attack, so maybe just a single target, or maybe up to 3 in the target area, etc.). A correlation between the attack animation and the hit reaction is mainly what I'd be looking for from MC, I guess.
     
    Tryz likes this.
  39. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    @hopeful , You'll definitely be able to know all the "potentials" and distances as I do expose that.

    Thanks everyone for the feedback. That helps!
     
    TeagansDad and hopeful like this.
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,005
    Not sure if any of this would be part of your MC add-on, but the hit reaction might involve things like an animation (a dizzy stagger), and/or it might involve Bone Controller (moving the head back and skewing the jaw to the side on a punch to the face), and maybe a ragdoll flying backward if the knockback is extreme.

    Of course, knowing the moment of collision would be needed for SFX.

    In terms of VFX, I might also want to plug in, say, a circle of tweeting birds above the target's head as part of a hit reaction. Probably that would get attached at the same moment of collision noted above, or maybe with the dizzy reaction. Not sure where MC draws the line on this sort of thing, but just mentioning it up front so the use cases are in the thought process and maybe easier to hook stuff up. :)
     
    recon0303, Tryz and TeagansDad like this.
  41. devstudents

    devstudents

    Joined:
    Feb 18, 2014
    Posts:
    133
    I like the idea of the collider being on the weapon. It opens up the possibility for hit regions on the body based on contact, ragdoll reactions to being hit in certain areas, etc. I'm not sure if you can get all those same features with #1, but, if you can't, I'm definitely voting for #2!

    I also think #2 adds greater realism. I remember years ago the animations in Skyrim were disabled due to some bug, but all the other game features were active. I could still attack enemies and deal damage in A pose, and I realised that the position of my character's weapon in space had nothing to do with combat -which was a little disappointing.
     
    Tryz likes this.
  42. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    Hi,
    In a scene, I shifted to MC from another controller. No other changes.
    Few times I am getting the below error :

    Not allowed to access triangles/indices on mesh 'Railing_Stair_04_Collider'
    UnityEngine.Mesh:get_triangles()
    com.ootii.Geometry.MeshOctree:Initialize(Mesh) (at Assets/ootii/Framework_v1/Code/Geometry/MeshOctree.cs:54)
    com.ootii.Geometry.MeshOctree:.ctor(Mesh) (at Assets/ootii/Framework_v1/Code/Geometry/MeshOctree.cs:37)
    com.ootii.Geometry.MeshExt:ClosestPoint(Vector3, Single, Transform, Mesh) (at Assets/ootii/Framework_v1/Code/Geometry/MeshExt.cs:83)
    com.ootii.Geometry.GeometryExt:ClosestPoints(Vector3, Vector3, Single, MeshCollider, Vector3&, Vector3&) (at Assets/ootii/Framework_v1/Code/Geometry/GeometryExt.cs:1579)
    com.ootii.Geometry.GeometryExt:ClosestPoints(Vector3, Vector3, Single, Collider, Vector3&, Vector3&, Int32) (at Assets/ootii/Framework_v1/Code/Geometry/GeometryExt.cs:812)
    com.ootii.Actors.BodyCapsule:CollisionCastAll(Vector3, Vector3, Single, Int32) (at Assets/ootii/Framework_v1/Code/Actors/CharacterControllers/BodyShapes/BodyCapsule.cs:321)
    com.ootii.Actors.ActorController:processMovement(Int32, Vector3, Boolean, Vector3&, Vector3&) (at Assets/ootii/ActorController/Code/Actors/CharacterControllers/ActorController.cs:2755)
    com.ootii.Actors.ActorController:InternalUpdate(Single, Int32) (at Assets/ootii/ActorController/Code/Actors/CharacterControllers/ActorController.cs:1602)
    com.ootii.Actors.ActorController:ControllerLateUpdate(Single, Int32) (at Assets/ootii/ActorController/Code/Actors/CharacterControllers/ActorController.cs:1200)
    com.ootii.Actors.BaseSystemController:LateUpdate() (at Assets/ootii/Framework_v1/Code/Actors/BaseSystemController.cs:264)
    com.ootii.Actors.ActorController:LateUpdate() (at Assets/ootii/ActorController/Code/Actors/CharacterControllers/ActorController.cs:1153)
     
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    For collision detection, I'm parsing meshes that the character comes in contact with.

    Is the "Read/Write Enabled" checkbox checked?
    Is the "Optimize Mesh" checkbox checked?
    Is the GameObject marked as "Static"?

    I have logic that should prevent an error from happening due to this, but let's start there. Feel free to email me the mesh as well.
     
    Last edited: Nov 9, 2016
  44. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    No
    Yes
    Yes
     
  45. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Check the "Read/Write Enabled" checkbox. That will give me access to the vertices of the mesh. That should resolve it.

    I thought I had logic to prevent the error. I'll look.


    Just some back info...

    Unity's colliders have a function "ClosestPointOnBounds", but they don't have a "ClosestPoint" function. So, when asking for the closest point on a custom mesh, I've actually created the function that provides the true result. Otherwise, we'd just get the point on the mesh's bounding box (which isn't very accurate).

    To get the actual point on the mesh, I need to access the mesh's vertices and cache them. That "Read/Write Enabled" checkbox gives me the ability to do that.

    I hope that makes sense.
     
    hopeful likes this.
  46. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    Yes .. makes sense. Jusat setting the mesh collider ( not the mesh ) on Enable Read/Write works .. maybe that can help you to improve this point. There is still a weird think that sometime the char goes trought the collider ... but for that i will do further test to replicate the scenario ( I am in a procedural world generated at runtime, so need to build a static small scene )
     
  47. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    Good. I thought I had this covered, but apparently not. So, I'm going to revert to the bounds check if "Enable Read/Write" isn't checked.

    Let me know on the procedural world. I'm curious if there's something different about that.
     
    antoripa likes this.
  48. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,162
    Sure .. i will
     
  49. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,720
    I vote for this option. And I'm looking forward to seeing this all in action.
     
    kurotatsu and Tryz like this.
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,225
    I've actually got both approaches working (#1 and #2). :)

    So, you can choose which works best for you. I hope to have another video Friday or Saturday.
     
    antoripa, kurotatsu and TeagansDad like this.