s-ol wrote: ↑Wed Mar 01, 2017 9:26 pmIf you read up on NAT-punching you will realise you do need that master server in any case
You only need it if players have no other way to discover each other's IP. If people can exchange IPs because they already communicate by some other method, you don't need it.
from a regular game design perspective: if you want people to play without looking up each other's IPs, you need some central place to talk to
True, but if you have something more like dedicated hosts than P2P, hosts can register domains that players can remember and add to their own server lists. Minecraft sold millions of copies on mobile doing it this way. Master list is nice to have, but not essential.
If you did it this way and used the
pwnat trick, you can have holepunching without the host needing to be given the client's IP (so, no need for a master server). Although I suppose if people are hosting dedicated game servers, holepunching won't be much of an issue.
zorg wrote:after connecting to a server that's "open", i.e. not behind a NAT, would simply sharing the client adresses with the other connected clients, and opening connections to those from "both" sides work or not, with or without any special hole-punching.
If the server's not behind a NAT, you don't need holepunching. The client just needs to be able to find the game server somehow (player knows host's domain name or IP, or hosts register with a "master server" and players pick them from a list, or there's only one game server and clients are hardwired to it).
Edit: I misread your question. What you're describing
is holepunching. Have a look
here. The thing is, the clients aren't really "connected" to the server, they just told the server how other clients can find them, essentially, and the server tells them how to find other clients they're interested in, and then those clients don't talk to the server anymore, they just talk to each other (so at this point we should call them "peers" and not clients, I guess). This is why you don't actually need the server at all if players can exchange IP addresses some other way; for example if you're just testing a prototype this should be fine, you can write the "master server" code later.