Game Development Community

Networking question...

by Dreamer · in Technical Issues · 02/17/2005 (10:32 am) · 2 replies

I'm curious as to the network capabilities of the TGE/TSE.
Specifically I would like to accomplish the following with minimal mods to the actual netcode for TGE/TSE.

(1) Setup a single Master Login server for all zones (a zone being a distinct area of the game, note this may or may not be the same thing as a mission).

(2)Have multiple servers running each mission or zone and sharing information back and forth about things such as player location, health, mana etc.

(3)Have the servers load balance automatically i.e. If I have 200 players in zone A and 20 players in zone B, I would like for the zone B servers to help by picking up some slack for zone A.

(4)Allow for player created areas possibly via a key/portal system (I'm pretty sure this could be scripted) the player created areas would run either (a)On special seperate servers owned by us and rented by the players, or (b)locally on the players machine.
Which ever would be the easiest to script and require the minimum of mods to the engine itself.

(5) Do all of the above seemlessly to the player, as far as they know they enter the world after character selection, at a designated point and go from zone to zone without a large delay.

I realize there are technical aspects which will need to be accounted for, such as making sure player created zones, maintain all the game rules, and attempting to keep track of players across multiple zones could be quite painful. But the main jist and the hardest part of all of this to me anyways, would be having all of the servers talking to one another and sharing the relevant information to make this work.

Thoughts?

#1
04/18/2005 (6:20 pm)
Hello dreamer. I just saw this post and seing as I have already implemented a similar situation I thought I'd share.

TGE uses the hearbeat method to send status info to a master server at server creation and then every two minutes there after. The default TGE master server accepts a lot of data which you may not necessary need all of in your game concept.

(a)
To use your own master server, modify/replace the sendHeartbeat function in game/net/serverQuery.cc to send your server I.P. address, number of players and other relevant info to a master server you have created and can communicate with.

I did mine by sending an HTTP POST to a web-server CGI script storing the data in a mysql database.

(b)
To achieve your above goals you now need the client to contact your master server and get the current list of available server addresses, number of players etc. Your master server will need to have stored sufficient data to enable your client to make informed decisions about which server/zone to join etc.

I got mine working by modifying startMissionGui.gui to contact my master server via HTTP and obtain the current list of servers. To join a particular server you just call
%conn.connect($ServerInfo::Address);
with $ServerInfo::Address being set to the I.P. address and port of the server you have decided to join.

It's that simple really. To join a game you only need the servers I.P. address and port and you can create your own means of obtaining those as above.

Your master server, at its simplest, need not even have a database. You can do it with a CGI script writing to a file if necessary. Each heartbeat updates/re-creates the file and each client request just downloads the file and does what it wants with the data.

Hope that helps
#2
05/04/2005 (6:55 am)
Wow, I had forgotten all about this post, and just happened to stumble across it, today.

Anyways thanks for answering.

After having looked really deep into the guts of the engine, what I wanted to do before (hosting a single realm across multiple servers), does not appear possible with the netcode, however I have been looking a little harder at OpenTNL and think i may be able to modify it to accomplish at least some of my goals. Failing that, I'll just build around the limitations of the netcode, and work it into my game.