Multiplayer Network Connection

Moderator
Posts: 592
Joined: 2002.12
Post: #1
I've started thinking about mutliplayer via internet play for my Chromacell game.

I intend to use TCP/IP to connect to my central game server.

Is the best method to create a socket connection from each player to the server and keep it open for the duration of the game or is it better to create and then close a socket for each packet of information that needs to be sent?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
If you're going to use TCP, keep the connection open the whole time. Establishing a connection is very time-consuming.

You might want to consider UDP, though, depending on the game, how many clients will be connected at once, &c.
Quote this message in a reply
Moderator
Posts: 592
Joined: 2002.12
Post: #3
The reason I was thinking of using TCP/IP was that I have had experience in Windows land of sending and receiving information via TCP/IP but not in a games context.

What my ultimate, and very ambitious plan is to allow multi play between various versions of the game, i.e. Pocket PC, Mac OS X, Windows and possibly Palm if I give in to my Tungstan cravings Rasp

As the network version could well be played over a GPRS internet connection I need to ensure that my game can handle the connection being dropped and then picked up again. If I have an open socket for the entire game session, how easy is it to catch and handle the loss of this connection?

I have a feeling this discussion could turn very technical any second now:?:
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
If you're going to have to deal with lost and dropped connections anyway, I'd probably just go for UDP. I tend to think it's easier than TCP (ignoring dropped packets), so if you're going to have to deal with lost information either way, why not UDP?
Quote this message in a reply
WaaMatt
Unregistered
 
Post: #5
I have a question, since my knowledge of networking is kind of poor (though I did take the first semester of Cicsco ceritification at City College of San Francisco).

If you have a game that networks over TCP/IP and several players on a LAN hooked up to DSL are playing said game, would it be any slower than... AppleTalk on all 10/100 connections? That is, that's x people sharing the DSL while the Ethernet method might be faster?

This is something I've been wondering about. The OS X native Starcraft and Myth II: Soulblighter don't support AppleTalk. Neither does Baldur's Gate II: Shadows of Amn. Although, only BG2:SoA runs poorly.
Quote this message in a reply
Patrick
Unregistered
 
Post: #6
Quote:Originally posted by WaaMatt
I have a question, since my knowledge of networking is kind of poor (though I did take the first semester of Cicsco ceritification at City College of San Francisco).

If you have a game that networks over TCP/IP and several players on a LAN hooked up to DSL are playing said game, would it be any slower than... AppleTalk on all 10/100 connections? That is, that's x people sharing the DSL while the Ethernet method might be faster?

This is something I've been wondering about. The OS X native Starcraft and Myth II: Soulblighter don't support AppleTalk. Neither does Baldur's Gate II: Shadows of Amn. Although, only BG2:SoA runs poorly.

If the several players are all on the same LAN, then it wouldn't really matter...Even 10BaseT can EASILY handle pretty much any network gaming at all. BG2:SoA is probably slowing down just because of client-side stuff ( graphics etc ).
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #7
Quote:Originally posted by WaaMatt
If you have a game that networks over TCP/IP and several players on a LAN hooked up to DSL are playing said game, would it be any slower than... AppleTalk on all 10/100 connections? That is, that's x people sharing the DSL while the Ethernet method might be faster?


I know it's not what you asked, but Appletalk is dead; even Apple has deprecated it and switched entirely to IP-based services.

As Patrick said, lag is hardly ever a problem on an Ethernet LAN. If you're worried about packets "leaking" onto the Internet or something, a properly configured network won't allow that to happen, and even if it's not properly configured it wouldn't affect performance.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #8
Quote:Originally posted by Mark Levin
I know it's not what you asked, but Appletalk is dead; even Apple has deprecated it and switched entirely to IP-based services.

As Patrick said, lag is hardly ever a problem on an Ethernet LAN. If you're worried about packets "leaking" onto the Internet or something, a properly configured network won't allow that to happen, and even if it's not properly configured it wouldn't affect performance.


Actually, on ethernet, AppleTalk can be run over TCP/IP, just like any other application protocol. LocalTalk is no longer used, since it uses the serial port.
Quote this message in a reply
WaaMatt
Unregistered
 
Post: #9
OK... So my superstition that 3-4 people playing a game over the same DSL line (since it's using an IP address, not AppleTalk) slows down the speed is moot... I think.

What's wrong with AppleTalk that it would get phased out?
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #10
Quote:Originally posted by WaaMatt
OK... So my superstition that 3-4 people playing a game over the same DSL line (since it's using an IP address, not AppleTalk) slows down the speed is moot... I think.

What's wrong with AppleTalk that it would get phased out?

AppleTalk is not good in large scale, especially routed environments, and it is based on proprietary technology. It is not the fastest known to man, either.

It is nice, as it pretty much provides plug and play networking, but this is superseded by TCP/IP based networking with some zero configuration tech, like Rendezvous. It is more widely supported, at least as far as TCP/IP goes, and Rendezvous is an open standard.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #11
I think you guys might be a little confused.
-AppleTalk is a network protocol (like TCP/IP or UDP)
-LocalTalk describes the serial/phone based network hardware
-AppleTalk can be used on a LocalTalk or Ethernet (and other) networks

I'm not so sure that AppleTalk is encapsulated into TCP/IP like DooG said. However, the reverse is true. You were able to encapsulate TCP/IP into AppleTalk using a MacIP server. (and therefore share a TCP/IP connection on localtalk)
File Sharing can be done on both TCP/IP and AppleTalk. TCP/IP uses the Apple File Protocol (afp://) which I'm pretty sure is not encapsulated AppleTalk packets. Or used on AppleTalk, usually just called AppleShare.

Either way, in OSX, AppleTalk is kept around just for compatibility of older file sharing networks.

I've had to explain this to people with network problems. Correct me if I'm wrong, but I'm fairly sure that is correct.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
WaaMatt
Unregistered
 
Post: #12
Wish I knew either way! But, sounds good to me. I figure, "It all still works, so... Eh!"
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Is it possible to implement http connection for iPhone Development? joyjit_b 2 5,664 Aug 8, 2008 09:13 AM
Last Post: Taxxodium
  java network api San_Andreas 1 3,172 May 1, 2008 08:05 AM
Last Post: AndyKorth
  Getting network connection for a specified PID Florian 6 4,948 Dec 23, 2006 03:46 AM
Last Post: Florian
  Ways to Network. BinarySpike 28 12,487 May 10, 2005 07:44 PM
Last Post: kodex
  Network play David 15 7,498 Apr 10, 2003 05:56 AM
Last Post: rvangaal