Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 12:25:15 AM

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 [2] 3 4 5
Print
Author Topic: Networking Solutions or: How Do I Play Over The Tubes?  (Read 45246 times)
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #20 on: January 17, 2011, 12:49:58 PM »

Quoting this exchange from the Technical forum at Melly's semi-urging.

I'm no expert in this networking nonsense (I took a cisco networking class at one point but it was the very basics...), but I was experimenting with raknet a while back (w/ C++) and it seemed to work alright...

For this compo I think I'll be trying boost.asio, since it's nicely cross platform-like and it doesn't look that hard to get some simple packets thrown about.

Riley: Boost.asio is really conceptually cool and feels so natural to program but debugging it is deep hell.

My advice: Go ahead and use it, but whenever you create a new callback, document somewhere (just write down in a file or a comment or something) who issues the callback and who consumes it and why. Asio makes it easy to wind up in the debugger staring at the inside of a bind()ed function, and just sort of lost trying to remember "who called this again?". Also: I hope you are very comfortable with the use of smart pointers.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Paint by Numbers
Guest
« Reply #21 on: January 17, 2011, 12:59:07 PM »

This thread looks to be very helpful.

I don't know much about developing networked games, but I do have a suggestion/concern.
Perhaps games requiring use of some ports to be standardized (all using the same port number) or configurable (can change the port number to what ever the player/host desires), that way players don't have to forward a different port for each game on their router.

Seconded. This would be nice.
Logged
Sos
Level 8
***


I make bad games


View Profile WWW
« Reply #22 on: January 17, 2011, 01:04:45 PM »

C/C++ guys:
RakNet - RakNet is easy as fuck and will get you going in no time. The indie licence for 3.x is free (you can get 3.x versions from the forum). Examples are plain and simple, you should take a look at the chat client/server example to get the idea. Getting this to work is basically 15 lines of code, no matter whether you're doing client or server. ALSO, it's P2P architecture, so whether you want client/server or p2p or both is up to you. I use it every day in work, and LOVE IT!

JavaScript/Canvas guys:
PusherApp - this let's you interface via network with just several lines of JS code, It's also free and the beta just ended. Guys making this are cool and prone to support.
Logged

J. Kyle Pittman
Level 6
*


PostCount++;


View Profile WWW
« Reply #23 on: January 17, 2011, 01:08:56 PM »

This thread looks to be very helpful.

I don't know much about developing networked games, but I do have a suggestion/concern.
Perhaps games requiring use of some ports to be standardized (all using the same port number) or configurable (can change the port number to what ever the player/host desires), that way players don't have to forward a different port for each game on their router.

Seconded. This would be nice.

Thirded. I'm planning to roll my own solution and let the host pick the port, but if we decide on a standard, I can default to that for simplicity.
Logged

Ashkin
Guest
« Reply #24 on: January 17, 2011, 01:09:14 PM »

I use Player.IO for my Flash games, and it works great! If you're working on a game in Flash CS or Flex, Flixel/FlashPunk, and are having trouble getting it up and running, just gimme a ping and I'll help ya out.

It's got great online documentation and tutorials, though, so make sure to tap that!
I'll be sure to keep that in mind, Chevy, thanks :3
Seeing as I have NO IDEA how ANY of this works.
Logged
namre
Guest
« Reply #25 on: January 17, 2011, 01:14:43 PM »

Quote
JavaScript/Canvas guys:
PusherApp - this let's you interface via network with just several lines of JS code, It's also free and the beta just ended. Guys making this are cool and prone to support.
They have a free option but with a maximum of 5 connections only. :c

I wonder if there are any options with Canvas and Javascript. Will check. :D
Logged
Riley Adams
Level 5
*****


I don't actually use Ubuntu much...


View Profile
« Reply #26 on: January 17, 2011, 01:17:42 PM »

Quoting this exchange from the Technical forum at Melly's semi-urging.

I'm no expert in this networking nonsense (I took a cisco networking class at one point but it was the very basics...), but I was experimenting with raknet a while back (w/ C++) and it seemed to work alright...

For this compo I think I'll be trying boost.asio, since it's nicely cross platform-like and it doesn't look that hard to get some simple packets thrown about.

Riley: Boost.asio is really conceptually cool and feels so natural to program but debugging it is deep hell.

My advice: Go ahead and use it, but whenever you create a new callback, document somewhere (just write down in a file or a comment or something) who issues the callback and who consumes it and why. Asio makes it easy to wind up in the debugger staring at the inside of a bind()ed function, and just sort of lost trying to remember "who called this again?". Also: I hope you are very comfortable with the use of smart pointers.

Thanks for the heads up, I'm aiming to keep it pretty simple and I'll definitely document everything, so hopefully I won't end up with too much in the way debugging headaches... (heh, probably wishful thinking, but ah well it'll be a learning experience).

Worst comes to worst I'll use raknet, which seemed to get the job done. Speaking of; Raknet peoples: Does it work on OSX? (I know it supports win/linux officially, but I think it might also be possible to compile on OSX?)
Logged

quickfingers
Level 0
**



View Profile WWW
« Reply #27 on: January 17, 2011, 01:41:31 PM »

