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 firs开发者_Python百科t place? Do I need a server dedicated to do this job or is there any other way?Thanks.
There's several ways you can do this.
- You could use a server dedicated to it.
- You could let users enter in an IP address for another player.
- You could use something like Bonjour.
Most networked multiplayer games use some form of service for listing players, and I can't think of many examples where it would be advisable to not use a server for this. Keep in mind that it doesn't have to be a dedicated server, you can simply have one of the clients play a server role for the listing, even if this is the only server type behavior needed by the game. This way each player will only have to know the one IP, and there's even ways around that if it's LAN play.
精彩评论