Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411993 Posts in 69441 Topics- by 58486 Members - Latest Member: Fuimus

June 17, 2024, 02:59:38 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Multiplayer Servers
Pages: [1]
Print
Author Topic: Multiplayer Servers  (Read 2680 times)
brog
Level 7
**



View Profile WWW
« on: August 23, 2008, 07:45:41 AM »

So I'm working on this game that kind of has a significant multiplayer focus.  At the moment to join games you have to type in the IP address of the host.  Lots of games seem magically detect games on the local network, which is a nice feature but I have no idea how to implement it.  First question: does anyone know how to do this?  Googling for a tutorial doesn't work very well; I just find lots of people trying to play existing games.

I think doing this over the internt is quite a different thing to doing it over a local network; I expect you'd need some kind of fixed server to maintain a list of available games.  Second question: how would I go about setting something like this up, and what kind of cost and effort would I be looking at?  Third question: is this necessary; would people not like a game if there is not some kind of matchmaking server?
Logged
Ragzouken
Level 0
***



View Profile WWW
« Reply #1 on: August 23, 2008, 08:02:36 AM »

I've always wondered how it's done on the local network and I still don't know. When it's over the internet then usually a 'master server' is used which hosts register themselves at and regularly update their game status. It's a nice feature to have, especially for games where it might be difficult to find many people to play with you. Setting that kind of thing up can be as easy as running a php script with access to a mysql databse on any server you can get permission to use. I am wondering if you could use google app engine as a master server.
Logged

jonny
Level 0
**



View Profile WWW
« Reply #2 on: August 23, 2008, 08:08:48 AM »

Maybe you could scan all possible IP addresses on the LAN and check to see if they respond. Tongue Should be a better way of doing it though...
Logged
Ragzouken
Level 0
***



View Profile WWW
« Reply #3 on: August 23, 2008, 10:34:04 AM »

My very reliable sources tell me that the method you describe is how it's done, jonny. A player basically asks everyone on the network if they have a server. Which is achieved by sending the query to 255.255.255.255 or something like that.
Logged

muku
Level 10
*****


View Profile
« Reply #4 on: August 24, 2008, 11:23:22 AM »

Exactly, UDP broadcasting is the secret. I've actually done this before, it's not too hard.

Here's a link: http://tangentsoft.net/wskfaq/intermediate.html#broadcast
Logged
brog
Level 7
**



View Profile WWW
« Reply #5 on: August 24, 2008, 02:28:33 PM »

Exactly, UDP broadcasting is the secret. I've actually done this before, it's not too hard.

Here's a link: http://tangentsoft.net/wskfaq/intermediate.html#broadcast

Excellent, thank you.  This will come in handy.
Logged
bateleur
Level 10
*****



View Profile
« Reply #6 on: August 25, 2008, 12:23:43 AM »

I think doing this over the internt is quite a different thing to doing it over a local network; I expect you'd need some kind of fixed server to maintain a list of available games.

Not only that, but the fixed server actually has to pass data between the clients because otherwise you face the problem of trying to tunnel in through people's NAT firewalls to connect directly to the other players. That's unpleasantly tricky and prone to error.

For non-commercial games a decent way around this problem is just to suggest that players run something like Hamachi.
Logged

Ciardhubh
Level 1
*


View Profile
« Reply #7 on: August 25, 2008, 01:37:53 AM »

Second question: how would I go about setting something like this up, and what kind of cost and effort would I be looking at?  Third question: is this necessary; would people not like a game if there is not some kind of matchmaking server?

If you only want to offer a service for finding other players, it can be as simple as a database (or flat file  Roll Eyes)-backed Web service, PHP-script or even a public database that clients access directly.

I'd say a Web service with an SQL database would make for a good server/player directory. However this requires a bit of knowledge and a server capable of running both the database and the web service container. The easiest low-tech version that comes to my mind right now, would probably be a PHP script that writes to a text file. This should be possible with low-cost web space providers, since all you need is the ability to run PHP scripts. Although it probably scales badly, it should be sufficient for small games.

In my experience, multiplayer games without some sort of global directory or lobby are not played online. You're basically restricted to playing with a few friends. Finding other players is too complicated and few will try. Even many multiplayer indie games with such a directory don't attract enough players. Making it harder to find other players is yet another stumbling block. Personally I just hit escape when a games asks me for an IP to connect to :D
Logged
brog
Level 7
**



View Profile WWW
« Reply #8 on: August 25, 2008, 05:52:48 AM »

For non-commercial games a decent way around this problem is just to suggest that players run something like Hamachi.

Unfortunately I have dreams (delusions?) of trying to sell this game for money so I'm trying to do things as properly as I can.
Logged
lara1
BANNED
TIGBaby
*


View Profile
« Reply #9 on: January 09, 2009, 08:48:46 PM »

« Last Edit: January 09, 2009, 11:31:08 PM by Derek » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic