Hi,
There will always be latency, it's inherent to the network architecture and data transfer speed of the internet.
The most direct and performant way is to fire an RPC when the elevator starts. The latency can be counter indeed by using the server timestamp and do some math to move the elevator where it should be based on the difference between your time and the server time. But really, I doubt this is worth the effort.
Can you describe why this affect your gameplay? maybe there is a better way to tackle this?
Also, have you checked TrueSync: https://www.photonengine.com/en-US/TrueSync
it provided a determinist and 100% accurate simulation of the game on all players, if you are affected by latency so badly, maybe this is worth checking out ( reuqired coding, PlayMaker can not work with TrueSync because of the different way to store numbers)
Bye,
Jean
Hi Jean!
I understand that there will always be some latency, but when I check the ping I got with Photon is around 40-50 and the "latency" is way above that, so I get the feeling it is no a latency issue but a issue of how my RPC/FSM are set up. There must be something else that cause the latency.
It does no affect my gameplay a whole lot in this game particularly but I want to understand why this happens so in future game I can correct it.
Okey so now I tried the RPC to fire of the elevator. (I've included a picture of the FSM). Basically the FSM just checks for how many connected players there are and if it is equal to the max player the game restarts and after the restart if the game is full it will not restart again but instead start the elevators (RPC Start game sends a RPC to start all the elevators on the scene)
Here is a video of the result:
https://ChristianE.tinytake.com/sf/MjI0OTg4M182OTQxNzExThe first issue here is that the elevator on the right is not synced with the one on the left.
There is also a position issue with the player. I guess this comes from the lerp of the positionen? I there a good way of fixing this?
Is all this something that I just have to accept? Maybe there is impossible to get a more synced game?
/ Christian