• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Desyncs at Start.

Status
Not open for further replies.
Level 4
Joined
Jan 20, 2011
Messages
65
my desync problem still exists too
one of my buddys who i test with desync every time
the other doesnt
still havent tested any further though.. just remember that when i commented trigger event registrations for specific players that it fixed it
 
Level 8
Joined
Apr 26, 2011
Messages
403
Directly after map has finished loading some peoples can be disconnected.


I fixed one of my desync/disconnect by :

- collect around 10 replay
- watch replay carefully, written down all possible action in last second before desync happen
- repeat for all replay

now, analysis the "actions" you wrote down. find out if anything in common, and check out the "code" relate to those "actions".
 
All triggers which function in the first second and before :

  • Map initialisation
    • Evénements
      • Map initialization
    • Conditions
    • Actions
      • Quête - Create a Requis quest titled Crédits with the description Map crée et édit..., using icon path ReplaceableTextures\CommandButtons\BTNChestOfGold.blp
      • Quête - Create a Requis quest titled Modes with the description -om (only mid) /// ..., using icon path ReplaceableTextures\CommandButtons\BTNCOP.blp
      • Quête - Create a Requis quest titled Commandes with the description -repick /// -sh ///..., using icon path ReplaceableTextures\CommandButtons\BTNCOP.blp
      • Quête - Create a Optionnel quest titled Avis des Joueurs with the description Tirlititi a dit : ..., using icon path ReplaceableTextures\CommandButtons\BTNSelectHeroOn.blp
      • Quête - Create a Optionnel quest titled Commandes automatis... with the description -ms : -ams et -desa..., using icon path ReplaceableTextures\CommandButtons\BTNCOP.blp
      • Partie Mêlée - Limit Heroes to 1 per Hero-type (for all players)
      • Groupe joueur - Pick every player in (All players) and do (Actions)
        • Boucle - Actions
          • Joueur - Set (Picked player) Or actuel to 850
      • Unité - Make Tower 1 0015 <gen> Invulnérable
      • Unité - Make Tower 1 0014 <gen> Invulnérable
      • Unité - Make Tower 1 0016 <gen> Invulnérable
      • Unité - Make Tower 0 0038 <gen> Invulnérable
      • Unité - Make Tower 0 0006 <gen> Invulnérable
      • Unité - Make Tower 0 0039 <gen> Invulnérable
      • Unité - Make Château 0012 <gen> Invulnérable
      • Unité - Make Tower 1 0018 <gen> Invulnérable
      • Unité - Make Tower 1 0019 <gen> Invulnérable
      • Unité - Make Tower 1 0017 <gen> Invulnérable
      • Unité - Make Tower 0 0041 <gen> Invulnérable
      • Unité - Make Tower 0 0040 <gen> Invulnérable
      • Unité - Make Tower 0 0042 <gen> Invulnérable
      • Unité - Make Forteresse 0013 <gen> Invulnérable
      • Joueur - Set name of Neutre Hostile to Neutre Hostile
      • For each (Integer A) from 1 to 16, do (Actions)
        • Boucle - Actions
          • Joueur - Turn Donner récompense On for (Player((Integer A)))
          • Groupe joueur - Add (Player((Integer A))) to StreakPGroup_Display
          • Set BaseName[(Integer A)] = (Name of (Player((Integer A))))
      • Set Colour[1] = |cffff0303
      • Set Colour[2] = |cff0042ff
      • Set Colour[3] = |cff1ce6b9
      • Set Colour[4] = |cff540081
      • Set Colour[5] = |cfffffc01
      • Set Colour[6] = |cfffeba0e
      • Set Colour[7] = |cff20c000
      • Set Colour[8] = |cffe55bb0
      • Set Colour[9] = |cff959697
      • Set Colour[10] = |cff7ebff1
      • Set Colour[11] = |cff106246
      • Set Colour[12] = |CFF4A2800
      • Set Colour[13] = |cFF5A5A5A
      • Set Couleur_txt[1] = red
      • Set Couleur_txt[2] = blue
      • Set Couleur_txt[3] = teal
      • Set Couleur_txt[4] = purple
      • Set Couleur_txt[5] = yellow
      • Set Couleur_txt[6] = orange
      • Set Couleur_txt[7] = green
      • Set Couleur_txt[8] = pink
      • Set Couleur_txt[9] = grey
      • Set Couleur_txt[10] = lightblue
      • Set Couleur_txt[11] = darkgreen
      • Set Couleur_txt[12] = brown
      • Visibilité - Create an initially Activé visibility modifier for Joueur 1 (Rouge) emitting Visibilité across Base T1 <gen>
      • Visibilité - Create an initially Activé visibility modifier for Joueur 7 (Vert) emitting Visibilité across Base T2 <gen>
      • Joueur - Masquer Joueur 1 (Rouge) in the post-game score screen
      • Joueur - Masquer Joueur 7 (Vert) in the post-game score screen
  • Time Seconds
    • Evénements
      • Temps - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Seconds = (Seconds + 1)
      • Groupe joueur - Pick every player in (All players) and do (Actions)
        • Boucle - Actions
          • Joueur - Set (Picked player) Nourriture utilisée to Seconds
  • OneSec Elapsed GT
    • Evénements
      • Temps - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Groupe joueur - Pick every player in (All players) and do (Actions)
        • Boucle - Actions
          • Unité - Create 1 Nothing for (Picked player) at (Center of nothing region <gen>) facing Orientation bâtiment par défaut degrees
      • Destructible - Pick every destructible in (Entire map) and do (Actions)
        • Boucle - Actions
          • Déclencheur - Add to Respawn Tree <gen> the event (Destructible - (Picked destructible) dies)
