Search Unity

uNet Question

Discussion in 'UNet' started by martin999b, Oct 22, 2016.

  1. martin999b

    martin999b

    Joined:
    Jul 14, 2013
    Posts:
    16
    Hello guys,

    I started to learn about uNet networking but only seen examples about host-client networking (where the server is a client too).

    I'd like to learn what would be the correct way of using uNet for the following examples:

    1.) Clash of Clans type of games: All clients connect to a master server, talking about many, like thousands+ clients. Whenever a player is looking for a PvP fight, the master server gives him a list of the potential opponents and when the opponent is chosen the server queries the opponent's base from the database and makes a "copy" of it only available to the attacker client. Then the match starts and the server only communicates to the attacker client (game logic happens on server side).

    2.) Room based games: All of the clients connect to a master server (massive amounts of clients, again) -> matchmaking happens on master server -> matched players get into a seperated "Room". Clients would only send input to the server and the game logic is happening on server side, then the server would push the information to the clients.

    Can someone explain how would these things be done using uNet purely, without any other 3rd party services? Thanks!
     
  2. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    968
    I do not believe there is a single, "correct" way to implement this kind of functionality, but having a master server in charge of the matchmaking logic that dynamically spawns and destroys game server instances handling independent rooms/matches/zones is a common way to design it and can be definitely implemented with UNET. Precisely, the lack of information and readily available solutions in this area prompted me to create Master Server Kit, which leverages UNET's low level API in order to provide such features.
     
  3. martin999b

    martin999b

    Joined:
    Jul 14, 2013
    Posts:
    16
    Wow. This looks great! :O Definietly going to buy this next week and start study your code. Especially because I started to learn node.js as well not long ago.
     
  4. gamevanilla

    gamevanilla

    Joined:
    Dec 28, 2015
    Posts:
    968
    Awesome, thank you! :)