I am creating iOS(iPhone) soccer style game (using cocos2d and box2D) with two players playing realtime and a ball. I am struggling with the synchronisation for a lot of time and just can't get it smooth enough.
Okey so I decided to go with client/server model - One is selected as host(server) and the other is the client. The server and the client have to keep the physics running. And the Client only "mirrors" the physics of the server. The result is that we get smooth game on the server and really non-physic game on the client side -> let's say: after fast hit the ball is calculated to go up but on the next update the server is still thinking that the ball should go down. I use clock sync so I can sync the position and velocity properly on the client side. I know that I can't use client side prediction for physic events like hitting the ball. And I still want to have the physics on the both sides so I can detect collisions properly.
I would really appreciate if anyone shares his experience with this problem.