Jump to content
  • Advertisement
Sign in to follow this  
Synex

Multiple server multiplayer

This topic is 4821 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, heres the situation. My game is built using a client/server architecture and i'm busy adding multiplayer capabilities to it. It'll run so that you can set up a server, and people can connect directly to it to play the game with you in a semi-persistant universe. Now, when you set up a game server, the game server contacts my web-server and adds a record to the mySql DB, therefore, when the client wants a list of available servers, it connects to the web based mySqlDB, downloads a list and then pings all the servers in the list and then allows the user to connect directly to the server they chose from the list. Do you think this is the best way of doing this, what alternate ways are available, and how do other games usually deal with this sort of problem? Take for example CounterStrike : Source - how do they produce the server-list? You hardly want to start pinging the entire 'net for CS servers... Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
One suggestion: take the web server out of the picture. If you want to check the database, do it directly from the game's code. That way you don't have to wait for the web-server, and the system is in general less complicated (though there's more coding involved).

Another suggestion: Instead of the client pinging each server to find out if it's alive, maintain a list of all the servers somewhere and just ping them sequentially at intervals of X seconds/minutes. That way when a connection comes in, you already have fairly fresh reports on the status of most of the servers.

Last suggestion: Look into the design of how other systems have solved the same problem, for instance P2P networks that need a constant server list.

Edit: Re-reading your post, a P2P-ish structure for your game servers seems like a better and better idea. Instead of each server checking your webserver and adding an entry to the SQL database to show it's there, have each server occasionally talk to the other servers it knows and say "hey, are you still alive? What servers do you know about that I don't? What's your report on the status of these servers?". This makes it so there's no single point of failure (such as your web-server), but if there's maybe three or four larger servers that maintain a canonical list, it's very easy to make and propegate changes.

Share this post


Link to post
Share on other sites
OP's Idea seems pretty solid especially if you're already experience with mySQL why not?

Quote:
maintain a list of all the servers somewhere and just ping them sequentially at intervals of X seconds/minutes. That way when a connection comes in, you already have fairly fresh reports on the status of most of the servers.


Sure you'd know if they were alive, but the point of pinging them(atleast in multiplayer games) is to get the current latency and that would be different from place to place.

And about the single point of failure thing I view that as a good thing, only one thing to worry about and fix.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!