iDevGames Forums
Couple of GameCenter questions - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Couple of GameCenter questions (/thread-10094.html)

Couple of GameCenter questions - iamflimflam1 - Jun 5, 2012 02:36 AM

Hi All,

I'm working on a multiplayer game, I have local multiplayer matches working well using GameKit and I'd like to extend it to play over the internet using GameCenter.

For my local implementation I force one user to choose to host the game and then all the other devices join the game running on that device.

For GameCenter I'll need to have the devices decide by themselves which one should be the host for the game.

I posted a question on the apple dev forums, but it seems like not many people read the GameCenter board.

Watching last year's WWDC sessions (2011) they suggest picking the device that is on WiFi and is the most up to date.

I can't see anyway of finding out how the other players are connected to GameCenter or what they are running on so they will have to tell each other. So I was thinking of maybe broadcasting a short message with the connection type and some indication of the device speed.

All the devices will look at these messages and then decide themselves which device should host the game. I'll break ties using the playerID which I think is globally unique.

This should make the negotiation over who should be the host pretty simple as it will just involve one broadcast message from each device in the game.

Does this sound like a good approach or is there a simpler way?

Also in the video they suggest that you shouldn't send out a message for each game frame with the new positions of the objects but should send out an update every tenth of a second or so and have the clients interpolate the positions.

I already have interpolation in my local implementation to handle dropped and delayed packets and it works pretty well, but it's not brilliant and I'd rather not force it to do it too much by sending fewer packets.

My game state packets are pretty small ~2-300 bytes so if possible I'd like to be able to send updates from the host at 30 or 60 fps and only have the clients interpolate when packets are being dropped. Does anyone have any experience with GameCenter and what sort of packet throughput it has?

Thanks for any suggestions