开发者

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

开发者 https://www.devze.com 2023-03-16 19:18 出处:网络
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.

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.

  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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消