Archived

This topic is now archived and is closed to further replies.

IronFist

A list of games on a server like in Quake and Doom?

Recommended Posts

For my game, I want you to be able to go to "join game", then it takes you to a screen that shows you all of the games on the server. I can''t figure out how to do this though. How can I make all of the host computers send out their data (Like their game name) out to the screen so the people who are trying to find a game can connect to any one of them?

Share this post


Link to post
Share on other sites
Have game info on a server that recives game info broadcasts. So when a game starts up...it shouts to a server ''hey i''m up and running and I have this available'' ... then your client just asks for a list of those running from taht server that keeps track of that...

Seems simple to me...



Jenison
''There is no reason to have math part of the curriculum in schools. Why should we have to know 2x = 3y - 5. We have computers now." - Rosie O''Donnle

Share this post


Link to post
Share on other sites
My game is set up so who ever starts the game is the server, and everyone who joins the game are the clients. I don''t understand how or where to send the data that "this computer is a server" and "this computer is looking for a server to join."

Right now I am just printing the name of the host''s computer onto the host''s computer screen. Then, the clients can type in the name of the host''s computer to join that computer. It works great if everyone is in the same room because whoever is the host can just tell everyone what name to join. But I want it so people in a lot of different rooms can join a game without having to know the name of the computer. And like I said before, I want to be able to have a lot of different hosts just like in Quake or Doom so the clients can choose which host to join.

Does anyone have any code examples or links to a place that shows me how to do this?

Share this post


Link to post
Share on other sites
As Jenison tried to say, the usual method is to have one or more "master server". The purpose of a master server is to advertise the availability of game servers. When a game server starts up it tells a master server "this is my IP address, this is the name of the game, this is my player limit" etc. It may update the master server when players connect or disconnect to let it know how many people are currently connected. When a client is interested in joining a game, it asks (one or more) master server for a list of games. This is basically how GameSpy works.

The concept to understand is that you need a common point of reference between the client and the server. Above it is the master server, which has a commonly known IP or host name. It could also be the communication channel. In a LAN scenario you can use broadcast or multicast to communicate your presence to other processes. This could work by the server sending out "I am here" messages periodically, or (more efficiently) have clients say "hello servers, please tell me where you are and what your game details are", to which the servers reply "here I am". This is not practical on the Internet, however. It mirrors what you do if you''re playing in the same room - you say "hey, stop gorging on pizza, and tell me who the hell is running the server!", to which the owner of the server says "I am, ya prick, my host name is foo". You may get multiple replies if there is more than one server running. Of course you should only ask for the game you''re interested in.

The traditional method is the least convenient - call up your friends or meet them on ICQ/IRC and tell them that you''re about host a game at a particular IP address. Here the common point of reference is the phone, ICQ, or IRC.

Share this post


Link to post
Share on other sites