Search Unity

[UNet] How to Implement Dedicated Server for Hosting Duels?

Discussion in 'UNet' started by Dmtuan, Feb 27, 2016.

  1. Dmtuan

    Dmtuan

    Joined:
    Feb 25, 2013
    Posts:
    4
    Hi,

    I have this multiplayer game coded using the new Unity Networking system, where players fight in duels. I would like to have a server to do matchmaking and hosting duels. The way I imagine it is that players would click "Find opponent" button in the game and they would queue in matchmaking system and the server would pick 2 players and then the server would host the duel. So I want to have my own dedicated game server that people could be able to connect to over internet. I have the game working over LAN - so 1 instance of the duel. I have no idea how to write the server aplication that would create and manage many duel instances.

    Could someone please tell me in general what I need to do? What could I use to do the matchmaking? Thank you in advance.
     
  2. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    968
    UNET already provides matchmaking facilities with its Internet Services (currently in free preview mode with 100 CCU; final pricing details have not been announced yet). You can find the official documentation on how to set them up in your project here. It is a very straightforward process but there are some known bugs (more specifically, note this one and this one in particular).

    You can have player hosted games, but if you want a dedicated server you can run a Unity headless instance (more details here) or wait until Unity releases the server library (which was initially planned for 5.4 but has been delayed; you can find more details here).
     
    Dmtuan likes this.
  3. Dmtuan

    Dmtuan

    Joined:
    Feb 25, 2013
    Posts:
    4
    Thank you for the info. I will keep my eye on the server library.
     
  4. Erdrako

    Erdrako

    Joined:
    Jul 1, 2016
    Posts:
    4
    Hi! How did you manage to implement LAN with Unet? im a noob with networking and so far i was trying to make a subnet scanner to then pass the ips to Unet.. Could you please help me with that?
    Thanks in advance!