Hi guys, I'm working on a multiplayer platform game (top/down scroller), where the two heros race against each other to get to the top of the platforms. In singleplayer everything works fine, in multiplayer I see a massive drop of framerate, which comes from the networking code (not the additional player that's visible). Every player controls his hero through the accelerometer and sees all the players on his screen.
Right now I'm using GameKit to transfer the x/y of the local player to all connected peers. This happens in the step: method, so every 1/60 seconds. I tried using a slower framerate for the transfer, but that lead to very jiggy behaviour.
I've read http://www.cocos2d-iphone.org/forum/topic/1615 but still have some questions, e.g. rather than transmitting x/y I should probably start transmitting x/y velocities w/ timestamp instead, right? Or should I probably not even send y velocity, but rather metadata such as 'character launched jump' etc.)? I can't get away without transmitting the accelerometer values in realtime though.
Is calling a network send (such as GameKit's) from the step: accepted at all or should I rather spawn a second thread? Please share some best practices with me.
Cheers,