How often is PhotonNetwork.time update?
Options
Hi!
I've got a game called Multiroids which currently runs on Windows Store (Windows Phone & Desktop):
https://www.microsoft.com/en-us/store/p/multiroids-online-2d-space-battle/9nblggh30w5w
In the game you can shoot bullets that travel quite fast so I decided to use RCP calls when a bullet is fired. The RPC contains a time based on PhotonNetwork.time when the bullet should arrive at the destination.
Then I lerp the position of the bullet locally on each client using PhotonNetwork.time which works.
But the problem is that sometimes the bullet starts a bit off even on the local client and it has a bit of jerky movement. I suspect that this might be caused by the fact that PhotonNetwork.time is only updated when a message arrives on the client, is that correct or do you update it even if there are no messages using a prediction algorithm?
If that is the case then I guess I could use a function to sync the local time with PhotonNetwork.time instead or is there a better way?
I've got a game called Multiroids which currently runs on Windows Store (Windows Phone & Desktop):
https://www.microsoft.com/en-us/store/p/multiroids-online-2d-space-battle/9nblggh30w5w
In the game you can shoot bullets that travel quite fast so I decided to use RCP calls when a bullet is fired. The RPC contains a time based on PhotonNetwork.time when the bullet should arrive at the destination.
Then I lerp the position of the bullet locally on each client using PhotonNetwork.time which works.
But the problem is that sometimes the bullet starts a bit off even on the local client and it has a bit of jerky movement. I suspect that this might be caused by the fact that PhotonNetwork.time is only updated when a message arrives on the client, is that correct or do you update it even if there are no messages using a prediction algorithm?
If that is the case then I guess I could use a function to sync the local time with PhotonNetwork.time instead or is there a better way?
0
Comments
-
Hi,
There is a private static UsePreciseTimer that you can set to true. Can you try with this?
also, you should be using the time stamp of the rpc call directly, instead of sending your own start time stamp. Check out the "PhotonMessageInfo" class and the timestamp property, this might be enough for you.
also, have a look at this thread, you might find useful info:
http://forum.photonengine.com/discussion/1397/significant-problems-with-photonnetwork-time-and-timestamps
Bye,
Jean0 -
Thanks for your suggestions @jeanfabre that made it better and I'm also using PhotonMessageInfo for another issue
0