Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411482 Posts in 69370 Topics- by 58426 Members - Latest Member: shelton786

April 23, 2024, 11:48:58 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityJams & EventsCompetitionsVersus (Moderator: Melly)Networking Solutions or: How Do I Play Over The Tubes?
Pages: 1 ... 3 4 [5]
Print
Author Topic: Networking Solutions or: How Do I Play Over The Tubes?  (Read 45235 times)
Riley Adams
Level 5
*****


I don't actually use Ubuntu much...


View Profile
« Reply #80 on: January 30, 2011, 10:01:47 PM »

Is there any method to have a program find another program who is listning for it and who is on a seperate machine across the internet, without using a permanent server.

Well, this is using a permanent server I guess, but not a pricey dedicated server or anything... but if you have access to web hosting (I just bought a year of hosting and domain for $30, it's cheap), you could probably make the clients check in via a php script or something, and keep a list of those ip's looking for games in an sql database. You'd have to clean out the old ip's somehow, but it's certainly possible. Shrug
Logged

Mega
Level 1
*



View Profile
« Reply #81 on: January 31, 2011, 01:41:45 AM »

Riley, The method I was thinking of was this;

uload a hidden text file on some free text hosting site. when a user creates a game, the program writes to the file appending the user's IP address and taking care not to alter the file in any other way. It checks the number of lines in the file and remember its line position as well as all the other IP addresses there. it saves(or updates) the file and forgets about it. so now when other users load that file they will find his IP address and can say "hey what are you up to?" so forget online, the user would thus be 'onfile' through out the game loop the clients would copydownload the file check it for any new IP's or missing ones, then delete it. this download step might be unnecessary
since when a user chooses to disconnect from ...'the file' it could first shoot a packet to all the IP's saying "go check the file im going to write to it" then go to its line number and deletes it or does this on the clients computer then upload and replace the file or all its content.
infact anytime a client affects 'the file' it sends a packet to all the on file IPs there found telling them to "hey, I touched the file, go check out the file"
This theory seems tantilizingly possible. I will call it the 'Wild West Theory' or 'Nomad Theory' or 'Wild West Nomad Topology' or.. anyway we just shoot packets around the web where ever we can pitch a 'file'.


most reasonably it would be best for sites that charge for per kb/month traffic, all we would need is a few kb to read write to the file  .
now that I'm finished writing I bet its too good to be true.  Cry

opinions?
« Last Edit: February 01, 2011, 03:03:39 PM by Glinka » Logged
Oddball
Level 10
*****


David Williamson


View Profile WWW
« Reply #82 on: January 31, 2011, 02:24:29 AM »

but if you have access to web hosting (I just bought a year of hosting and domain for $30, it's cheap), you could probably make the clients check in via a php script or something, and keep a list of those ip's looking for games in an sql database. You'd have to clean out the old ip's somehow, but it's certainly possible. Shrug
This is how I do it. I have an SQL database, that I access through php, which lists all games that are listening for players and the info needed to contact them. A game can remove itself from the list once it's done or keep itself active in the list by 'checking in' every three minutes. If a game hasn't 'checked in' in over five minutes then it's automatically removed from the list.
Logged

MedO
Level 1
*


View Profile
« Reply #83 on: January 31, 2011, 03:45:58 AM »

1.5 Years is about right for your numbers, so that's definitely not the way you want to go. You will need a fixed server of some kind.

One option would be to use an always-on PC or laptop in your house. You will want to register a hostname at a free dynamic DNS provider, especially if you get a new dynamic IP from your internet provider every day. That way you can refer to the server with e.g. mylobby.myfreednsprovider.com instead of a fixed IP, which is also useful if you decide to switch to a different server later. That's how we did it in the early days of Gang Garrison, with an old laptop in a corner.

You could rent a virtual server, but that's relatively expensive (in the order of 10€/month for small packages). Renting some webspace with a small database as Riley Adams proposes sounds like a good alternative if you can come up with (or find) php code for that.

As an alternative, I'm now offering the lobby server at ganggarrison.com for use by games in this compo. See here for details: http://forums.tigsource.com/index.php?topic=17542.0
Logged
Mega
Level 1
*



View Profile
« Reply #84 on: January 31, 2011, 10:09:03 AM »

@Medo:
Here's the plan. I'll buy a cheap computer to act as a server. whats more important? RAM or speed? what harware should I emphasize?.
Then I'll put that computer in a corner, of around 90 degrees, I'll route it to the cable connection.

Should I install windows or special server OS? This will be the only type of thing i'll use this computer for, so what should I install?

Then hopefully the software installed would have the capability to run an instance of the game (ie: run exe files). then we can shoot packets all over the place all day, or all year. without bumbing with online files and php lookups and refresh.
clients would log directly to this dedicated server 'get hooked up' or find IPs to play directly or whatever else.

Is there anything i'm overlooking or over simplifying guys? or is it as feasible as it sounds??
Logged
MedO
Level 1
*


View Profile
« Reply #85 on: January 31, 2011, 02:15:52 PM »

First off, before you buy any stuff just for this, reconsider using the ganggarrison.com lobby. If I understand what you're proposing, it already does what you want.

I'll answer your questions assuming you only want to run a lobby server. For a game server you'd probably need a lot more power, and everything would depend on the game you want to run on it.

@Medo:
Here's the plan. I'll buy a cheap computer to act as a server. whats more important? RAM or speed? what harware should I emphasize?.
I'd say the most important thing is that it's quiet and doesn't eat much electricity (the cost does add up). What kind of hardware you need depends on the lobby software you want to use, but if that software is remotely sane it will run on any halfway decent hardware. I used an old 500MHz laptop back then, and it had below 5% CPU use. Whether or not RAM will be an issue depends on the software; For anything Java based I'd recommend at least 256MB and additional swap space.

Quote
Should I install windows or special server OS? This will be the only type of thing i'll use this computer for, so what should I install?
That depends completely on the software you want to use and your own preferences.
Logged
FinalSin
Level 1
*


Too bad they lose!


View Profile WWW
« Reply #86 on: February 01, 2011, 10:19:18 AM »

Anyone done any form of UDP punching for this? And could offer some advice/pseudocode?
Logged

Games By ANGELINA - Games designed by artificial intelligence!
Cut Garnet Games - Games designed by me!
LuisAnton
Level 1
*


View Profile WWW
« Reply #87 on: February 01, 2011, 10:49:43 AM »

Anyone done any form of UDP punching for this? And could offer some advice/pseudocode?

Good question. I've been fighting the whole afternoon with Unity3D's master server (installed in GAE), until I discovered that it's almost useless without its 'Facilitator', which precisely handles UDP punchthrough. Unless you stick to Unity's own installation (which is great for this competition's purposes but not for something more serious), you have to install your own Facilitator... which requires money. ARGH.

Still haven't found a poor man's reliable multiplayer solution. I miss the old days without NATs, when we all had static IPs at home Cry

EDIT: a poor man's reliable REAL TIME multiplayer solution. Because I guess I could implement a turn based game easily in GAE, for free, for a while.
« Last Edit: February 01, 2011, 12:15:53 PM by Woodwolf » Logged

Mega
Level 1
*



View Profile
« Reply #88 on: February 01, 2011, 01:16:16 PM »

@Medo: your're right and your offer is the best things to do, my OP was foolish. no need to buy a supercomputer when I'm just tying out a prototype. I'll PM you for the info (or should I post everything here? Noir Ninja Noir Noir ) anyway I'd need your help on connecting to the GangLandServer.  I'd need you to hold my hand for part the way so I'm not sure if you'll have anytime. Single player and single computer code is easy as pi but i'm not sure of the rght methods to connect to another computer... 
Logged
MedO
Level 1
*


View Profile
« Reply #89 on: February 01, 2011, 01:52:35 PM »

@Glinka: All the lobby-specific info you need should be in the topic I linked to. If you have generic networking questions, like how to send data with UDP, please don't ask me specifically.
Logged
Mega
Level 1
*



View Profile
« Reply #90 on: February 01, 2011, 10:44:17 PM »

IPv4 is exhausted today Feb.1.2011  Yay!

I think you should all be celebrating or a moment of silence or something. I mean this is historic and should be, especially for us.
 Beer! Beer! Coffee Beer! Coffee

hmm.. more beer than coffee..
Logged
FinalSin
Level 1
*


Too bad they lose!


View Profile WWW
« Reply #91 on: February 02, 2011, 02:00:46 AM »

Does it feel cramped in here?
Logged

Games By ANGELINA - Games designed by artificial intelligence!
Cut Garnet Games - Games designed by me!
Melly
Moderator
Level 10
******


This is how being from "da hood" is like, right?


View Profile
« Reply #92 on: February 02, 2011, 01:30:20 PM »

Matter of time now.

Man, switching to v6 is gonna be DANDY.
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Pages: 1 ... 3 4 [5]
Print
Jump to:  

Theme orange-lt created by panic