• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Desync Issues

Status
Not open for further replies.

sentrywiz

S

sentrywiz

My map causes desyncs. Multiple people tried it and each got desyncs.
This is the first time someone reports desyncs to me, so this is new to me.

Supposedly, the desync happens when people's armies are spawned in the arena. All the previous triggers have no game here, since most of them are selection triggers for the game.

Also I've read 7 threads on desyncs and most of them tell of:
- Misusing local player scripts
- Using the pan camera as necessary trigger

I'm not using either of those however. But desyncs happen. So I will post the triggers that I believe may contain some evidence of probable desync. I hope some of you with more knowledge than me can help me in spotting what is wrong.

Testing notes: I've tested this map with 9 bots and all triggers work flawlessly. But I haven't tested it online and I couldn't get JNPG 2.0 Multiplayer Emulation to work on my PC. Idk why. So while I can vouch that my triggers work, I'm sure the culprit is somewhere there.

Quick note: most triggers are launched by other triggers. I did this to avoid confusion so there is a main trigger which starts the cycle. That trigger however doesn't do anything but start other triggers.



I'm re-using the same variable for three loops. I have a vague hope that this might be wrong since in my logic, the three loops happen one by one and not all at the same time.

  • Spawn Neutral Hostiles
    • Events
    • Conditions
      • Bool_CreepsAllowed Equal to True
    • Actions
      • For each (Integer Int_Loop) from 1 to 46, do (Actions)
        • Loop - Actions
          • Set tempLoc = (Center of RegionArray[Int_Loop])
          • Set tempLoc2 = (tempLoc offset by 150.00 towards 180.00 degrees)
          • Set tempLoc3 = (tempLoc offset by 150.00 towards 360.00 degrees)
          • Unit - Create 1 Level3Unit[(Random integer number between 1 and 8)] for Neutral Hostile at tempLoc facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Unit - Create 1 Level1Unit[(Random integer number between 1 and 8)] for Neutral Hostile at tempLoc2 facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Unit - Create 1 Level1Unit[(Random integer number between 1 and 8)] for Neutral Hostile at tempLoc3 facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Custom script: call RemoveLocation ( udg_tempLoc )
          • Custom script: call RemoveLocation ( udg_tempLoc2 )
          • Custom script: call RemoveLocation ( udg_tempLoc3 )
      • Set Int_Loop = 0
      • For each (Integer Int_Loop) from 47 to 54, do (Actions)
        • Loop - Actions
          • Set tempLoc = (Center of RegionArray[Int_Loop])
          • Set tempLoc2 = (tempLoc offset by 150.00 towards 180.00 degrees)
          • Set tempLoc3 = (tempLoc offset by 150.00 towards 360.00 degrees)
          • Unit - Create 1 Level5Unit[(Random integer number between 1 and 15)] for Neutral Hostile at tempLoc facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Unit - Create 1 Level2Unit[(Random integer number between 1 and 8)] for Neutral Hostile at tempLoc2 facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Unit - Create 1 Level2Unit[(Random integer number between 1 and 8)] for Neutral Hostile at tempLoc3 facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Custom script: call RemoveLocation ( udg_tempLoc )
          • Custom script: call RemoveLocation ( udg_tempLoc2 )
          • Custom script: call RemoveLocation ( udg_tempLoc3 )
      • Set Int_Loop = 0
      • For each (Integer Int_Loop) from 55 to 64, do (Actions)
        • Loop - Actions
          • Set tempLoc = (Center of RegionArray[Int_Loop])
          • Set tempLoc2 = (tempLoc offset by 150.00 towards 180.00 degrees)
          • Set tempLoc3 = (tempLoc offset by 150.00 towards 360.00 degrees)
          • Unit - Create 1 Level8Unit[(Random integer number between 1 and 10)] for Neutral Hostile at tempLoc facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Unit - Create 1 Level6Unit[(Random integer number between 1 and 15)] for Neutral Hostile at tempLoc2 facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Unit - Create 1 Level4Unit[(Random integer number between 1 and 8)] for Neutral Hostile at tempLoc3 facing 270.00 degrees
          • Unit - Set (Last created unit) acquisition range to 200.00
          • Custom script: call RemoveLocation ( udg_tempLoc )
          • Custom script: call RemoveLocation ( udg_tempLoc2 )
          • Custom script: call RemoveLocation ( udg_tempLoc3 )
      • Set Int_Loop = 0
      • Trigger - Run Move Player Legions <gen> (checking conditions)
      • Trigger - Run Create Show MB <gen> (ignoring conditions)




