RevenantX/LiteNetLib

Client Server time synchronizing

nongvantinh opened this issue · 1 comments

I'm about to create a fast-paced action game, At the start of a match, client and server sync time and set the match time to 00:00.

Can I use NetPeer.RemoteUtcTime to sync time between server and client to the start of 00:00?

Or do I have to use NtpPacket to do that?

Library version: 0.9.5.2
Framework: [.NET 6, Godot]

OS: [Linux, Windows, Android, iOS]

I'm about to create a fast-paced action game, At the start of a match, client and server sync time and set the match time to 00:00.

Can I use NetPeer.RemoteUtcTime to sync time between server and client to the start of 00:00?

Or do I have to use NtpPacket to do that?

Library version: 0.9.5.2 Framework: [.NET 6, Godot]

OS: [Linux, Windows, Android, iOS]

most fast paced games uses fixed tick rate for game logic and tick-time calculation (like 30 TicksPerSecond or 60). So if your game logic is 30 ticks per second - then you can sync time based on tick number on server and local tick number on client.