Search Unity

Overview of multiplayer support in Unity

Discussion in 'Multiplayer' started by PatrickOne1, Apr 21, 2021.

  1. PatrickOne1

    PatrickOne1

    Joined:
    Nov 17, 2020
    Posts:
    3
    Unitys multplayer page is really confusing and lacks an overview - so please share one here!
    On some places it says the Boss room example uses Netcode package (which is available in package manager and which also needs the Transport package) then another example shows you should download the MLAPI package (from github).
    How does NetCode, Transport, MLAPI and DOTS fit together?
    Which are used in the Boss room example?
     
  2. I haven't actually installed it yet, I just finished to read the guide, so I'm maybe wrong about this.

    Boss room only needs MLAPI and either Photon Transport for MLAPI OR port forwarding, in case you want to try to run it over the internet. I got this from here.
     
  3. GarryPearl

    GarryPearl

    Joined:
    Apr 21, 2021
    Posts:
    1
    I mostly like when you talk about these things in your own words with less focus on reading their text out loud. Glad that you brought this to my attention =) Keep being awesome!
    clicks per second
     
    Last edited: Apr 22, 2021
  4. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    Sorry for the confusion. I agree this is all indeed very confusing. Hope the following helps.

    Our (currently not deprecated) networking solutions are:
    Unity Transport => A low level transport package for sending raw data packets.
    Unity Netcode => DOTS ECS based networking solution. Only works for DOTS ECS based projects. It is built on top of 'Unity Transport'.
    MLAPI => GameObject based networking solution. Does not yet use 'Unity Transport' as the low level transport but our old 'LLAPI' transport.

    From the above solutions Boss Room uses 'MLAPI' only. As transport it uses 'LLAPI' (our old transport) and a third party transport called 'Photon Realtime'. This is possible because 'MLAPI' has a interchangeable transport layer.

    On some places MLAPI is referred to as 'Netcode Core'. 'Netcode Core' != 'Unity Netcode', it is just another name we use for MLAPI :).

    Code (csharp):
    1. On some places it says the Boss room example uses Netcode package
    Where do we say that?
     
  5. PatrickOne1

    PatrickOne1

    Joined:
    Nov 17, 2020
    Posts:
    3
    Thanks for the clarification.
    I spent hours yesterday trying to figure it all out, traversed to many pages to remember the one place it said Boss Room used the Unity Netcode package, but most places said the experimental netcode package and not Netcode Core - but now i know they are the same :)
    It's extra confusing the you have this https://docs-multiplayer.unity3d.com/docs/transport/introduction at the same menu as MLAPI, but I guess this is the LLAPI that mlapi uses: https://docs.unity3d.com/Manual/UNetUsingTransport.html
    Is there any more detailed documentation for the LLAPI that the Boos room uses?
     
  6. PatrickOne1

    PatrickOne1

    Joined:
    Nov 17, 2020
    Posts:
    3
    As a CIO I should probably ask about this as well:
    Will your new mlapi solution work on android and will we need a dedicated server or will it support a local isten server on one of the multiplaying persons tablet/phone?
    Also, will everyone be able to connect over internet without fiddling with router settings or Photon relay server to play co-op on their phone? (because the common phone users want accept that and will download another game instead)
     
  7. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    Yes there is some detailed documentation about LLAPI but you have to set the Unity docs back to an old version (before we deprecated LLAPI) to see them like this: https://docs.unity3d.com/2017.4/Documentation/ScriptReference/Networking.NetworkTransport.html
     
  8. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    MLAPI works on android. You will need a dedicated server or a relay server. You will have to fiddle with a relay solution like Photon Realtime but once that's setup your users will be able to connect to each other as if it were a direct connection (they won't know that there is a relay involved).

    Mobile games always need a relay or dedicated server to connect, there is no way to connect to a mobile device which is connected over mobile data.