Maybe the "Pan Camera For Player[X] over 0.00 seconds causes desync?

  • Move Player Legions
    • Events
    • Conditions
    • Actions
      • For each (Integer Int_Loop) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player[Int_Loop] slot status) Equal to Is playing
              • (Number of units in PlayerGroup[Int_Loop]) Greater than 0
            • Then - Actions
              • Unit - Hide Player_DummyPicker[Int_Loop]
              • Unit Group - Pick every unit in PlayerGroup[Int_Loop] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Int_Loop Less than or equal to 5
                    • Then - Actions
                      • Set tempLoc = (Center of Player_Region[Int_Loop])
                      • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
                      • Unit - Make (Picked unit) Vulnerable
                      • Unit - Move (Picked unit) instantly to tempLoc, facing 90.00 degrees
                      • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
                      • Custom script: call RemoveLocation ( udg_tempLoc )
                    • Else - Actions
                      • Set tempLoc = (Center of Player_Region[Int_Loop])
                      • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
                      • Unit - Make (Picked unit) Vulnerable
                      • Unit - Move (Picked unit) instantly to tempLoc, facing 270.00 degrees
                      • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
                      • Custom script: call RemoveLocation ( udg_tempLoc )
            • Else - Actions
      • Set Int_Loop = 0
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
I couldn't get JNPG 2.0 Multiplayer Emulation to work on my PC
You need to disable Sharpcraft first, and see if it works.

Well, nothing seems to run locally in those both triggers you showed above. So:
What event are you using? Are you sure the desync happened there?

The easiest way is to upload unprotected map and let people look for the problem for you. Since sometimes it's hard to spot where do the desync happens exactly. But I don't guarantee people will help you that way as well :p
 

sentrywiz

S

sentrywiz

You need to disable Sharpcraft first, and see if it works.

Well, nothing seems to run locally in those both triggers you showed above. So:
What event are you using? Are you sure the desync happened there?

The easiest way is to upload unprotected map and let people look for the problem for you. Since sometimes it's hard to spot where do the desync happens exactly. But I don't guarantee people will help you that way as well :p

Idk what Sharpcraft is.

There is no event. One trigger launches the main trigger which launches all the spawn triggers. IT happens after players pick their armies or the timer runs out.

Well here is a quote from a person that experienced the desyncs:

I've played this 3 different times now, and every time upon choosing your forces, the game spawns everyones units and then there is a desync. Really sad.

Here, take a look.
View attachment Legion of Creeps v1a.w3x
 
Level 19
Joined
Jul 14, 2011
Messages
875
Not sure whatis desyncing but you are paning the camera for a player once per unit:
  • Unit Group - Pick every unit in PlayerGroup[Int_Loop] and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Int_Loop Less than or equal to 5
        • Then - Actions
          • Set tempLoc = (Center of Player_Region[Int_Loop])
          • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Move (Picked unit) instantly to tempLoc, facing 90.00 degrees
          • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
          • Custom script: call RemoveLocation ( udg_tempLoc )
        • Else - Actions
          • Set tempLoc = (Center of Player_Region[Int_Loop])
          • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Move (Picked unit) instantly to tempLoc, facing 270.00 degrees
          • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
          • Custom script: call RemoveLocation ( udg_tempLoc )
->
  • ...
    • Set tempLoc = (Center of Player_Region[Int_Loop])
    • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
    • Unit Group - Pick every unit in PlayerGroup[Int_Loop] and do (Actions)
      • Loop - Actions
        • Unit - Make (Picked unit) Vulnerable
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Int_Loop Less than or equal to 5
          • Then - Actions
            • Unit - Move (Picked unit) instantly to tempLoc, facing 90.00 degrees
          • Else - Actions
            • Unit - Move (Picked unit) instantly to tempLoc, facing 270.00 degrees
    • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
    • Custom script: call RemoveLocation ( udg_tempLoc )
I dont have access to wc3 at the moment but you are also running 'Create Show MB' which may be causing the problem.
 

sentrywiz

S

sentrywiz

Not sure whatis desyncing but you are paning the camera for a player once per unit:
  • Unit Group - Pick every unit in PlayerGroup[Int_Loop] and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Int_Loop Less than or equal to 5
        • Then - Actions
          • Set tempLoc = (Center of Player_Region[Int_Loop])
          • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Move (Picked unit) instantly to tempLoc, facing 90.00 degrees
          • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
          • Custom script: call RemoveLocation ( udg_tempLoc )
        • Else - Actions
          • Set tempLoc = (Center of Player_Region[Int_Loop])
          • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Move (Picked unit) instantly to tempLoc, facing 270.00 degrees
          • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
          • Custom script: call RemoveLocation ( udg_tempLoc )
