Difficulty of networking?

I know very little about networking, but in the recent months i have been developing an OpenGL & win32 game to test my skills, and im interested in learning networking to attempt to make the game 2 player from different computers(in close proximity, no long distance networking needed if it matters). I'm wondering just how hard that would be to accomplish? I am not the type of person that thinks he can pick up something and work hard for a week expecting to know the subject in and out, i understand these things take commitment and dedication to learn. Thanks if you can help!
Last edited on
closed account (o1vk4iN6)
You can look into Raknet, which is a networking library that is used by a few games and has a free licence.
Enet is another good one. http://enet.bespin.org I think is the url.
For what it's worth I don't think it'd be that hard. I've been learning about networking for a few months. I found that starting with making a basic chat program based on online tutorials very helpful (TCP sockets). There is a learning curve but at the top of the hill there is understanding :)

For games u'll want to use UDP sockets...
closed account (o1vk4iN6)

For games u'll want to use UDP sockets...


It depends on the type of information you want to be sending. Yes you'll want to use UDP but even then you'll still want packets to be reliable in some cases. So you'll need to write your own underlying protocol to ensure this. Something like position which periodically gets updated won't need insurance that the packet was received as a new packet is on it's way with updated information, making the lost packet irrelevant. Now say for creating the player, if the packet is lost the player isn't created and the client hangs. Which is why it would be easier to simply use a library which is designed for this.
Last edited on
xerzi: That is why I recommended ENET. This library is explained briefly in this video ( https://www.youtube.com/watch?list=PL1C1520BED8259228&feature=player_detailpage&v=r3wDnOAjrtk#t=1915s ) and truthfully the whole video is worth watching, but that starts at where explains ENET and does it better than I can as I suck at explaining things in text form.
Last edited on by closed account z6A9GNh0
closed account (o1vk4iN6)
Any network library will do it. I've only ever used gamespy's network library but I've heard good things about Raknet which is why I said it. Raknet seems to have more features, such as lobbies, game patcher, voice chat encoding, etc... but a lot of that isn't need, good to know there's something else is out there.

Also nice video.
Topic archived. No new replies allowed.