Hi,
I have a real-time multiplayer racing game and in my game it is very important for the race to start at the exact same time for all players. As it is right now, I have a server setup where 2-4 players get matched and the server sends a raceStartTime in seconds in UTC to all players (clients).
All of my players get this raceStartTime and then I use
Runtime:addEventListener( "enterFrame", checkRaceStartTime )
to check if
os.time() == raceStartTime
and when it’s true, the race starts for each client/player. This works perfectly when I test it on my iPhone and Corona Simulator, the race does indeed start at the exact same time. You can see from this video that the scene and countdown loads at different times but GO! appears at the same time. Now the problem comes when I build the game and deploy it on Android. The Android starts late after the other devices, it appears to be 1 second behind in starting the race.
Does anyone know why that is? Does os.time() return a different timestamp from Android and iOS?
Thanks.