Here’s the link to download the map (it’s in the folder): https://github.com/Luashine/wc3-test-maps/tree/master/EarlyTimerDesyncsLua (commit 6388713)
Sorry about wasting time on this back-and-forth, I was too afraid of posting external links in my first post ^_^
Again, absolutely positive about reproduction in current Retail 2.0.3.22988 and PTR 2.0.3.23052
During further extensive testing, I determined it may be related to
my other bug report with regards to GC: Desync due to Lua objects and GC (init phase) except the current one is reachable from GUI Trigger Editor.
Why? Look at this code, generated by WE for this map (called via main()):
udg_aTimer = nil
gg_trg_Melee_Initialization = nil
gg_trg_InitTriggerMAPINITDesyncs = nil
gg_trg_InitTriggerDelay0Desyncs = nil
gg_trg_InitTriggerDelay5Desyncs = nil
function InitGlobals()
udg_aTimer = CreateTimer() -- required to desync at 0:15
end
function Trig_InitTriggerMAPINITDesyncs_Actions()
StartTimerBJ(udg_aTimer, true, 0.01) -- required to desync at 0:15
end
function InitTrig_InitTriggerMAPINITDesyncs()
gg_trg_InitTriggerMAPINITDesyncs = CreateTrigger()
TriggerAddAction(gg_trg_InitTriggerMAPINITDesyncs, Trig_InitTriggerMAPINITDesyncs_Actions)
end
function Trig_Melee_Initialization_Actions()
MeleeStartingVisibility()
MeleeStartingHeroLimit()
MeleeGrantHeroItems()
MeleeStartingResources()
MeleeClearExcessUnits()
MeleeStartingUnits()
MeleeStartingAI() -- this and the rest were not tested
MeleeInitVictoryDefeat() -- required to desync at 0:15
end
It turns out, the desync only happens if:
- my timer is created and started
MeleeInitVictoryDefeat() is enabled in GUI. If you look at this blizzard.j function, it creates a lot of objects:
- creates many triggers that overwrite local variables (thus game objects going out of scope → potential GC)
- timer dialogs
- creates and starts a 2.0s timer at the end
Note: the desync immediately triggers the victory condition for host.
My hypotheses are:
- either the first game turn is not properly synced (my GUI timer is 0.01s periodic, game turns are 0.1s(?))
- or it’s the GC
Tested in “self-LAN” on my PC with 2 clients: multiplayer, two players.
Thank you. I, we, appreciate the renewed care a lot.
UPD: I asked someone else to test, GrapesOfWath said he did not have a desync. I tried again, downloading my map from the same link: desyncs for me 100%.
Tested: enUS and ruRU locales. Allow Local Files = 0. Windows 10: winver.exe Version 22H2 (OS Build 19045.6093)
I will ask more people to test this and the other test map too (root object GC test case).