• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Desync

Status
Not open for further replies.
I'm at the point where I have no idea why my map desyncs.

With or without GHost++, hosting the latest beta of my map results in a desync when a south trader buys a raw wood mission or a north trader buys a goblin potion mission.

1) play a game with 2+ players (private please)
2) get lumber by trading (use a trade ship)
3) purchase a raw wood contract or goblin potion contract
4) watch the server split

why can't I figure it out? Because I have no trigger in my map that refers to the above event, and therefor nothing to debug.

If anyone could help me out I'd be much appreciative.

http://filesmelt.com/Filehosting2/downloader.php?file=(10)BShipsTourney031xxiv.w3x
 
Last edited:
Level 3
Joined
Aug 20, 2008
Messages
54
I have a similar problem, I once deleted every trigger in my map to find it still desync'ing.

There may possibly be an object of some kind that is doing it, Im trying to find out the answer myself.

If I find out what it is, Ill post it here for you.
 
Level 3
Joined
Aug 20, 2008
Messages
54
GetLocalPlayer() is a desyncing function yes, but its not the only thing that desyncs.

I still have to find my solution, but maybe yours is different, try some of these:

The player(s) recently played a Widitized map (such as DoTA, or ToB) causing them to auto-desync in every game after that, they must restart War3.

Using certain natives will cause Mac users to desync as well, such as Damage units in Area, Terrain Deformations, and some Camera angles (based on Z).

If any of that helped then mark your thread as solved, otherwise Ill try to find out more about it.
 
Map is open source and not using any kind of widgetizer and IDC about mac users.

I know GetLocalPlayer() can cause desyncs but I've looked at all the places I've used it and I don't find anything wrong.

If you download the map it is completely readable if you have JNGP, so tell me if I'm wrong about my triggers with GetLocalPlayer()
 
Coke, a noob still...

Lol, I once had a weird desync. You can get desynced when using cameras (in my case it was panning cam with 0 sec wait)

Hoernchen, a noob still, the only desync causing camera commands are the "pan camera as necessary" actions and my map does not use any of them.

Why not open the map and show me where the problem is?
 
Level 2
Joined
Nov 5, 2008
Messages
9
You have a trigger, lumberFix, that sets the local player's lumber to the udg_PlayerLumber[x] variable corresponding to the local player every .5 seconds. It would stand to reason that buying anything that costs lumber could cause a desync if everyone else's client thinks you don't have enough.

You also use GetLocalPlayer() to set the local player's gold and lumber to 0 after one side wins. This would almost assuredly cause desyncs if players bought items after that point. However, it doesn't look like play continues afterwards, so it's no big deal.
 
northWin:
JASS:
function northWinFP takes nothing returns nothing
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
endfunction

function northWinFG takes nothing returns nothing
    call RemoveUnit(GetEnumUnit())
endfunction

function northWinA takes nothing returns nothing
    call KillUnit(gg_unit_n00V_0075)
    call DisplayTextToPlayer(GetLocalPlayer(),0,0,"The |cff6666FFNorth Alliance|r is victorious!")
    call StartSound(gg_snd_Win)
    call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT,10,"ReplaceableTextures\\CameraMasks\\White_mask.blp",0,0,0,0)
    call ForForce(bj_FORCE_ALL_PLAYERS,function northWinFP)
    call DisableTrigger(gg_trg_secondGold)
    call DisableTrigger(gg_trg_empireGold)
    call DisableTrigger(gg_trg_lumberFix)
    call TriggerSleepAction(10)
    call ForGroup(GetUnitsInRectMatching(bj_mapInitialPlayableArea,null),function northWinFG)
    call DisableTrigger(gg_trg_killsRespawn)
    call applyCamEnd()
endfunction

function InitTrig_northWin takes nothing returns nothing
    set gg_trg_northWin = CreateTrigger()
    call TriggerRegisterUnitEvent(gg_trg_northWin,gg_unit_n000_0020,EVENT_UNIT_DEATH)
    call TriggerAddAction(gg_trg_northWin,function northWinA)
endfunction


