The little project that could?

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

The little project that could?

Postposted on Sun Jun 06, 2004 6:01 pm

My friends and I are starting up a little gamming project. I’ve been assigned to the networking aspect of it. The networking part isn’t that bad or at least it doesn’t seem that way to me now. We’ve decided that the maximum amount of players will be three. With this said I want to start the networking part over the internet first.

I’ll already setup a server with MySQL, PHP, Apache the works. Problem is I’m not sure how to go about connecting all three of them (three computers). I’m thinking of using a database to connect them. You know have all three connected to a database (MySQL) then that database sends them new information if any. I’m sure there is a better way, but hey if you guys know of any easier way please share.

This project will be written in Java. So right now I need to figure out how to network three computers just so they can see each other (this would obviously be the first step). What do you guys think?
malebolgia
Gerbil Elite
 
Posts: 973
Joined: Fri Apr 05, 2002 7:00 pm
Location: New Mexico, USA

Postposted on Sun Jun 06, 2004 6:13 pm

Your requirements are going to be hugely different if the game you're writing is a twitch game (fps, flight sim, etc) that requires updated world data 60 or more times a second vs an RTS that can manage a handful of times per second vs a true strategy game that only needs updates as other players make decisions.

A SQL database is both too slow and overkill for twitch games; for a sprawling strategy game it might be a reasonable choice. In a slow strategy game you can coordinate everything via updates to the db by the clients: reality lives in the database, and everyone has a consistent view of the world (though the client may hide some of this from the human player) via views of the db. The networking details are all hidden from you as a programmer, since this is really just a (well-defined) matter of connecting to a remote db. This is elegant, easy, and slow.

That's not going to work for a fast game, however. Twitch games are typically sending and receiving TCP or UDP packets to the server (in server-based games) or each other (in p2p games). I think there are some games using binary http as well, to avoid issues with firewalls and ports.
UberGerbil
Gerbil Khan
 
Posts: 9971
Joined: Thu Jun 19, 2003 3:11 pm

Postposted on Sun Jun 06, 2004 7:32 pm

UberGerbil wrote:Your requirements are going to be hugely different if the game you're writing is a twitch game (fps, flight sim, etc) that requires updated world data 60 or more times a second vs an RTS that can manage a handful of times per second vs a true strategy game that only needs updates as other players make decisions.

A SQL database is both too slow and overkill for twitch games; for a sprawling strategy game it might be a reasonable choice. In a slow strategy game you can coordinate everything via updates to the db by the clients: reality lives in the database, and everyone has a consistent view of the world (though the client may hide some of this from the human player) via views of the db. The networking details are all hidden from you as a programmer, since this is really just a (well-defined) matter of connecting to a remote db. This is elegant, easy, and slow.

That's not going to work for a fast game, however. Twitch games are typically sending and receiving TCP or UDP packets to the server (in server-based games) or each other (in p2p games). I think there are some games using binary http as well, to avoid issues with firewalls and ports.


The game is going to be a 3 player chess game. The program in Java will be installed on each machine. When the user of whatever machines makes a move I was going to have it send to the database then that move would be sent to the other users.

After that the Java program on the user’s computer would do the animation of the move and whatnot.
malebolgia
Gerbil Elite
 
Posts: 973
Joined: Fri Apr 05, 2002 7:00 pm
Location: New Mexico, USA


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 2 guests