Search Unity

What networking frameworks are currently available?

Discussion in 'Multiplayer' started by neginfinity, Jan 7, 2021.

  1. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    I'm looking into available options for making a 3d room shared between multiple players, where the room is actually hosted on a server, along with objects in it.

    What networking frameworks are currently available for this kind configuration?

    I'm seeing "Mirror". Is there anything else?
     
  2. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    The thread right above yours discusses this, no? https://forum.unity.com/threads/wha...of-available-network-solutions-assets.609088/

    And seeing as Unity just acquired MLAPI, maybe consider that? https://forum.unity.com/threads/the-open-source-mlapi-project-joins-the-unity-family.1016209/

    I was thinking about making a multiplayer game myself and I would ideally like to use a first-party solution for it, but I'm still not really convinced I won't walk into another UNET "trap" if I go with MLAPI...
     
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    Thanks for the response.

    Basically by now I've checked the thread you linked and I'm pondering what solution is available for server based multiplayer, with dedicated server if possible.

    Mirror looks promising, but there's an issue that it is unclear whether it supports dedicated servers at all, as the forums only mention a paid asset that supposedly implements a dedicated mirror server. MLAPI... well, it sounds interesting, but I haven't checked the docs properly yet.
     
  4. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Well, update this thread if you check the docs for MLAPI, or regardless of what you choose, as I'm curious as well. :p

    I asked some questions for the MLAPI Unity team in the thread I linked. Mainly for me to try and wrap my head around what will happen going forward.
     
  5. BetaMark

    BetaMark

    Joined:
    Sep 27, 2014
    Posts:
    229
    There is actually another thread where we were talking about setting up a Mirror "headless" dedicated server:

    https://forum.unity.com/threads/eng...player-game-using-webgl.1003195/#post-6510606

    Keep in mind that a single dedicated server can be tuned to handle more concurrent players and objects, but there will still be limit of how much you can put into a single room and keep in memory on a single server. If your game or experience needs beyond what you can do in a single server, then you have to start thinking about how to:
    1) break up the server's spaces into areas of interest (zones, shards, rooms, matches, etc)
    2) break up the server functionality so that different aspects of the game is handled by different servers
     
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    That's not a problem, I have highly specific usecase.

    So, the server application is still unity engine, but with (I guess?) graphical output disabled?

    Interesting. This simplifies many things. Thanks for the information.
     
    BetaMark likes this.
  7. BetaMark

    BetaMark

    Joined:
    Sep 27, 2014
    Posts:
    229
    Yeah, it does simplify it a lot since the server is 100% Unity's update() loop and libraries, but it does comes with the limitations you get from their threading (assuming you don't go DOTS).

    And yes, you end up with a binary (exe file if windows) that you run with some particular arguments on the command line, and it just outputs text to the console.

    Fun thing to note about the server though, even though Unity disables the gui stuff when you compile with the server/headless option ticked, they still play sounds just like they would with the client, so you do have to check if you are the server in your code to skip over things like startup sounds and menu music. Since I have most of my headless "server" coded in a separate scene, I just have the first scene in my build order do a check and branch to either the GUI opening menu scene or to my headless server scene.

    Last fun thing to look into -- you can run two copies of the same project (in two different instances of your Unity Editor) by using tools like ParrelSync . That allows you to run both the game "client" and game "server" in editor play mode and debug liked you'd debug a single player game -- which is really where I saw the biggest workflow improvements using Mirror and Unity.
     
    neginfinity likes this.
  8. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    281
    You may want to take a look at this tutorial: http://docs2x.smartfoxserver.com/ExamplesUnity/mmo-demo