Is there any effective way to debug desyncs? Like having a breakpoint before the desync or saved logs or something?
I have a fairly non-deterministic and unusual desync, where myself and a friend of mine (and my other account on a VM) never desync (or at least very rarely), but everyone else in the game tends to nearly immediately after the map loads (tested about 3 times).
I've tried removing various parts of the code and trying to narrow down the cause, and tried bisecting it to a specific version via source control but neither have proven to be very successful due to the random nature of the desync. I suspect versions which we deem to be "good" and don't desync were actually bad, just didn't hit whatever weird edge case causes the desync, which leads me even further off track.
Does anyone have any advice around this? I've written everything in lua if it helps. How do people usually go about solving these kind of random, inconsistent desyncs?
Is it possible that people with slower PCs are not able to keep up with the tight loops running on the host (I have a couple of 0.0078125s loops) and therefore fall behind in execution and desync? If this is the case, how would anyone guarantee people not to fall behind? I'd imagine WC3 would somehow ensure each players loops are synced? Maybe slowing down the fastest loop to match the slowest player?
How do triggers actually get synced between players? Is order guaranteed (I expect it has to be, or else we'd see many more desyncs across the board)? Are timers synced & guaranteed to be the same?
For example, if I have a trigger that when a player presses "Q", I create a unit and start a timer for 5 sec, but if the timer has any duration left I don't create the unit, is there a race condition where one player can enter the loop and think the timer is not finished, but another player can enter and think the timer is finished?
I have a fairly non-deterministic and unusual desync, where myself and a friend of mine (and my other account on a VM) never desync (or at least very rarely), but everyone else in the game tends to nearly immediately after the map loads (tested about 3 times).
I've tried removing various parts of the code and trying to narrow down the cause, and tried bisecting it to a specific version via source control but neither have proven to be very successful due to the random nature of the desync. I suspect versions which we deem to be "good" and don't desync were actually bad, just didn't hit whatever weird edge case causes the desync, which leads me even further off track.
Does anyone have any advice around this? I've written everything in lua if it helps. How do people usually go about solving these kind of random, inconsistent desyncs?
Is it possible that people with slower PCs are not able to keep up with the tight loops running on the host (I have a couple of 0.0078125s loops) and therefore fall behind in execution and desync? If this is the case, how would anyone guarantee people not to fall behind? I'd imagine WC3 would somehow ensure each players loops are synced? Maybe slowing down the fastest loop to match the slowest player?
How do triggers actually get synced between players? Is order guaranteed (I expect it has to be, or else we'd see many more desyncs across the board)? Are timers synced & guaranteed to be the same?
For example, if I have a trigger that when a player presses "Q", I create a unit and start a timer for 5 sec, but if the timer has any duration left I don't create the unit, is there a race condition where one player can enter the loop and think the timer is not finished, but another player can enter and think the timer is finished?