Hey,
I've been wanting to look into how to make online multiplayer games with cocos2d... How would you do this? I've heard of bonjour, but I'm not sure how easy that would be to implement it into cocos2d...
Thanks,
Techy
A fast, easy to use, free, and community supported 2D game engine
Hey,
I've been wanting to look into how to make online multiplayer games with cocos2d... How would you do this? I've heard of bonjour, but I'm not sure how easy that would be to implement it into cocos2d...
Thanks,
Techy
The question is very broad, I'd give a few more details if you want to get a reasonable response. It would very much depend on the type of game, Is this game turn based? real time? what degree of latency is acceptable? etc
Well Im thinking of an online multiplayer 2D racing game that may turn into a 3d racer game with opengl es... So it needs to be pretty fast seconds or so...
http://www.cocos2d-iphone.org/forum/topic/2717
I'd work on the networking part early on so you have an idea of the data you can push within you tolerances and then build around this.
Kinda helped, but I'm looking for more of something that is native to the iphone and can handle alot of data being sent in a short amount of time...
There isn't really anything available in the official SDK or Cocos2s to make true internet multiplayer trivial; GameKit for example is excellent at BT or Wifi multiplayer, but you're on your own for over the net stuff.
To second abitofcode, you're still not really giving us much to go on. You're request is "How can I write a 2D multiplayer racing game", and there are many possible answers to that.
GameKit is Apple's framework for local comms for multiplayer games (and other things, too). You should be fine to use it with Cocos, so read the official GameKit docs to get a flavour of it.
If you're looking to do true multi-player across the internet, then you'll need more than GameKit. The thread linked above will give you a flavour of what's needed.
Also, you need to seriously think about what a 'alot of data in a short amount of time' actually is; it's all relative. What kind of data do you expect to exchange between devices? It's a racing game right, so you're you don't need to constantly push the X,Y and rotation of a car, instead you could just push values like speed and rotation *when they change* and then you can calculate the rest on the receiving device... etc.
It doesnt really need to be over the "true internet", all I want is the ability to play multiplayer games with people around the glabe when you have internet connection
globe*
I am interested in making a API or library for online multiplayer gaming, do you know anything that would help me with the network part that I would put on my website
Hi, I would really like to see an Objective C implementation of online multiplayer lobbies and UDP communication with NAT punch through support. To encourage this, so allow me to give you some pointers :-)
Two major choices... server based or peer-to-peer. If server based, you've got lots of options. For example, you might enjoy this thread:
http://www.cocos2d-iphone.org/forum/topic/348
Also, Exit Games has a stable, popular platform:
http://www.exitgames.com/
And the good folks at Open Feint started but seemed to have dropped this feature:
http://openfeint.com/developers/old_features
Likewise, the Seattle startup Z2Live seems to have something planned but perhaps has stalled:
http://www.z2live.com
And the Scamboni developers gave it a shot, too:
http://dev.byteclub.com/platform
If peer-to-peer, the main issue you have is the dreaded "NAT Punch through" to recognize client/server behind NAT routers. A couple of UDP based solutions that seem to be common in various iPhone game engines:
ENet is used by Oolong:
http://enet.bespin.org/
Someone suggested Libjingle could be used for NAT punch through:
http://code.google.com/p/libjingle/
And there's a write up on libjingle use, here:
http://maemo.org/development/documentation/manuals/3-x/howto_use_stun_bora/
Finally, don't know if you plan to attend this year's GDC but there's always a few interesting presentations about how to implement online multiplayer. One size does not fit all games. Somehow I found this GDC presentation useful:
http://gafferongames.files.wordpress.com/2009/03/networking-for-physics-programmers.pdf
--yarri
PS: Of course their GameKit too...
You must log in to post.