A question that has been asked on the forum was about multi-player games running over the internet. Now, apple has built Game Kit that allows you to develop networked games that operator over bluetooth or wifi. iOS being based on Mac OS X contains the Unix networking library so that means that there are many different networking libraries available.
Previously I mentioned turn based multiplayer with OpenFeint. What I’m talking about in this article is networking real-time games.
There are three libraries I know of that have been used for just this purpose:
1. Enet – Enet is a very basic networking library that provides ordering for UDP packets. It has been around for quite some time. If you’re just looking for a bare bones networking experience, and want to code the lobby, server, security… yourself. I’ve used Enet and it served it’s purpose well. There is no support beyond basic instructions so you will have to work your way through it. MIT licensed so you can use it for free in your apps.
2. Raknet – Raknet is a complete solution, and provides extensive support through their community. There are sample lobbies, and servers. Raknet has multiple secure protocols, and really is the complete solution for this stuff. I haven’t done much with this, but it is recommended all over the place. You’ve probably seen the Raknet logo fly by if you play commercial multiplayer titles. The catch is that there is a price if your gross revenue is less than 50k.
3. HawkNL – This is another solution like Enet that has been around for quite some time. I have zero experience with it, and have no idea as to what it takes to get running on the iPhone although I have seen developers say they used it within their iPhone games. It runs on Mac OS X systems although from the looks of it that could take some considerable tweaking to run on iPhone. It provides more options than Enet and looks somewhat higher level. LGPL licensed.
Overall I’d say if you want a complete solution go with Raknet and aren’t worried about the costs. Enet is the choice if you are just looking to implement basic multiplayer and want something completely free. I’d love to hear about other solutions for multiplayer games either here or on the forum thread.
Thanks for reading, please share this using the buttons below!