iPhone GameKit

I’m currently working with GameKit for the iPhone at my Lab (http://www.graphics.rwth-aachen.de) and Limbic (http://www.limbicsoft.com, our homepage is finally up!). I’ve found out and collected some interesting things I’d like to share.

1) Despite everyone saying it’s not possible, there _is_ a way to test Gamekit with only one device and a Mac. The magical solution is: Tethering. When you tether your phone with your mac, and then run the app in the sim and on the phone, it will magically work. This is not really feasible for me as T-Mobile will charge 20 euros for the tethering starting at the end of this month, which is just ridiculous and out of this world. BTW, I didn’t figure this out, I found it in a hidden thread on the iPhone Developer Center public forum.

2) Using peer picker takes really long. I’ve a lot more successful doing it manually setting one of the devices to GKSessionModeServer and the others to GKSessionModeClient.

3) Disabling Wifi really improves the latency, bandwidth and general connectivity (discovery time, etc). The explanation here is that it uses the same antenna as bluetooth, which is not that good.

4) The latency with Bluetooth is a lot smaller than the Wifi latency. We’re talking (roundtrip) ~35ms (iPod <-> iPhone) vs ~150ms (local high-end router dedicated for this connection, connecting to a laptop. laptop to laptop has ~1ms on the same router).

5) The upload Bandwidth in both Wifi and Bluetooth seems to be limited to about 60 KiB/s. I’ve hardly been able to squeeze out more than that, no matter how. I’m not sure exactly why this is, but I assume it has something to do with reducing energy consumption.

6) When I’m sending a lot of data, [session sendData:…] will fail. If an NSError* is passed as a parameter, it will generate a lot of output noise, even when the error is not used, so rather pass nil for the error parameter. Also I’m getting insane beachball-spinning for 30+ seconds in XCode when I transfer about 250KiB, so that’s pretty messed up. Works fine on the device though, just xcode is dying a slow death.

7) There seems to be no way to figure out if the packet received in receiveData is reliable or not. That would be nice to know, but you can easily get around that, too.

All in all I’m starting to think that GameKit is in fact pretty cool, but it’s not easy to control. I hope they improve on some areas with the upcoming 3.1 release, but all in all it’s pretty good.

That’s it for now, I may post more updates when I figure more interesting stuff about GameKit.

Leave a Reply

Your email address will not be published. Required fields are marked *