Google Realtime-Multiplayer network delay

hi all,

i’m currently developing a game for mobile devices using Unity. This game contains a single player and also a multiplayer mode which is realized with the Play Games Services from Google.

Now to my problem: I have two players in the scene. One of them is the Host. All necessary calculations are made by him and will be broadcasted to the other players, to make it the same for all player. Now i’ve got the problem that due the delay over network things happen much later at the other player.

For example: The host spawns an enemy, it appears at the other player with a noticeable delay.

Possible solution (?): First broadcasting the enemy-spawn to the other player and then spawning it delayed at the host-player. But what delay? Maybe the ping? or the ping of both added together?

What’s the best practice to solve problems like that?
Is there maybe a way to get the own ping and the one of other players through Google Play Games?

Please help me.

best regards Dennis

Yeah that should work.

Try to send Time.time in the message you want to get the ping with, then when recieved send a callback message and then when the callback is revieved get the difference between the Time you originally send the ping message and the time the callback message arrived at the original client.

There you got the Ping (for 2 ways, divide by 2 to get the 1-way Ping)