If you have your own server box, I can totally vouch for Smartfox server. The free version (community version) supports 100 concurrent users and they have apis for flash, unity3d and iphone

http://smartfoxserver.com/2X/index.php

I've used it in flash games and a unity project, the API's really are very easy to use. The only drawback is having to find your own server to use.
Logged

Melly
Moderator
Level 10
******


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


View Profile
« Reply #28 on: January 17, 2011, 01:44:24 PM »

I know jack shit about port forwarding, so if you guys can guide me I could organise, i dunno, a poll to decide standard ports to use?
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Carrie Nation
Level 4
****


View Profile
« Reply #29 on: January 17, 2011, 01:54:09 PM »

I've begun to dig in to Player.IO, and god damn all of this latency state updating nonsense is just NOT fun.
Logged
ChevyRay
Guest
« Reply #30 on: January 17, 2011, 02:06:43 PM »

Yeah, fortunate for the people who are doing same-screen or turn-based stuff for sure. Could look into SmartFox if you want something maybe a bit more substantial.
Logged
J. Kyle Pittman
Level 6
*


PostCount++;


View Profile WWW
« Reply #31 on: January 17, 2011, 02:08:19 PM »

I know jack shit about port forwarding, so if you guys can guide me I could organise, i dunno, a poll to decide standard ports to use?

In general, ports 1024-49151 are considered safe for use. Wikipedia has a list of what ports many applications use so we can avoid obvious conflicts like instant messaging services.

http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

There's also a bigger, scarier, more official (?) list here:

http://www.iana.org/assignments/port-numbers
Logged

Melly
Moderator
Level 10
******


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


View Profile
« Reply #32 on: January 17, 2011, 02:10:21 PM »

Yyyyyeeaahh...

I'll just make a discussion thread about it and you guys with brains sort it out.
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Riley Adams
Level 5
*****


I don't actually use Ubuntu much...


View Profile
« Reply #33 on: January 17, 2011, 02:11:51 PM »

On second thought, I may just use raknet, documentation/examples outside of the boost site are a bit scarce for asio... if I can get rak to compile under OSX I'll probably just use it (*boots into hackintosh...).
Logged

Melly
Moderator
Level 10
******


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


View Profile
« Reply #34 on: January 17, 2011, 02:13:05 PM »

I made a sticky about ports. You guys can try and work things out over there. Let me know if I can help more, but I'm kinda dumb about this.
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
Ivan
Owl Country
Level 10
*


alright, let's see what we can see


View Profile
« Reply #35 on: January 17, 2011, 02:17:41 PM »

I just want to say that using raw sockets is really not that scary. Once you get over the initial hump of setting it up, which really is like 10 lines of C, it feels really good to have your own low level connection stuff going. It's more like prediction and compression stuff that gets hairy, but most network libs don't really take care of that fully anyway.
Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
John Nesky
Level 10
*****


aka shaktool


View Profile WWW
« Reply #36 on: January 17, 2011, 02:21:08 PM »

I've begun to dig in to Player.IO, and god damn all of this latency state updating nonsense is just NOT fun.

Yup, latency is hell. I started this thread with the hope that some best practices for dealing with latency will bubble up. HOWEVER, I do encourage people who want to make fast-paced games to just do it offline. I agree with Ivan in the rules thread, I would be disappointed if hardly anyone made any offline multiplayer games for this compo.
Logged
Melly
Moderator
Level 10
******


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


View Profile
« Reply #37 on: January 17, 2011, 02:22:02 PM »

I plan mine to be both online and offline. Hell I doubt that'd be too hard.
Logged

Feel free to disregard the above.
Games: Minus / Action Escape Kitty
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #38 on: January 17, 2011, 03:05:14 PM »

I just want to say that using raw sockets is really not that scary. Once you get over the initial hump of setting it up, which really is like 10 lines of C, it feels really good to have your own low level connection stuff going. It's more like prediction and compression stuff that gets hairy, but most network libs don't really take care of that fully anyway.
If you're in C it's almost the easiest way to do things.

Just push some structures through. No serializing or deserializing.

These days you can probably even get away with ignoring endianness.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Riley Adams
Level 5
*****


I don't actually use Ubuntu much...


View Profile
« Reply #39 on: January 17, 2011, 04:15:12 PM »

I just want to say that using raw sockets is really not that scary. Once you get over the initial hump of setting it up, which really is like 10 lines of C, it feels really good to have your own low level connection stuff going. It's more like prediction and compression stuff that gets hairy, but most network libs don't really take care of that fully anyway.
If you're in C it's almost the easiest way to do things.

Just push some structures through. No serializing or deserializing.

These days you can probably even get away with ignoring endianness.

I sorta like the idea of boost.asio, but my first impressions aren't the best... I built a couple of the examples, ran, had no way of exiting, ctrl-z'd and then it said the address was already in use and I had to reboot to run them again... though I'm probably doing something really stupid...

raknet compiled okay on win/osx/linux so I'll probably just end up using it, since I have some past experience with it...
Logged

Pages: 1 [2] 3 4 5
Print
Jump to:  

Theme orange-lt created by panic