Answer the question
In order to leave comments, you need to log in
How to set movement according to server time?
The idea is as follows - the coordinates of units' movement are calculated on the server, this data is sent to clients, then the client already "plays" the given scenario.
That is, if a player enters the game and there is already a battle going on, then units are placed for him based on the real time that was written in the script.
Example
index | date time | x,y,z
coordinates unit1 | 2020-08-07 15:00:00 | 0x0x0
unit1 | 2020-08-07 15:00:01 | 2x0x2
unit1 | 2020-08-07 15:00:02 | 4x0x2
unit1 | 2020-08-07 15:00:03 | 6x0x2
Answer the question
In order to leave comments, you need to log in
Time synchronization needs to be done every n-microseconds on the server "heart-beat".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question