-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I noticed the Unreal client runs on its own clock, and updates only if there is a new server tick.
I was thinking it would be nice to be able to guarantee the server and client are synchronized and operating in lock-step.
Also, synchronizing clients would allow faster than real time simulation without worrying about missing ticks.
A few ideas:
1. Use a counting semaphore, the server increases it to some value based on how many clients are expected, then each client decrements the value when it reads. The server only continues to the next tick once the value reaches 0.
2. Keep using the existing binary semaphore, but have a separate semaphore for each expected client (server sets to 1 and waits until client sets to zero, client does opposite).
3. Use the client shared memory. Each client could write the latest tick they received to the client shared memory (or maybe some new shared memory space). The server only continues to the next tick if it sees tick updates from all expected clients.
(EDIT: See ping-pong semaphores in following post)
Anyway, just curious if there were any ideas already floating around, or if there are any preferences in implementation. I'm leaning towards 1 or 2 because then it would be easy to implement using existing semaphore wait/blocking calls.
This isn't something we need right away, but I can see us implementing it later.