I need time sync on every client by using PhotonNetwork.time like in PUN. Is it possible to provide this property in Construct3 SDK too. Or Do you have other solutions?
We recently added methods getServerTimeMs() and syncServerTime() for LoadBalancingClient in js SDK but they are not yet exposed in the plugin.
For now, you can synchronize clients by sending a message to the master client which replies with the current game time. Correct the received value by message roundtrip time. Use this value and the current time to calculate game time.
PUN and js SDK getServerTimeMs() do basically the same: request server time once, correct it and add the time elapsed since it was received.
Could you update this function to Construct 3 plugin also?
It is quite important in my game play.
Thanks so much.
Hi @vadim I was looking at this thread as I was asking myself similar questions regarding how to sync moving elements, or even physics applied on my players (rigid body) in my game throughout all the clients connected to a room.
My first idea was to broadcast the time to every clients connected to a room, this time will be defined by the player who created the room. Not sure about that, I guess not ideal as depending on the FPS running on the device, it may not look good (I'm using mobile phones) but it was my first thought.
I was wondering if you could give me more details regarding this: "request server time once, correct it and add the time elapsed since it was received."
Q: What do you mean by correct it? How should I proceed?
Thank you for your time and help
I read couple of time your last message Vadim and I think I got the idea. I'm doing something like that to get a time consistent on my different devices:
const rtt = this.client.getRtt()
const serverTime = this.client.getServerTimeMs()
const finalTime = ( (timeServer - rtt) * -1 ) / 1000
with 'this.client' my PhotonLoadbalancing instance
Also you need to call updateRtt to refresh the Rtt value.
analyze performance and traffic on our website.
By clicking on the „Accept All“ button you consent to the use of non-functional cookies and the subsequent
processing of personal data to optimize our website and services as described in more detail in our
By clicking on the „Customize or Deny all“ button you can decide otherwise.
Clicking on the „Customize“ button will take you to a page where you can configure the usage of non-functional
cookies (and related technologies) or deny all of them. You can access these settings at any time and also
subsequently deselect cookies at any time in the footer area of our website.
We use the following categories of cookies and related technologies to enhance your experience,
show you personalized content, and analyze performance and traffic on our website.
We respect your right to privacy and accordingly you can chose to not allow some types of cookies (and related technologies).
Click on the different category sliders and change our default settings to manage your cookie settings.
For more information on the specific cookies/related technologies we use and on how we use these,
Authentication cookies we use are required to run our services … Cookies are required:
These cookies collect anonymous data and allow us to optimize our
website and user experience. These cookies are listed here:
Help us to understand how visitors interact with our services, enables us
to analyze and improve our services (also through third party analytics).