Search Unity

MLAPI what's missing? (documentation, samples, tutorials)

Discussion in 'Netcode for GameObjects' started by luke-unity, Jul 27, 2021.

  1. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    We're currently in the process of planning for new documentation, tutorials and sample content. If anyone has some suggestions for topics we should cover please let us know. Any input is appreciated. For instance if you just recently started using MLAPI let us know about any major stepping stones which you encountered.
     
  2. danb1

    danb1

    Joined:
    Jun 14, 2019
    Posts:
    24
    I started using MLAPI about two months ago with no prior experience with Unity multiplayer code. I haven't used any of the samples, I do refer to the documentation and tutorials often. Not having tutorials for Rpc calls and NetworkVars slowed me down a bit.

    The bigger stumbling block for me has been the lack of documentation for errors. A lot of features are entirely missing from the documentation, e.g. it took me a long time to debug that ServerRpc calls by default require ownership or an error shows up that reads "[MLAPI] Only owner can invoke ServerRPC that is marked to require ownership". A documentation page references this error directly (https://docs-multiplayer.unity3d.com/docs/troubleshooting/errormessages/index.html) but then doesn't actually provide the fix, which is to set the RequireOwnership flag. At the time I had the bug, I only found that solution on a unity answers page (https://answers.unity.com/questions/1829224/unity-mlapi-serverrpc-not-getting-called.html).

    I would say half the errors I run into are like this (opaque error message, missing documentation, answer in a vague forum post). If you just go through the forum posts and grab every error message anybody has asked about and make sure those show up on the troubleshooting page, that could save a lot of people a lot of time.
     
    Sneirox, billw2011, UnityGio and 2 others like this.
  3. boyaregames

    boyaregames

    Joined:
    Jun 23, 2021
    Posts:
    76
    1) How to get objects that exist on a server and after a client is joining he is instantiate them.
    2) NetworkedVars and OnValueChanged (also working with NetworkedList)
    3) Naming conventions of Networked fields, RPCs, methods...
    4) Working with MTU? (sending media (images, audio) from host/server to a client)
    5) Events (on client connected/disconnected, on server shutdown...)
    6) Good practice of using RPCs
     
  4. Pathfinder007_ZA

    Pathfinder007_ZA

    Joined:
    Jul 29, 2021
    Posts:
    15
    Hi i am a BSC IT student and in my spare time i thought of creating a 2D MMORPG. I just started using MLAPI, I'm really eager to actually dive deeper, however im finding it really hard understanding basic RPC's, how the networking works in depth, and general concepts.

    Is there an advanced guide i could walk through yet ?
     
  5. Talkyn

    Talkyn

    Joined:
    Apr 13, 2019
    Posts:
    8
    I would have to say that getting started is pretty difficult at this point. Even just figuring out basic 2D movement was impossible without digging through the ByteSizeSamples. I used the 2D shooter and was able to get my head wrapped around the flow for client to RPCs and how Network Variables worked with the Network Transform, etc... but to be honest I just know that what I have cobbled together is working--I just assume I understand how things are passed back and forth.

    I'm currently struggling with getting an RPC to fire on a gameObject the players should interact with. The RPC gives an error regarding required ownership and a forum post yields the tidbit about RequireOwnership = false, but now the RPC just doesn't fire. Looks like I have a faulty assumption somewhere. Actually, somehow typing this has made me realize the GameObject in question is just in the Scene and not a prefab on the NetworkManager list. That must be it. Oops!

    My actual point is I don't find any of the documentation has given me a clear picture of how the system is intended to work; how the components are intended to interact. Now, I understand documentation takes significant time and energy to create, so leaving it to samples this early in the game (pun intended) is totally fine. But, I find the samples extremely limited and largely unrelated to the kind of games I am trying to make.

    I think it would be most helpful to take some of the existing Unity tutorial minigames and convert them to simple multiplayer versions. This, combined with a short article that explains how the same functionality was implemented via Netcode would be a great set of tools to take my existing Unity knowledge and make basic multiplayer games. This would also make multiplayer sit nicely as an intermediate or advanced step in development for new Unity users, since they could build one of the standard basic projects are single-player first, then learn with that exact same project how multiplayer is inherently different.

    That's my 2 cents anyway.