Search Unity

New to networking, how do I host games for others to see?

Discussion in 'Multiplayer' started by tomicz, Sep 26, 2020.

  1. tomicz

    tomicz

    Joined:
    Mar 16, 2015
    Posts:
    152
    Hello there,

    I am about to create my first multiplayer game, never did it before. I am using MLAPI, the games can be hosted locally and joined with other players easily. But how do I proceed with the same thing online?

    I want to create/host a game, give it a name, player limit, etc, then wait for others to join. But how do others can see my game? Do I use a database to achieve this? I have a lot of experience with Firebase. So when i share a game, what do I share? ip? port?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You set up a dedicated server which hosts the matchmaking / lobby functionality. I don't know if MLAPI has this functionality turn key ready to go, or if you need to write your own system for it. But basically when a player wants to host or look for available games, they connect to your matchmaking server. The server provides the list of all games to any clients, and responds to clients wanting to host a game, listing the new game for any other clients.
     
  3. FakeByte

    FakeByte

    Joined:
    Dec 8, 2015
    Posts:
    147
    Additionally you also want to use a NAT facilitator to establish connections between players.
     
    Joe-Censored likes this.