Search code examples
udpmultiplayer

Multiplayer game using UDP: How do the players get to know each other?


I'm making a multiplayer mode for my game and I decided to use UDP.

Since all the data is sent p2p, between the players, I have no server.
But how do the players get to know each other in first place?
Do I need a server dedicated to do this job or is there any other way?

Thanks.


Solution

  • There's several ways you can do this.

    1. You could use a server dedicated to it.
    2. You could let users enter in an IP address for another player.
    3. You could use something like Bonjour.