[GD-General] Basic questions regarding networking games...
Brought to you by:
vexxed72
From: Colin F. <cp...@ea...> - 2002-09-23 21:39:19
|
2002 September 23rd Monday I have a few questions, but first I'll provide a hypothetical context: INTRODUCTION: ============= Let's say you have a small multiplayer game, and let's say you want it to run on a LAN. Let's say you start the server, and later a client starts up, but the client doesn't know the IP of the server. Now let's say that the server has a preferred range of ports, say: 32000, 32001, 32002, 32003, 32004. (Only one available port is actually used by the server, but the server will attempt to acquire a port from the range above, and clients will know that a server could be running on one port within this range.) The client can do a UDP broadcast on the subnet, say 192.168.1.255, to each of the ports in the preferred port range of the server. The server can respond when it gets the client query. QUESTIONS: ========== [A] For *Internet* games I assume service WWW sites like GameSpot, etc, advertise the IP's and ports of game servers -- or you can indicate the IP and port number of your server through any other means (phone call, e-mail, chat, etc). QA1: Is this the dominant way to discover *Internet* games? [B] For Internet games the port(s) can be fairly arbitrary (anything above 1024 and below 65536, right?), but for convenient "discovery" of servers on a LAN it might be nice to have a few preferred port candidates to try -- instead of broadcasting to all 64000 ports in a brute-force search. QB1: How might one select "default" port ranges for the convenience of LAN clients searching for servers? QB2: Might a server on a LAN advertise itself periodically, like once per second?...Perhaps only during the "join" phase of a game (if players can't just jump in at any time)? This sounds pointless when clients can essentially do the queries as needed, but maybe when the server is on a totally random port (but advertises itself on a known port), it might make it easier for clients to discover the server (just by listening on a known port for the unsolicited broadcasts of the server). [C] Some applications have one "well-known" port for initiating sessions and create ports for handling those sessions. QC1: Sorry for my ignorance, but do you think it's okay to have all clients send UDP to the same server port for processing? (So each UDP packet has a "Client ID" to demultiplex the packets.) QC2: Even if all UDP traffic can go to a single server port, do you think there might be some benefit to having a seperate port that is strictly for joining the game? (The "real" game might be some RANDOM port, but the service for joining the game might be on the "well-known port range".) QC3: To your knowledge, do many first-person shooter deathmatch games just feature a single UDP port for all game-related traffic? I basically want to learn from the experience of others regarding the basic mechanics of "discovering" servers (Internet and LAN), choosing port(s), and choosing a total number of used ports for a single server. --- Colin cp...@ea... |