Script Code Perso
JASS:
function SetUnitXY takes unit u, real x, real y returns nothing
    call SetUnitX(u, x)
    call SetUnitY(u, y)
endfunction
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Nothing directly. Have the desyncs disappeared by disabling these triggers? If so, you can further narrow down the problem, deactivating only parts of it. The sole possible event calls I see here are the player property lines (but you do not have an event registered for it) and create unit. SetUnitXY is only used on Starfall.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
And I cannot guess all the way. Would be easier if I could reconstruct the problem. If the percentage of occurences is not so low, I will try it later again with my laptop as other client. Or we can also meet up and test together but not now, would be available in about 4 hours.
 
Try to deactivate all your triggers and test your map.

If desync still happens:
- try resetting the tileset and test again ... sometimes tiles can be corrupt when using newgen or WEU (happened to me once)
- check object editor for extreme values ... extreme values like 1000000000 life for a unit or extreme regeneration/damage were reported to desync at certain circumstances
- do you use hostbots? try hosting without
- remove all imported data and test again; sometimes models/sounds/etc. can cause crit errors (which are often mistaken for desyncs)

If desync doesnt happen:
- check for dangerous actions in triggers: Pan Camera as Necessary, Getting the player slot state at map init (can cause desync!), etc.
 
Level 8
Joined
Apr 26, 2011
Messages
403
JASS:
function SetUnitXY takes unit u, real x, real y returns nothing
    call SetUnitX(u, x)
    call SetUnitY(u, y)
endfunction
SetUnitX and SetUnitY crashes
Using the SetUnitX/SetUnitY natives causes crashes if the given coordinate is outside the playable map area (the initial value of the bj_mapInitialPlayableArea rect global). The solution to this problem is simply to check that the coordinate isn't outside that rect before calling the native.

  • Actions
  • Groupe joueur - Pick every player in (All players) and do (Actions)
  • Boucle - Actions
  • Unité - Create 1 Nothing for (Picked player) at (Center of nothing region <gen>) facing Orientation bâtiment par défaut degrees
Creating units outside the playable map area causes crashes
Creating a unit outside the playable map area (the initial value of the bj_mapInitialPlayableArea rect global) cayses crashes. The solution to this problem is simply to check that the given coordinates aren't outside that rect before calling the native.

because your code is for local player, it only crash idividual player (this is call "desyncs")


since you use difference language, try avoid special character ?
Invalid integers cause crashes when saving
Invalid integer values, for example rawcodes, can cause a crash upon saving the map in the WE. 'ÆØpo' would for example cause a crash a neither 'Æ' nor 'Ø' is an accepted value.
 
Level 8
Joined
Apr 26, 2011
Messages
403
also, check the defail JASS action for :

  • Groupe joueur - Pick every player in (All players) and do (Actions)
  • Boucle - Actions
because every actions inside are GetLocalPlayer().
and desync usually happen when something done inside GetLocalPlayer().
 
Level 4
Joined
Jan 20, 2011
Messages
65
Try to deactivate all your triggers and test your map.

If desync still happens:
- try resetting the tileset and test again ... sometimes tiles can be corrupt when using newgen or WEU (happened to me once)
- check object editor for extreme values ... extreme values like 1000000000 life for a unit or extreme regeneration/damage were reported to desync at certain circumstances
- do you use hostbots? try hosting without
- remove all imported data and test again; sometimes models/sounds/etc. can cause crit errors (which are often mistaken for desyncs)

