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
    I believe they can given what I've seen.

    It will just require that asset to be setup like other input systems (Rewired, In Control, Easy Touch 5, etc.) did. They all had their own setup and my input source just read and wrapped those.
     
  2. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    So, I saw this "ooti Character Wizard" thing and thought I'd try it out and see what stuff it would do for me automatically. Turns out, it automatically overwrote and renamed all my layers. Not cool. Could you change this to only use layers that are not already in use????
     
  3. PeteOfThePetes

    PeteOfThePetes

    Joined:
    Sep 2, 2019
    Posts:
    4
    Hello Everyone!
    I'm back... with what I am hoping is another really simple fix. I have spent a few hours tinkering with the MC and AC settings and nothing seems to change this issue.

    *Sometimes* when I perform a jump it does this, where the character "Lands" but he's still in the air, instead of completing the animation once he touches the ground.

    I'm using the Basic Jump state, and I have a jump animation linked to a landing animation.

    Any help or advice would be greatly appreciated!
    Thank you! Animated GIF-downsized_large (3).gif Jump-Land_Transition.PNG
     
  4. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @PeteOfThePetes ,

    I have a feeling you're not waiting for the "IsGrounded" to happen before you transition.

    The "Basic Jump" motion is an "animated jump". It simply plays the animation and at the end you go to idle. If you happened to jump off a cliff, my "Fall" motion kicks in (cancelling your jump) and it all looks decent. With animated jumps, you have to ensure your character's animation and any up-movement all animated to the same height or you'll get the character landing in the air as you're seeing.

    My more advanced and complex "Jump" motion is a "physics jump". What I mean is that there's lots of stages like "rise", "apex", "fall", "land", and finally "idle". This works better because if a box slides under you mid jump, you can land on it gracefully. It allows for a dynamic range of height in the jump too (based on a physics force). I manage all these stages by looking to see if the character is grounded, distance from ground, etc.

    In your example above, you are using the simple "Basic Jump". So, when the animation finishes you move into the next land_roll_move_root animation regardless if you're on the ground or not. That's why at the very end of the motion your character drops to the ground. Gravity is disabled at the end of the "Basic Jump" motion.

    So, there's a couple of options:
    1. Ensure your animation that has him go up is equal to the animation that has him go down.
    2. Ensure you're not adding extra force that moves him up further than the animation has him coming down.
    3. You could modify/copy the Basic Motion to support the grounded function and only transition the animation when you're actually grounded.
    4. You could modify/copy the Basic Motion to not disable gravity. Your animation MAY cover the up movement.
    5. We could use animation events to trigger gravity... interesting... just thinking about it.
    Feel free to email tim@ootii.com if you need help.

    Jumps seem simple, but when you think about the environment moving around your character and the different stages... it actually is a bit more complex.
     
  5. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Uhm, sorry, after I got my layers set back up I created a new project and ran this wizard so I could get the layer names needed and I realized then that there was a checkbox "Overwrite layers" or something like that. I would suggest that you make this default to off instead of on. Slightly overlooking that cost me quite a bit of pain.

    Anyway, I am trying to get climbing to work, and it is doing great when the character is standing still or walking and jumping at a very close approach. I am having a hard time figuring out why I can't get a mid-jump climb to work. The only thing in the user guide I see says that climbing should work from a mid-jump.

    Any tips here?
     
  6. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    On the other hand, if it defaults to off and a new user overlooks it, a number of motions won't work (the various climbs, vault, balance walk, etc) out of the box. I figured that having a checkbox and having to press a separate button to set up the layers would be enough of a safeguard... but I think that it should display a message that makes it more obvious what layers will be overwritten.

    Actually, I should be able to modify it so that it will un-check the "Overwrite Existing Layers" checkbox if any of the layer indexes used by the default layer set are in use. And if none of those are in use, then it doesn't actually need to display the checkbox at all. That should make it more straightforward for everyone.

    I appreciate the feedback. The Character Wizard tool ended up growing beyond what I had originally created it to do. Ideally, Project Setup, Scene Setup, and Character Setup should be different steps in the process (or separate tools altogether).

    EDIT: After looking into it further, I see that the OverwriteExistingLayers property is serialized as part of the CharacterWizardProfile (ScriptableObject) asset. Which goes back to what I said about how project-wide settings should ideally be handled by a separate tool. The profiles store the appropriate layer used for a particular motion (or on which to assign a character) via the layer mask ID, rather than the name of the layer. This was something I intended to revisit at some point, as I didn't like how rigid it is.

    I think that the best approach may be to leave the setting as it is, but display a better warning message if any of the layers that will be set are already defined.
     
    Last edited: Oct 13, 2020
  7. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Yea, I understand the challenge. Using the wizard was very helpful though. Maybe just add a "warning" icon next to the checkbox or something to draw attention to it would be enough. I just simply didn't see it the first time.

    Or, you could also just do nothing. This was obviously user error (mine) and not yours.
     
    Tryz likes this.
  8. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I think that this should help:

    upload_2020-10-13_15-46-48.png

    The warning box below "Overwrite Existing Layers" is only shown if the box is checked. Not the most eye-pleasing layout for the warnings, but it gets the job done.

    (And yeah, that message box text is a bit difficult to read on the 2019.4 "Professional" editor theme. I can't remember if it looked like that on the older Pro theme or not... been a long time since I tried).

    No, it's just a case where there probably should have been more/better feedback in the first place. :)
     
    Tryz likes this.
  9. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Yea, that is noticeable :)

    Thanks for making the change :)
     
    TeagansDad and Tryz like this.
  10. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @Skotrap7 ,

    For the "mid-jump climb" for "fall and grap" to work, you need to use the "Climb Crouch" motion. Make sure that's added to your list of motions and make sure the "Climbing Layers" match the objects you want the character to grab onto. That should be all you need.

    In my demo_Climb scene, I found that I had to add the "Climb" layer to the "Climbing Layers" property of the motion. Then, I could jump and grab on the lower boxes.

     
    Skotrap7 likes this.
  11. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Worked, thanks!!
     
  12. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    I've created an Input Source for Unity's new Input System. It's working well with Unity 2020.1.7f1.

    You can read about how to use it here:
    Unity's Input System

    I haven't published it yet, but if you'd like the files and to help me test, please email tim@ootii.com.
     
    Djayp and Tzirrit like this.
  13. Tzirrit

    Tzirrit

    Joined:
    Sep 9, 2014
    Posts:
    23
    While looking trough the code, I noticed that neither ArrowCore, nor ProjectileCore use the GameObjectPool.

    I was able to change most of the code to use the existing ootii object pooling, but the way Arrows/Projectiles are instantiated and used, I could not find a suitable way to pool them.

    I had quick test that worked most of the time:
    1) Add a new GameObject property pooledPrefab to ProjectileCore
    2) On the Bow, whenever creating an arrow, take the resource path as GameObject, use it to Allocate a Projectile in GameObjectPool and store it as pooledPrefab on the Projectile
    3) Since the connector is a simple plain GameObject that also is created and destroyed at runtime, I did not find an elegant way to store its 'prefab' so I just did not use a connector for embedding the projectile
    4) On the Projectile, I now had all the information required to Release it from the GameObjectPool once it's no longer needed

    Only problem seemed to be properly resetting the physics on the projectile, so sometimes the arrow would just drop when being fired. It was just a quick test, to see how far I can get with using the pool and when I hit those inconsistencies I gave up looking for the root cause after a while.

    Now when firing only a few arrows, this could be neglected, but I would like to use pooling wherever possible. I am just wondering why pooling is not used there, if others have changed the ArrowCore to use pooling, and how they did it.

    [edit] PS: There also is a lot of commented out code in ArrowCore, which looks like there was some refactoring going on (moving functionality to the ProjectileCore. Maybe while working on the Shooter or Magic pack). Is there some refactoring/cleaning up coming with future releases?
     
    Last edited: Oct 23, 2020
  14. Tzirrit

    Tzirrit

    Joined:
    Sep 9, 2014
    Posts:
    23
    Very cool, looking forward to see it released :)
     
  15. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Anyone using the nav mesh agent? I'm having a little bit of trouble getting it working in one of my projects.

    I setup my character via the wizard, added a NavMeshInputSource component on my character and a NavMeshAgent.

    Now, I assume all I need to do is set the TargetPosition or Target transform on the NavMeshInputSource and it should work. What I am seeing though is that the character just constantly runs straight.

    With gizmos enabled I do see the that the NavMeshInputSource has the right location targeted. Also, if I disable the NavMeshInputSource and instead use a NavMeshDriver the driver does move the character to the right location (without any animation).

    I'm a bit perplexed here. I looked at the NavMesh demo and I don't see anything different from what I have setup. Here are some screenshots of my setup on my player.

    Also, when I get this working and I want to programatically change the characters destination, do I change set the destination on the NavMeshAgent or the NavMeshAgentInputSource or the MotionController itself?

    This seems to be a bit undocumented in the Motion Controller guide from what I can see.
     
  16. Tzirrit

    Tzirrit

    Joined:
    Sep 9, 2014
    Posts:
    23
    Are you using it on a player character or on NPCs?

    I am using the navmesh agent on my NPCs and it works very well. There are a few places where you need to set the correct NavMeshInputSource:
    - Motion Controller
    - Inventory
    - Camera Rig (when using on the player)

    Adding multiple InputSources (e.g. when having a player with normal input and NPCs with navMeshInput) to a scene and enabling "find InputSource" messes up alot of things.

    Once it is setup correctly, you just need to update the target on the oNavmeshInputSource and the character (NPC in my case) moves there flawlessly, even jumping and climbing - if you set it up ;)
     
    Last edited: Oct 25, 2020
    Tryz likes this.
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @Tzirrit ,

    That's a good point.

    I use "resources" because it allows people to use any arrow they create. In doing that, I don't pre-instantiate since you may have your own custom arrow types (ice arrows, fire arrows, etc).

    What you did is right, but I'll play around and see what I can officially put in.

    Yeah. I moved a lot of that to the ProjectileCore and need to clean that up. I wanted to keep it around, but I think I forgot about it. :eek:

    If you shoot me (tim@ootii.com) and email with your Unity Invoice ID, I'll send you the files to play with.

    So far, it's going well.
     
  18. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @Skotrap7 ,

    Make sure you're using the Basic Walk Run Strafe motion. Some of the other "Walk Run" motions use the camera for things like pivoting. So rotation is handle a little differently in those motions.

    With NPCs, you'll want the strafe motions.

    Set it on the NavMeshInputSource using the Target property. The Nav Mesh Input Source will be responsible for managing the information we send to (and get from) the NavMeshAgent.
     
  19. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    I'm testing out Unity 2020.1.10, and trying to update to the latest versions of Ootii packages posted a few weeks ago. TPMC 2.807, CC 3.346.0, and EI 1.916.0 went in fine, but when I tried to bring in Mount Points 2.296 - which I had not previously installed in this test project - this happened:

    Capture1.JPG

    Then after successfully installing SHMP 0.185.0 and SSMP 0.393.0, i tried to add SMP 0.66 and got the same thing:

    Screenshot 2020-10-24 185015.png

    I finally deleted the Ootii directory and tried to install everything from scratch - with the same results. Next, I tried deleting my Library folder and re-importing everything. When that failed, I created a new project, and tried to bring these packages in, with the same results. As you can see from the pics, I definitely don't have either of these assets installed. Here are my scripting define entries:
    At this point, I've eliminated everything but Unity and Ootii. What's going on? :eek:
     
    Last edited: Oct 25, 2020
  20. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    It looks like a Unity Package Manager issue. Are you getting any kind of Unity error message?

    I was able to install in a Unity 2020.1.10f1 project fine. I did that just now. However, I had to press the "Update" button in the Package Manager a second time... which is odd.

    I started a new Unity 2020.1.10f1 project and imported the assets you had (MC, CC, EI). Then, I imported MP and it came in.



    Maybe check the Unity Hub asset cache on your computer. Perhaps the cache is corrupted. You could delete my assets and that should for Unity's Package Manager to re-download.

    C:\Users\<user name>\AppData\Roaming\Unity\Asset Store-5.x\ootii\ScriptingAnimation
     
    FargleBargle and TeagansDad like this.
  21. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    I'm playing with this after a long hiatus and hooked it up with UMA 2.10, looks great except for one issue. The idle pose is firing in the animator but no movement on the avatar, probably something simple I am not doing. Walking/running work fine. Any ideas?
     
  22. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    That seems to have fixed it. Yes, I did have server connection errors when I originally downloaded the updates, but after retrying a few times, it appeared that I got them. I guess not. After deleting the two problem assets from the cache and re-downloading them, they installed OK.

    The other thing that might have been a factor was that I downloaded them all to cache several days ago, in a separate process, and then installed them from there using the old Assets>Import Package>Custom Package method, instead of the Package Manager. Looks like that method might not be as reliable as it used to be - or maybe Unity is sending me a message that I should evolve, and use the Package Manager for that now. :rolleyes:

    Thanks for the quick answer. It was the clue I needed. :)
     
    Last edited: Oct 25, 2020
    Tryz likes this.
  23. Tzirrit

    Tzirrit

    Joined:
    Sep 9, 2014
    Posts:
    23
    Thanks for considering it.

    Haha, yes that happens with such an extensive codebase ;) I just wanted to make sure to not rip out too much, when cleaning up myself.

    I've just sent you an email.
    I had "building an Input Source for the new Input System" on my todo list but did not get to do it yet. Seems like I don't need wo write it myself anymore :)
     
    Tryz likes this.
  24. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @tiggus ,

    Are you just using my default animations and motions or something from UMA? As long as you include "Basic Idle" in your motion list, everything should just work.

    Go ahead and email tim@ootii.com details about your setup and I'll see if I can help.
     
  25. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    Thanks Tim,

    I just emailed you with the steps and a repro project. I am just using your default animations that come with the Humanoid controller. It is basically the UMA quickstart combined with the MC quickstart with one or two extra steps like running bone builder in UMA and replacing the animatorcontroller with your Humanoid controller.

    Works great on the other animations just something about Idle getting stuck.
     
  26. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    The default Idle animation is set up as a 1-frame looping animation, so you won't see any movement on the character. I think this is what you're seeing. Just need to replace the animation clip on the Idle state with the full idle animation, which should be part of the same animation file.
     
    Tryz likes this.
  27. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hey guys is there a way to control particles in case of "interrupt" in the spell editor?
     
  28. tiggus

    tiggus

    Joined:
    Sep 2, 2010
    Posts:
    1,240
    Ah ok, I will play with it more in that case, thanks for the pointer. It just seemed weird that Idle is "frozen in place" :)

    Edit: That was it, was able to replace the idle clip in Start and WalkRunPivot with the UMA one and is all good now. Thanks for the help.
     
    Last edited: Oct 25, 2020
    Tryz and TeagansDad like this.
  29. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Looks like this still doesn't work in the latest update:

    The test volume has a kinematic RB, and a capsule trigger collider, tagged as water, and on the water layer. I checked the code, and was amused to see that right after the comment:
    Code (CSharp):
    1. // FargleBargle said mark it "Important: don't change - EVER" ;-)
    you changed line 221 from:
    Code (CSharp):
    1. if (lHitInfo.collider != null && lHitInfo.collider is BoxCollider)
    2.  
    to:
    Code (CSharp):
    1. bool lUsePlane = !(lHitInfo.collider != null && lHitInfo.collider is BoxCollider);
    but even after changing it back to the original code you posted - that worked fine with TPMC 2.806 / SMP 0.65 - the current version no longer works, so something else seems to have changed since then. I'd really like to get to the bottom of this. Can you confirm any of my results, or is it just me? :(
     
    Last edited: Oct 26, 2020
  30. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Well, things are getting slightly better. I had to uncheck the "Activate with Target" from the Basic Walk Run Strafe motion (this was the only thing different between the motion controller in my project and the demo scene with navmesh), and now the character will take 1 or 2 steps and stop without reaching the target.

    Here's a gif with gizmos on demonstrating the issue:
    Example.gif
     
  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Not that I have setup by default. You could create a spell node to do what you want or a custom particle handler. But I don't do anything special on an interrupt.
     
  32. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @FargleBargle ,

    I see the code I put is there and hasn't changed. You should see a comment under the one you mention that's dated "08/09/2020".

    It may have to do with the height of your collider. On the MC's "Swim Idle" motion, change the "Surface Test" value to handle the height of your collider. I added a 20m collider and it didn't work until I set the value large enough to get to the top. Basically, I need to find the top of the surface to determine how far under water you are.

    There may a better way to do it... may just see if the character collider is "in" the water collider. However, then I wouldn't know the surface distance. That was important at the time. I'm not sure it really is... say the surface is just "infinite" away. :confused:
     
  33. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @Skotrap7 ,

    I'm not seeing that behavior in my demo or a clean test scene. I'm thinking it must be something in your setup. Are you sure you generated a Nav Mesh for your floor?

    Go ahead and send me (tim@ootii.com) a small project that has this behavior. That's probably the easiest way for me to look at your settings.
     
  34. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    A couple of new clues:

    First, in the line you mentioned, it seems to only look for surface hits on a box collider. I was using a capsule collider for the lift tube. When I changed it to a box collider, I was able to rise all the way to the surface. While not ideal for cylindrical lift tubes, I can make box colliders work for them, so this is progress.

    Second, I could only exit from the water volume "normally" when I was in the top half of the collider, so if my water volume is 10m high, and I exit at 4m, I'll keep swimming in air. If I exit at 6m or more, I'll drop to the ground as expected. This may also explain why I could never exit the capsule collider normally - I could never rise more than half way. In any case, this is a problem when using a water volume as a lift tube as I do, or when entering and exiting a submarine underwater. Thoughts?
     
  35. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Ok, I'll try and create a new project from scratch and see that I can reproduce it outside of this project first. If I can, I'll send it your way, if I can't I'll have to figure out how to debug things from there I guess.

    Thanks!
     
  36. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Ok, I set it up and will send it to you in a sec. FYI, I just noticed that if I set the "Target" transform in the inspector and hit Play the character walks to the target, but if I use TargetPosition in code, that is when he only takes a few steps and stops. Maybe I'm doing something wrong?
     
  37. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Playing about with the navmeshinputsource and am wondering why it might be that my Ootii bots never seem to run unless I set it to be the default state?

    Another question is whether it's possible to use the navmeshinputsource with the pivot motions so that they dn't have to make a wide turn from standing?

    Any help is greatly apreciated.
     
  38. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hey @Zante ,

    Nav Mesh solutions don't know automatically if a character should run or walk. So, some AI or setting needs to determine when that happens. The way I do it with the NavMeshInputSource is by saying that a character is capable of running ("Default to Run" is checked). In this case, the MC's "TargetNormalizedSpeed" is set to 1.0. When the character is within the "Slow Distance" property of the NavMeshInputSource, I set the MC's "TargetNormalizedSpeed" property to 0.5.

    If we don't check run as the default state, than the character can only walk. If you want to control if a character is capable of running, just disable the "Default to Run" property as needed.

    The pivot motions don't typically work with NPCs because they need the camera direction to determine if a character should pivot. You could certainly create a motion that doesn't require the camera direction, but that's just the way I built them originally. The strafe motions will handle character rotations without needing a camera. So, they work well for NPCs.

    You certainly could expand on what I did to create a something that fits your specific need. It just wasn't what I was thinking about when I build them. :)
     
  39. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Hi Tryz, thank you for the in-depth reply. This makes a lot more sense, my current solution was to call:

    Code (CSharp):
    1. //called from the object representing the remote player's position on the server
    2. //the 'instantiatedPlayerModel' is an Ootii bot
    3. if(Vector3.Distance(this.transform.position, instantiatedPlayerModel.transform.position) > 3.5)
    4.             {
    5.                 instantiatedPlayerModel.GetComponent<MotionController>().GetMotion<BasicWalkRunStrafe>().DefaultToRun = true;
    6.             }
    7.             else
    8.             {
    9.                 instantiatedPlayerModel.GetComponent<MotionController>().GetMotion<BasicWalkRunStrafe>().DefaultToRun = false;
    10.             }
    11. }
    Could I alter the normalized speed in the same way you describe for a more nuanced acceleration/decceleration?

    Regarding pivots, my use case is to use your navmeshInputSource as a motion prediction mechanism in a networked environment.

    So, the updates are coming 4 times per second for each of which the navmesh moves slowly towards those updates with varying speed based on distance (above code). It's just that there's an inconsistency in the 'faithfulness' of what's going on when the remote player representation (ootii bot) doesn't pick up on the fact that it should pivot as opposed to making a wide turn etc...​

    The pivots look natural so I'd LOVE to use them in this capacity. Based on the above, is there anything which occurs to you that might be a quick win I can pursue?
     
    Last edited: Nov 11, 2020
  40. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    What you're doing in the code is right.

    There's not a more nuanced approach because the blends of a 10% walk + 90% run or 75% idle + 25% walk look horrible. They look better when the animations are crafted to support this, but the free ones from Unity and even Mixamo aren't. So, it's better to have clear stages: idle -> walk -> run.

    The MC is flexible enough that you could create custom motions for custom animations and use them. However, that does take more work.

    Me too. People tend to fall between "realism" and "responsiveness". So, it's a matter of finding what's right for your game.

    I don't have a bunch of experience with networked games, but my understanding is that you pass things like position, rotation, and animation time. Then, the client syncs that information from the server. This "authoritative" server approach ensures that all clients see what the server dictates. Trying to use the animation to stay sync'd across different computers will cause the inconsistency that you mention.

    I know Unity has a bunch of new tools for network support, but I haven't done anything with them yet.
     
  41. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    Thanks again Tryz. Yup, the approach I'm taking is super low bandwidth/server load and not used in the capacity of a game as such but a general purpose virtual space. To this end, frame data doesn't need to be synchronised as rigidly. I'm doing this with scalability in mind, so I have to rely on the clients to predict things within a certain degree of accuracy. I'll think on it a bit and, if I find a solution, will post it.
     
    Last edited: Nov 12, 2020
    Tryz likes this.
  42. Dermestes

    Dermestes

    Joined:
    Aug 9, 2015
    Posts:
    13
    Is the sample scene from https://ootii.com/knowledge-base/multiplayer-networking/ and
    available anywhere? I am working on a Mirror implementation which should be almost identical and running into a few issues. I can provide my Invoice ID if someone has that specific demo available.

    Thanks in advance.
     
  43. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    When Unity removed their support for UNet, I had to remove it as others were getting confused by it.

    I looked through some of my archives, but I can't find the scene. I still include the BasicActorNetworkSync component, but it's disabled for later versions of Unity.

    I'll keep looking and if I do find the scene, I'll private message you.
     
  44. Dermestes

    Dermestes

    Joined:
    Aug 9, 2015
    Posts:
    13
    Thank you for looking and hopefully you can find a copy of it. Do you know if the scene was included in the asset store releases and if so which versions? Maybe I have an old version laying around with it included if it was.

    Thanks,
    Dermestes
     
  45. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    429
    I don't blame you, UNET is awful to develop for. The only thing it has going for it is that the documentation is average. If anyone is looking at getting into realtime multiplayer, I'd really suggest using Node.JS and Socket.IO

    • Much easier and intuitive to develop for
    • Is fun to develop for
    • Can be hosted just about anywhere
    • Insane throughput if required
    • Open Source
    • 'Everyone' uses it
    • Well-documented
    • The 'BestHttp' plugin on the asset store creates a super simple client socket interface
    I used to advocate UNET as it was the only option on the table without going with another third party. Below is where I am after a few days using Node.js and Socket.io

     
    Last edited: Nov 14, 2020
    Tryz likes this.
  46. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    Howdy. I just updated MC to the latest version and am seeing this compile error when I build:

    Assets/ootii/Assets/MotionController/Code/Setup/Helpers/LayersSetupHelper.cs(86,50): error CS0103: The name 'LoadDefaultLayerDefinitionSet' does not exist in the current context

    Looks like an editor helper is being called from non-editor code...?

    Edit: I wrapped the offending lines in #ifdef/#endif so they're only compiled in edit mode. Seemed to work fine. The code appears to be a helper for setting up layers, and would not be used in-game.
     
    Last edited: Nov 16, 2020
    Tzirrit likes this.
  47. Tzirrit

    Tzirrit

    Joined:
    Sep 9, 2014
    Posts:
    23
    After updating to the newest version in an existing project, none of the motion debug graphics are being rendered any more. Debug texts are still being rendered, but none of the FoA indicators, etc.

    I haven't fully looked at all the changes of GraphicsManager yet, but maybe somebody already found a quick fix.
     
  48. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    That's my mistake... The DefaultLayerDefinitions property should be contained within the #if UNITY_EDITOR directive. I added the property when I made some modifications to include the feedback that the layer setup utilities give in the inspector and apparently missed doing a test build after I did so. Sorry about that.

    I've submitted the fix to the code repository so it should be in the next update.

    In the meantime, either wrap this chunk of code inside #if UNITY_EDITOR ... #endif, or copy and paste it into the existing #if UNITY_EDITOR block (just above the line that reads
    public static readonly string DefaultLayerDefinitionSetPath =
    DefaultPaths.MotionControllerContent + "Data/Setup/Default Motion Controller Layers.asset";
    )

    Code (CSharp):
    1. /// <summary>
    2.         /// Caches the default Layer Definition Set
    3.         /// </summary>
    4.         public static LayerDefinitionSet DefaultLayerDefinitions
    5.         {
    6.             get
    7.             {
    8.                 if (_defaultLayerDefinitionSet == null)
    9.                 {
    10.                     _defaultLayerDefinitionSet = LoadDefaultLayerDefinitionSet();
    11.                 }
    12.  
    13.                 return _defaultLayerDefinitionSet;
    14.             }
    15.         }
    16.         private static LayerDefinitionSet _defaultLayerDefinitionSet;
     
    Tryz and dmenefee like this.
  49. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    I see that @Tryz made a commit for the newest release that looks like it changes the debug shapes to allocate instances from an object pool. I'm not familiar enough with that section of the code base to come up with any solutions on the spot. ;) When I get a chance, I'll try and dig into the code and see what's up -- if Tim doesn't get to it first.
     
    Tzirrit and dmenefee like this.
  50. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    142
    No worries! Thanks :)