Search Unity

Using a Dedicated Server with Unity Multiplayer

Discussion in 'Multiplayer' started by Dory_05, Apr 18, 2019.

  1. Dory_05

    Dory_05

    Joined:
    Apr 14, 2019
    Posts:
    4
    I've noticed that there is a concurrent user limit with the unity license, so I'm planning to set up my own dedicated server. I'm wondering if I can do that with the Unity API, and if I can, does the users connecting to the dedicated server count towards my concurrent user limit?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The whole point of the Unity Multiplayer Service is to connect players in the absence of a dedicated server. If you are building a dedicated server game there is no reason to pay for this service.

    As far as using the Unet API, it can be used in this way, but since it was deprecated over a year ago in a buggy and unfinished state, starting a new project using it is not a sane choice.
     
  3. Dory_05

    Dory_05

    Joined:
    Apr 14, 2019
    Posts:
    4
    If the Unet API is deprecated, what other alternatives are avalible in Unity 2019?
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  5. Dory_05

    Dory_05

    Joined:
    Apr 14, 2019
    Posts:
    4
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The exact steps would depend on the specific networking API you use.

    For the Unet HLAPI for example, you can in the inspector set the Network Manager component to automatically connect to the supplied server address/port on start up. Calling some "connect" method is a common approach across most network solutions though.
     
  7. Dory_05

    Dory_05

    Joined:
    Apr 14, 2019
    Posts:
    4
    I don't intend on using Unet, since it'll be depreciated, I intend on using the new system. Do you by any chance know how this would be done on the new API?
     
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,982
    As @Joe-Censored said twice now, it is dependent on what networking API you use. We cant tell you how to do it "with the new API" when you havent told us what new API you are using.

    In case it wasnt clear, no there is no official replacement in unity for UNET (which is what I think you meant by "new api"), you need to find another networking API to use. Whether or not people can help you with it depends on if they have used that API.


    I recommend looking at mirror simply because it is mostly 1:1 with UNET and easy to switch over to, and actually documented well too. That said I dont know about dedicated servers and if it is useful for that, not experienced in that. You will need to research that yourself
     
  9. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    The MLAPI has an API and structure very similar to UNET and supports Dedicated server projects unlike Mirror and UNET. Worth checking out. It also has many more features and is significantly faster in many (most?) cases.
     
    Dory_05 and MadeFromPolygons like this.
  10. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,982
    OP there you go, already got a good suggestion. I have used MLAPI before and can confirm it is a great networking API.

    The only reason we are using mirror currently in our project is that we have had to do a quick uplift from UNET to working networking and mirror provided the quickest (~ 5 mins) path to upgrade with pretty much 0 code loss (based on usage of MLAPI from more than 6 months ago that is, things have likely changed as its updated regularly and I have not kept up to date with its progress). That said, MLAPI was not that significantly harder to upgrade to from UNET even when I was using it so you should be alright with it.

    The dude who suggested it above is actually one of the MLAPI devs so you can likely contact them for any help regarding it, they seem very active in providing support and the discord seems active too
     
    TwoTen likes this.