If desync doesnt happen:
- check for dangerous actions in triggers: Pan Camera as Necessary, Getting the player slot state at map init (can cause desync!), etc.

ty for finally a nice informative post, i am sure that the tileset was my desync problem since i used newgen and it also messed up my forces in the lobby

also, check the defail JASS action for :

  • Groupe joueur - Pick every player in (All players) and do (Actions)
  • Boucle - Actions
because every actions inside are GetLocalPlayer().
and desync usually happen when something done inside GetLocalPlayer().

is that gui function the ForForce() function in jass? i think i tested this function if it is doing things only for local players, and it didnt
but i tested it useing Player(15) .. neutral player .. i put a display to all text in there and i saw it
oh i remember even testing with several computer players, i also saw multiply msgs for each computer then
is it desyncing in battle net?!?! that would be fatal for me^^
 
Level 8
Joined
Apr 26, 2011
Messages
403
is that gui function the ForForce() function in jass? i think i tested this function if it is doing things only for local players, and it didnt
but i tested it useing Player(15) .. neutral player .. i put a display to all text in there and i saw it
oh i remember even testing with several computer players, i also saw multiply msgs for each computer then
is it desyncing in battle net?!?! that would be fatal for me^^

not sure because I don't have world editor with me atm. I think (picked player) usually end up with the fucntion GetLocalPlayer().

also more useful information from this post :
http://www.thehelper.net/forums/showthread.php/89207-JASS-GetLocalPlayer()?p=722831#post722831

Second, creating handles is not the only thing that can/will cause a desync. Lets see if I remember them all :
1. Creating or destroying a handle
2. Use a string for the first time
3. Change the game in any way that affects gameplay (eg, change the move speed of a unit).
4. Assign a new random seed.
5. Pretty much anything that have an effect that you can read later.
6. TriggerSleepAction

Not all of the causes desyncs directly. For example the following code wont desync until the second if:
JASS:
set udg_Integer = 1
if Player(0) == GetLocalPlayer() then
    set udg_Integer = 2 
endif
call TriggerSleepAction(5)  // wait 5 seconds
if udg_Integer == 2 then
   call CreateTimer()
endif
actually, I don't understand why the code above cause desync.

so just avoid "wait()" or GetLocalPlayer()
 
So, I need to remove all the "pick every player" and replace them by a loop (from 1 to 12).

But the SetUnitX/Y can cause desync only if you go out the playable map ?

Edit :

since you use difference language, try avoid special character ?

It's a bug of the "copy as text". The "é", "è", "à", etc... who are commonly used in the french WE, become things like "â" or others.
For example : "Equal to" is "Egal à" in the french WE. When you copy as text, it become "â"
 
Last edited:
Level 26
Joined
Aug 18, 2009
Messages
4,097
SetUnitXY can cause a fatal error when out of the bounds but should be synced to my knowledge. And it's crashing not outside the playable map area but more outside I guess of the range of the coordinate variables, in any case, that's greater than the world bounds.

@Vladadamm: Anyway, you only call it in the Starfall triggers which should not fire at this moment.

Player Group loop/ForForce is not async, why should it be? Every client iterates through the same group with the same picked players in the same order.
 
Level 4
Joined
Jan 20, 2011
Messages
65
u can apply logical thinking to this desync stuff
as long as every player is processing the same amount of code, they wont desync

so like:

JASS:
if( GetLocalPlayer() == Player(0) ) then
    call SetTextTagVisibility( texttag , true )
endif

if( GetLocalPlayer() != Player(0) ) then
    call SetTextTagVisibility( texttag , false )
endif
this wont desync since every player doing the same things at same time

JASS:
if( GetLocalPlayer() == Player(0) ) then
    call SetTextTagVisibility( texttag , true )
endif
call TriggerSleepAction(1)
if( GetLocalPlayer() != Player(0) ) then
    call SetTextTagVisibility( texttag , false )
endif
now this will desync (mb not with texttagvisibility) but its dangerous because players not doing the same things.. they get out of sync, the wait is allowing it to desync
so my point is u can desync players without waits inbetween aslong as u sync them again before a wait occures^^
but small functions like PanCameraTo() work even if only one player does it, i think because the camera is a local thing anyway... other players dont need to know where ur camera is... or something^^
 
Status
Not open for further replies.
Top