I'm using Game Center to create a real time match and I am working on a restart button. When the game ends it takes you to another screen that shows you everyone's score and on that screen there is a restart button. If someone presses it their name will turn green and if they leave the game then their name will turn red. Once everyone has either hit restart or left the game then the game will restart by presenting the game scene again.
The thing is though, they're all doing this at slightly different times and sometimes one of the devices will send a signal to the other devices before those other devices have made it to the game scene and so the message isn't being interpreted and is just lost. So my question is, is there any way to make sure that all the players go the the next scene at exactly the same time?
You can have a synchronization step after the scenes have loaded. You will never be guaranteed everyone loads at the same time/rate.
So,
This redundancy is to make sure the users are able to broadcast appropriately before and after showing the scene. Of course, There is a LOT of implicit error checking and timeout checking during this process, if there is a stray user unable to broadcast, then they may just need to be considered for booting off the match after a given amount of time so the other players can still play.
Also this is my best whack at syncing things as much as possible to where you can try and make sure signals are not lost. Do a synchronization procedure, then start sending relevant signals.
You CAN NOT guarantee exact timings of next screens for different users, you can just get them as close as possible.
The important part is NOT the screen display but rather making sure all users are in the correct STATE to receive the next set of data broadcasted by the others.
Different internet speeds and different device speeds will always hinder perfect visual synchronization.