southWin:
JASS:
function southWinFP takes nothing returns nothing
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction

function southWinRemoveEnumUnit takes nothing returns nothing
    call RemoveUnit(GetEnumUnit())
endfunction

function southWinA takes nothing returns nothing
    call KillUnit(gg_unit_n00V_0077)
    call DisplayTextToPlayer(GetLocalPlayer(),0,0,"The |cffFF6666South Alliance|r is victorious!")
    call StartSound(gg_snd_Win)
    call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT,10,"ReplaceableTextures\\CameraMasks\\White_mask.blp",0,0,0,0)
    call ForForce(bj_FORCE_ALL_PLAYERS,function southWinFP)
    call DisableTrigger(gg_trg_secondGold)
    call DisableTrigger(gg_trg_empireGold)
    call DisableTrigger(gg_trg_lumberFix)
    call TriggerSleepAction(10)
    call TriggerSleepAction(10)
    call ForGroup(GetUnitsInRectMatching(bj_mapInitialPlayableArea,null),function southWinRemoveEnumUnit)
    call DisableTrigger(gg_trg_killsRespawn)
    call applyCamEnd()
endfunction

function InitTrig_southWin takes nothing returns nothing
    set gg_trg_southWin = CreateTrigger()
    call TriggerRegisterUnitEvent(gg_trg_southWin,gg_unit_n000_0018,EVENT_UNIT_DEATH)
    call TriggerAddAction(gg_trg_southWin,function southWinA)
endfunction

lumberFix:
JASS:
function lumberFixFP takes nothing returns nothing
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER,udg_PlayerLumber[GetPlayerId(GetEnumPlayer())+1])
endfunction

function lumberFixA takes nothing returns nothing
    call ForForce(bj_FORCE_ALL_PLAYERS,function lumberFixFP)
endfunction

function InitTrig_lumberFix takes nothing returns nothing
    set gg_trg_lumberFix = CreateTrigger()
    call TriggerRegisterTimerEvent(gg_trg_lumberFix,.5,true)
    call TriggerAddAction(gg_trg_lumberFix,function lumberFixA)
endfunction
 
Level 2
Joined
Nov 5, 2008
Messages
9
JASS:
function northWinFP takes nothing returns nothing
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
endfunction
Shouldn't that be:
JASS:
function northWinFP takes nothing returns nothing
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction

That's most likely not the problem though. Unless I overlooked something, what you did should fix it... Are you sure nothing has changed?

I'll check again.

Edit: Sorry but I can't find anything. I'd suggest commenting out the "lumberFix" trigger and setting each player with some initial amount of lumber. Check then to see if the problem is still there. If it is, go through methodically and comment out/circumvent each trigger that deals with the items in question one by one (namely "tradeItemsOnlyForTraders" but there may be others). Isolate the problem and it should be more apparent what's wrong.
 
Last edited:
JASS:
function northWinFP takes nothing returns nothing
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
endfunction
Shouldn't that be:
JASS:
function northWinFP takes nothing returns nothing
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
    call SetPlayerState(GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER,0)
endfunction

That's correct, thank you.

That's most likely not the problem though. Unless I overlooked something, what you did should fix it... Are you sure nothing has changed?

Positive, those are the only 3 triggers I modified.

I'll check again.

Edit: Sorry but I can't find anything. I'd suggest commenting out the "lumberFix" trigger and setting each player with some initial amount of lumber. Check then to see if the problem is still there. If it is, go through methodically and comment out/circumvent each trigger that deals with the items in question one by one (namely "tradeItemsOnlyForTraders" but there may be others). Isolate the problem and it should be more apparent what's wrong.

That's what I've been attempting to do.. unfortunately you can't really test if it's fixed without playing online so isolating the problem even up to just figuring out how to trigger the desync has taken awhile.

Thank you for the help though, +reps

I'm still looking for a solution, if anyone can help me.
 
Level 2
Joined
Jun 15, 2007
Messages
12
Make sure you only use natives in GetLocalPlayer() blocks.


Try putting your StartSound in a GetLocalPlayer block.
 
Status
Not open for further replies.
Top