TIGSource Forums

Developer => Technical => Topic started by: Ivan on March 02, 2009, 11:54:00 AM



Title: UDP socket programming resources
Post by: Ivan on March 02, 2009, 11:54:00 AM
Looking for all and any articles on UDP socket programming and general multiplayer architecture theory/practice.

Spanx in advance!

 :eyebrows:

I'll post interesting stuff I find for posterity:

http://gafferongames.com/networking-for-game-programmers/
http://gafferongames.com/game-physics/networked-physics/


Title: Re: UDP socket programming resources
Post by: increpare on March 02, 2009, 12:02:15 PM
cool.

I...I WANT TO MAKE A (NETWORK) MULTIPLAYER GAME.

I didn't want to make one before clicking on this thread to open it.

will check out those articles now.


Title: Re: UDP socket programming resources
Post by: gnat on March 02, 2009, 12:19:13 PM
I suggest taking a look at Michal Marcinkowski's post where he implements and praises John Carmack's Quake III networking model (http://mm.soldat.pl/?p=202).

Check out the mind map in that post, and be sure to look at the Quake III networking model document (http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/Quake3Networking) and the introduction to multiplayer game programming (http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/IntroductionToMultiplayerGameProgramming) on the same site.


Title: Re: UDP socket programming resources
Post by: Ivan on March 02, 2009, 12:33:34 PM
Wow, that mind map is awesomely helpful. Thank you.


Title: Re: UDP socket programming resources
Post by: gnat on March 02, 2009, 12:48:21 PM
I find that good game networking articles/resources on the internet are scarce; and the majority of stuff that does exist is unfortunately written by inexperienced developers and/or just crappy.

For a good foundation of how all of this stuff works, I would personally recommend foregoing most of the crap out there and instead checking out Steve Gibson's and Leo Laporte's Security Now podcast (http://www.grc.com/SecurityNow.htm). The following episodes would be of interest: How the Internet Works Part 1 and 2, and How Local Area Networks work, and NAT Traversal.


Title: Re: UDP socket programming resources
Post by: Ivan on March 02, 2009, 12:52:38 PM
Cool!

I'm pretty familiar with networking on the hardware level and I've written a couple of TCP-based apps, just looking for some wisdom about proper UDP-based design, so the stuff you linked to before is a perfect starting point.


Title: Re: UDP socket programming resources
Post by: increpare on March 02, 2009, 01:24:02 PM
hmm; had some trouble getting the examples to work (and my program kept on crapping out at the first stage:

Code:
int handle = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );

  if ( handle <= 0 )
    {
        printf( "failed to create socket\n" ); <- it got here
        return false;
    }

I'm going to have a look at some libraries for now: enet (http://enet.bespin.org/) first.


Title: Re: UDP socket programming resources
Post by: Ivan on March 02, 2009, 01:33:11 PM
Hmmm, enet does sound nice.


Title: Re: UDP socket programming resources
Post by: increpare on March 02, 2009, 01:55:35 PM
people say that ace (http://www.cs.wustl.edu/~schmidt/ACE.html) was also mentioned as being the big daddy of network libs, but it's apparently very general.


Title: Re: UDP socket programming resources
Post by: Ivan on March 02, 2009, 02:08:02 PM
that looks scary! Looks like it was developed by Shadaloo!


Title: Re: UDP socket programming resources
Post by: increpare on March 02, 2009, 02:33:56 PM
just built enet; it was surprisingly ... easy to do; will see if I can get some test program running now...

that looks scary! Looks like it was developed by Shadaloo!
heh, the joys of open-source.


Title: Re: UDP socket programming resources
Post by: Ivan on March 02, 2009, 02:34:48 PM
I meant this:

(http://www.cs.wustl.edu/~schmidt/gifs/ace-copy1.jpg)

Let me know how enet is.


Title: Re: UDP socket programming resources
Post by: increpare on March 02, 2009, 03:11:48 PM
I meant this:
I know that's what you meant.  I was quite amused by some of the suggestions (http://www.haskell.org/haskellwiki/Haskell_logos/New_logo_ideas) for a new official haskell logo.  That's what I had in mind when I made my comment, i guess,


Title: Re: UDP socket programming resources
Post by: increpare on March 02, 2009, 05:02:00 PM
well, I was able to establish a connection today anyway :)  can go to sleep now...

there was one typo in the tutorial  (http://enet.bespin.org/Tutorial.html) ('client' should read 'server' somewhere obvious enough), and it took me a couple of minutes to get everything to link properly, but overall no major hiccups yet.


EDIT: this (http://www.gamedev.net/community/forums/forum.asp?forum_id=15) place will undoubtedly be also interesting to leaf through... (ah there's a faq (http://www.gamedev.net/community/forums/showfaq.asp?forum_id=15) there as well with a couple of links to things I hadn't checked out yet...)


Title: Re: UDP socket programming resources
Post by: Core Xii on March 03, 2009, 12:53:52 AM
If you don't feel like reinventing the wheel, there's always Zoidcom (http://www.zoidcom.com/).


Title: Re: UDP socket programming resources
Post by: ChevyRay on March 03, 2009, 02:51:56 AM
Looking for all and any articles on UDP socket programming and general multiplayer architecture theory/practice.

Spanx in advance!

 :eyebrows:

I'll post interesting stuff I find for posterity:

http://gafferongames.com/networking-for-game-programmers/
http://gafferongames.com/game-physics/networked-physics/
AAAH!!

I was trying this JUST the other day, and was going to start pretty much this very same topic! :P

I'm doing some multiplayer programming right now. I was trying to give it UDP support (currently just TCP/IP), because it's a lot quicker, but kept on running into crazy problems.

By the way,

IF ANYONE WANTS TO COLLABORATE ON A SMALL MULTIPLAYER GAME, I want to make one as practice. So PM me if ya do. I do all my programming in Game Maker, and use 39dll for multiplayer support through windows sockets. I've already got a good working engine and everything. <3


Title: Re: UDP socket programming resources
Post by: Ivan on March 03, 2009, 08:32:22 PM
I think I might give RakNet a go. Does anyone have any experience with it?


Title: Re: UDP socket programming resources
Post by: AaronAardvark on May 07, 2009, 09:38:08 AM
I just found the gafferongames.com articles (http://gafferongames.com/networking-for-game-programmers/virtual-connection-over-udp/) today.  So so good.


Title: Re: UDP socket programming resources
Post by: valkrin on May 07, 2009, 06:47:20 PM
I'll toss in a recommendation for Ace.

people say that ace (http://www.cs.wustl.edu/~schmidt/ACE.html) was also mentioned as being the big daddy of network libs, but it's apparently very general.

Your right Ace provides much more than just networking but that doesn't really hurt its performance.
I use Ace at work to consume massive amounts of time critical data where every microsecond counts; it is very quick. If you learn Ace just for networking, and later you need something else like thread management, message queues, etc. Ace has that stuff too so its easy to use and works well together. Nicer than having a bunch of different third party libraries.

Ace isn't that hard to learn if you know C++ already and know your operating systems stuff.