PGD Home

T3D Multiplayer game debugging

by on Mar.28, 2014, under On Game Development, Software and Games

I am at the point where I am reading to begin preliminary testing of my latest game, Star Commander. I have already done most of the testing that I can do over the LAN, but I have not been able to test the game over the internet. This seems to be because of how networking works within T3d, andpossibly other engines as well.

Basically, T3D games use a “master server” to store a list of game servers, including their IP address, game type, and various other pieces of information.

When a T3D game server is created, either as a dedicated or non-dedicated server, it’s details are added to the master server.

Game clients then query the master server using some parameters, such as game type, level type, etc, and if any matcing game servers are found, the IP address of this game server is passed to the querying client.

The client then queries any game servers that it receives, and if they answer, the game server is displayed in the gui.

The player chooses one of the displayed servers, connects, and joins the game.

This is all relatively simple, but consider the fact the when testing a game, you will likely have access to only one internet connection. You may have several machines to test with, but they will all be on the same network. For T3D LAN games, this is fine, but, for internet games it poses a problem.

If the dedicated server and the client are on the same machine, there can, however, be problems with port forwarding, NAT settings, etc. The way I understand it is that when the client queries the master server, it receives a list of viable game servers. Assume for now that there is only one game server in this list, and it is on the same machine as the client. Now, the client will have to query the public IP of a game server on it’s own network (when normally it would use a local IP). Due to port forwarding, this should work. The client’s request should be forwarded from the external IP of the game server to the internal IP, and it should succeed.

However. When the game server attempts to send a reply back to the client, it will probably use the clients local IP, since the request originated from the local nerwork, not the internet. Since torque is expecting to connect to a server on the internet, it will be listening for a query response from an external IP, not an internal IP, and so it may fail, and not display that server in the server list.

There is an excellent post about this issue on the garagegames forums HERE.

I believe this is what is happening in my case. I am seeing the following trace in my console:

ServerQuery:  start Querying master server 0
No master servers found in this region, trying IP:198.101.240.242:28002.
Requesting the server list from master server IP:198.101.240.242:28002 (2 tries left)…
Received server list packet 1 of 1 from the master server (1 servers).
Pinging Server IP:86.46.103.164:28000 (3)…
Pinging Server IP:86.46.103.164:28000 (2)…
Pinging Server IP:86.46.103.164:28000 (1)…
Pinging Server IP:86.46.103.164:28000 (0)…
Ping to server IP:86.46.103.164:28000 timed out.
ServerQuery:  query Querying servers: 0 left… 0.5
ServerQuery:  done No servers found. 1
ServerQuery:  start Querying LAN servers 0
LAN server ping: IP:Broadcast:28000…
Pinging Server IP:192.168.1.6:28000 (3)…
ServerQuery:  ping Waiting for lan servers… 0.5
ServerQuery:  query Querying servers: 1 left… 0.5
Querying Server IP:192.168.1.6:28000 (3)…
ServerQuery:  query Querying servers: 0 left… 1
ServerQuery:  done One server found. 1
ServerQuery:  start Querying master server 0
No master servers found in this region, trying IP:198.101.240.242:28002.
Requesting the server list from master server IP:198.101.240.242:28002 (2 tries left)…
Received server list packet 1 of 1 from the master server (1 servers).
Pinging Server IP:86.46.103.164:28000 (3)…
Pinging Server IP:86.46.103.164:28000 (2)…
Pinging Server IP:86.46.103.164:28000 (1)…
Window focus status changed: focus: 0
Using background sleep time: 200
Pinging Server IP:86.46.103.164:28000 (0)…
Ping to server IP:86.46.103.164:28000 timed out.
ServerQuery:  query Querying servers: 0 left… 0.5
ServerQuery:  done No servers found. 1

This line:
“Received server list packet 1 of 1 from the master server (1 servers).”

Seems to indicate that the game server is being retrieved from the master, but it is timing on when queried. This is likely due to the problem I described above. I maybe able to fix this by modifying my network settings, but if not, I will have to look for other options.

It’s too early at this stage to hire Beta Testers, or even ask for volunteers. I could try running the game server or client inside a virtual machine of some kind, such as VirtualBox. I have never tried this, but I would guess it could be setup to emulate a connection from outside the local network.

In any case, other than obvious firewall and port forwarding issues, an internet game and a LAN game are not really that different.

Facebooktwitterredditpinterestlinkedinmail

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!