->
  • ...
    • Set tempLoc = (Center of Player_Region[Int_Loop])
    • Camera - Pan camera for Player[Int_Loop] to tempLoc over 0.00 seconds
    • Unit Group - Pick every unit in PlayerGroup[Int_Loop] and do (Actions)
      • Loop - Actions
        • Unit - Make (Picked unit) Vulnerable
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Int_Loop Less than or equal to 5
          • Then - Actions
            • Unit - Move (Picked unit) instantly to tempLoc, facing 90.00 degrees
          • Else - Actions
            • Unit - Move (Picked unit) instantly to tempLoc, facing 270.00 degrees
    • Selection - Select PlayerGroup[Int_Loop] for Player[Int_Loop]
    • Custom script: call RemoveLocation ( udg_tempLoc )
I dont have access to wc3 at the moment but you are also running 'Create Show MB' which may be causing the problem.

Oh many thanks. I totally didn't see that. Thanks!
Also your updated trigger is great too.
I've updated it. +rep

Create MB creates multiboard if its the first round. If not it only shows the mb. There are no loops or picking units.
 
Although the scripts are the culprit in 90% of the cases, there are a few things related to the object editor which may also cause desyncs. For instance, if a unit has a high value for "attack - number of dice", it may cause desync when it spawns. To be safe you should not use values higher than 5, or at least 10, here. If you want a large roll, it is better to use "sides per die" and keep "number of dice" to 1. Units with ridiculously high health also used to cause desyncs (but this is not common afaik). Spell books, if used with bad values, have been known to cause rare desyncs. Checking player slot states on map init, aswell as running cinematic fade filters on map init, are prone to cause server split on map start.

The only thing in your triggers i see that uses some kind of local code are the unit selections. The way you do it should not be a problem, but just to be safe, try disabling all actions related to selection and try the map again.
 

sentrywiz

S

sentrywiz

Although the scripts are the culprit in 90% of the cases, there are a few things related to the object editor which may also cause desyncs. For instance, if a unit has a high value for "attack - number of dice", it may cause desync when it spawns. To be safe you should not use values higher than 5, or at least 10, here. If you want a large roll, it is better to use "sides per die" and keep "number of dice" to 1. Units with ridiculously high health also used to cause desyncs (but this is not common afaik). Spell books, if used with bad values, have been known to cause rare desyncs. Checking player slot states on map init, aswell as running cinematic fade filters on map init, are prone to cause server split on map start.

The only thing in your triggers i see that uses some kind of local code are the unit selections. The way you do it should not be a problem, but just to be safe, try disabling all actions related to selection and try the map again.

Except the thing that Gizmo pointed out, I haven't found anything else.
Because I don't know if that is all, I can only hope that it fixes it.

But other than that, all the things you said aren't the case here.
It has to be the triggers. The units are default neutral hostile
and the map is a modded RagingStream from Blizz official map pool.
 

EdgeOfChaos

E

EdgeOfChaos

Are you 100% sure it's one of these triggers?

If so, I've heard "Slot Status" comparisons can cause desync, try removing them and testing.
 

sentrywiz

S

sentrywiz

Are you 100% sure it's one of these triggers?

If so, I've heard "Slot Status" comparisons can cause desync, try removing them and testing.

You mean if player is user/computer?
If so, this is a first because I've been using them for a long time.

Also I can't test because there is no desync when I test with bots.
And I can't test online, cuz I have nobody to test with.

The trigger "Move Player Legions" could possibly be the cause of the OOS. You are forcing a lot of selection commands and pan camera commands. Such actions have been known to cause OOS when run at map initialization or near then.

Well idk about forcing too many selections.

But Gizmo's suggestion was good, because I was panning camera for each unit selected. That sounds like awful lot of work and a good reason for desync. I'm just hoping that was the sole reason.
 
Level 6
Joined
Jan 4, 2014
Messages
227
Run Move Player Legions or Create Show MB, one of those two triggers may cause the DeSync, send them pleas.
 
Problem: The correct solution is right in your own question.

Solution: Create 3 new loops for each of them & enjoy

You should know that warcraft executes the functions one by one, and not in parallel. Using the same global in multiple functions does not necessarily mean a problem.

About the slot status comparison: desync only happens if this is done on map init, not after. This is because slot statuses are not synchronized while the map is loading.
 
Status
Not open for further replies.
Top