HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Desync incredibly frustrating

11-28-2002, 02:48 AM#1
MicrosoftXP
Ok heres the situation, My map that i've been working on for some months has always worked fine, but in a recent version i started experiencing a massive simultaneous disconnect thing. What happens is about 4 to 5 minutes into the game 2 or 3 or more players will 'drop' at the exact same time. However they dont just drop, they are still in the game but for them it apears as if everyone else has dropped. I was told that this is called desync and it is very obvious when it happens because in my map there is a trigger that displays a message to all if a player drops. It doesnt happen all the time and it doesnt happen at a set time into the map. I've watched about 10-15 replays of this happening and I have no ****ing clue what is causing it.

Below is a list of everyone that has changed between the last working version and the time that this bug first start appearing.

1. Changed from standard Lordaeron Fall tileset to Custom replacing (not any currently used textures) with 3 from Cityscape tileset. (Also when i changed I got a yellow message on the screen Removed Unit -3.566 5.600 something like that and two units were gone that had been placed near a tree doodad)

2. Added Magical Rune and Magical Lantern doodads

3. Changed terrain somewhat, cliff locations and forest placement.

4. Turned Player flag 'gives bounty' On for all players

5. Added action line 1 to the following trigger
Events:
Map Init
Actions:
Sound - Play sound LightningBolt1 <gen>
Special Effect - Create a special effect at (Random point in Center Shop <gen>) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdx
Set lightning[1] = (last created special effect)
wait 0.90 seconds
Special Effect - Destroy lightning[1]
Wait (4.00 x ((Random percentage) + 1.00)) seconds
Trigger - Run (This trigger) (ignoring conditions)

Also note I have a similar trigger with the variable lightning[1] replaced by lightning[2] and wait 0.90 by wait 1.10

6. Added a share units trigger:
Events:
Player - Player 1 (Red) types a chat message containing -take as An exact match
Player - Player 2 (Blue) types a chat message containing -take as An exact match
Player - Player 3 (Teal) types a chat message containing -take as An exact match
Actions:
If (Player 1 (Red) slot status) Equal to Has left the game) then do (Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Unit change ownership of (Picked unit) to (Triggering Player) and retain color)) else do (Do nothing)
If (Player 2 (Blue) slot status) Equal to Has left the game) then do (Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Unit change ownership of (Picked unit) to (Triggering Player) and retain color)) else do (Do nothing)
If (Player 3 (Teal) slot status) Equal to Has left the game) then do (Unit Group - Pick every unit in (Units owned by Player 3 (Teal)) and do (Unit change ownership of (Picked unit) to (Triggering Player) and retain color)) else do (Do nothing)
<THIS TRIGGER WORKS>

7. Added a paladin resurrection trigger:
Events
Unit - A unit owned by Player 1 (Red) Is issued an order with no target
Conditions
(Issued order) Equal to (Order(resurrection))
Actions
Unit Group - Pick every unit in (units within 900.00 of (Position of (Ordered unit)) matching ((Owner of (Matching unit)) Equal to Player 10 (Light blue))) and do (If (((Picked unit) is dead) Equal to true then do (Unit - Change ownership of (Picked unit) to (Owner of (Ordered unit)) and change color) else do (Do nothing)))
<THIS TRIGGER WORKS>

Similar triggers for players 2 - 9

8. Added team upgrade triggers:
I. Trigger: Upgrade Init
Events:
Map Init
Actions:
For each (Integer A) from 1 to 6, do (Set upgrades1[(Integer A)] = 0)
For each (Integer A) from 1 to 6, do (Set upgrades2[(Integer A)] = 0)
For each (Integer A) from 1 to 6, do (Set upgrades3[(Integer A)] = 0)
Set upgrades[1] = Iron Forged Swords
Set upgrades[2] = Iron Plating
Set upgrades[3] = Black Gunpowder
Set upgrades[4] = Studded Leather Armor
Set upgrades[5] = Improved Masonry
Set upgrades[6] = Defend
Set upgrades[7] = Long Rifles
Set upgrades[8] = Animal War Training
Set upgradeDescriptions[1] = Your town's Melee units now have Stronger Weapons!
Set upgradeDescriptions[2] = Your town's Melee units now have Thicker Armor!
Set upgradeDescriptions[3] = Your town's Ranged units now have more Powerful Guns!
Set upgradeDescriptions[4] = Your town's Ranged units now have Thicker Armor!
Set upgradeDescriptions[5] = Your town's Buildings have been Fortified!
Set upgradeDescriptions[6] = Your town's War Technologies have been Improved!

II. Trigger: Upgrade set
Events:
Unit - A unit enters Upgrade1 <gen>
Conditions
((Unit-type of (Triggering unit)) Equal to Melee Armor Upgrade ) or (((Unit-type of (Triggering unit)) Equal to Melee Attack Upgrade ) or (((Unit-type of (Triggering unit)) Equal to Ranged Attack Upgrade ) or (((Unit-type of (Triggering unit)) Equal to Ranged Armor Upgrade ) or (((Unit-type of (Triggering unit)) Equal to Structural Fortification Upgrade ) or (((Unit-type of (Triggering unit)) Equal to War Technologies Upgrade ))))))
Actions:
Unit - Remove (Triggering unit) from the game
Set upgradeIndex = 0
If ((Unit-type of (Triggering unit)) Equal to Melee Attack Upgrade ) then do (Set upgradeIndex = 1) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to Melee Armor Upgrade ) then do (Set upgradeIndex = 2) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to Ranged Attack Upgrade ) then do (Set upgradeIndex = 3) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to Ranged Armor Upgrade ) then do (Set upgradeIndex = 4) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to Structural Fortification Upgrade ) then do (Set upgradeIndex = 5) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to War Technologies Upgrade ) then do (Set upgradeIndex = 6) else do (Do nothing)
Trigger - Run Upgrade use <gen> (checking conditions)

III. Trigger: Upgrade use
Actions:
Set upgrades1[upgradeIndex] = upgrades1[upgradeIndex] + 1
If (upgrades1[upgradeIndex] Less than or equal to 6) then do (Do nothing) else do (Skip remaining actions)
If ((upgrades1[upgradeIndex Equal to 1) or ((upgrades1[upgradeIndex] Equal to 3) or (upgrades1[upgradeIndex] Equal to 6))) then do (Game Display to (All allies of Plyer 10 (Light Blue)) for 30.00 seconds the text: (An Upgrade has been researched! + upgradeDescriptions[upgradeIndex]) else do (Do nothing)
If (upgradeIndex Equal to 6) then do (If (upgrades1[upgradeIndex] Equal to 1) then do (Player - Set the current research level of upgrades[6] to 1 for Player 10 (Light Blue)) else do (Do nothing)) else do (Do nothing)
If (upgradeIndex Equal to 6) then do (If (upgrades1[upgradeIndex] Equal to 3) then do (Player - Set the current research level of upgrades[7] to 1 for Player 10 (Light Blue)) else do (Do nothing)) else do (Do nothing)
If (upgradeIndex Equal to 6) then do (If (upgrades1[upgradeIndex] Equal to 6) then do (Player - Set the current research level of upgrades[8] to 1 for Player 10 (Light Blue)) else do (Do nothing)) else do (Do nothing)
If (upgradeIndex Equal to 6) then do (Skip remaining actions) else do (Do nothing)
If (upgrades1[upgradeIndex] Equal to 1) then do (Player - Set the current research level of upgrades[upgradeIndex] to 1 for Player 10 (Light Blue)) else do (Do nothing)
If (upgrades1[upgradeIndex] Equal to 3) then do (Player - Set the current research level of upgrades[upgradeIndex] to 2 for Player 10 (Light Blue)) else do (Do nothing)
If (upgrades1[upgradeIndex] Equal to 6) then do (Player - Set the current research level of upgrades[upgradeIndex] to 3 for Player 10 (Light Blue)) else do (Do nothing)
<THESE TRIGGERS WORK>


Other possible causes
1. I installed an advanced WE to change the icons of some units to the human upgrade tech icons
2. My computer crashed a few times while running war3 and WE took a while to load after that.. longer than usual so I reinstalled and updated to 1.04 again.
3. I also thought that somehow my war3 was corrupted so I reverted to 2.1 (the last working version) rewrote (not copied) all the new triggers, changed the terrain and the tileset and still the desync happens
4. I have replaced my old map protector with another one thinking that it may be incompatible with 1.04 ? still am having problems

Notes from replays:
There is absolutely no connection that I can make between the desyncs. At first it seemed like it had to do with a player buying items from a goblin merchant type shop. But since then I have seen replays where the desync happens for players that are just out in the middle of the map fighting other heros or computer controlled units.

The next thing I am going to try is to disable all the new triggers or triggers with new parts and see if it will still desync, then enabling a few at a time I hope to narrow the search down...

Please if you see anything that I'm doing that could cause desync dont hesitate =) this is really causing me to lose a lot of sleep.. literally
11-28-2002, 03:04 AM#2
ph33rb0
If you have REALLY long singular actions, like Pick every player... and inside is an If/Then/Else I have found those to cause problems... mainly my war3 crashes on loading the map.

Converting a player group to Triggering Player to send text messages is buggy too. Known to cause desyncs. UMSWE has an action to send one to a single player.
11-28-2002, 09:41 PM#3
Milkman
Shit, how much time did it tkae to write all that!?
Also, i would like to play your map as it looks really cool.
where can i find it? or could you mail it to me?
11-29-2002, 05:49 AM#4
ph33rb0
Milkman he posted to get help not for comments or to release his map. You really shouldn't have even posted in the thread if you weren't offering advice.
11-29-2002, 10:30 PM#5
DaKaN
post the map protected, its easiest for me to help find a problem if i see it first hand.
11-30-2002, 06:57 PM#6
MicrosoftXP
The map is called Rival Nations, and its been having this problem since v2.2-2.4

I would post the map but I'm not at school, holidays and all..

It should be easy to find a game on USWest or USEast, I'm not sure how popular it is on other realms.
12-01-2002, 05:15 AM#7
Guest
do u kno if its a maps fault of bnets fault?

theres times when we could play certain ums with no problems, and times where it keep desyncing, all being the same version of the map..
12-01-2002, 09:57 AM#8
MicrosoftXP
its the map version. 2.1 has no probs with desync
12-03-2002, 07:03 AM#9
Guest
Wanted to get in on this thread as well.

I have the exact same problem with a map that is along the same lines as rival nations. At some point one of my versions started getting desync when previous versions were fine.

When it intially happened, it was at map initialize, during that first couple seconds when people are prone to that start of game lag anyway so I didn't really recognize the problem - I just thought people were lagging out or getting dropped.

After a while I realized too many people were lagging out for that to be the problem so I tried some stuff. I moved a lot of tiggers away from Map Initialize and spaced them out over the first 20 seconds of the map. That fixed the problem with desync when the map first started but now people will desync 2 or 3 minutes lated.

I've watched replies as well and while it's very obvious when it happens, cuz 4 or 5 people just disappear at the same time, I can't find any common triggers, actions, regions, messages, or anything else, that has been able to shed any light on the problem.
12-24-2002, 07:52 PM#10
Ari
iggystar just posted about what he suspects are random numbers desync-ing his map, so that's where I'll put my money, given that you have them too. If this is truly the answer, I'd say it makes some sense, since it could create the possibility of each local computer computing a different random number. This would almost immediately cause big differences in local versions of the game, causing the desync.

Try removing the random functions, and see if things work normally. If that does prove to be the culprit, there are ways around this. One would be to use a psuedo random function based on game time and a large number of other variables (take the hundreds digit of the square root of the 2nd digit in the time, for example, and multiply by the total gold of player 1, for example). Also, I believe there is a way to have certain functions be local. In that case, simply have a single player do the random function, and then "report" that to other players.

Maybe this is all a red herring, and this has nothing to do with the problem. but my gut feeling is that iggystar may be on to something. Give it a try, and see what happens (and report back here if you have any luck).
12-24-2002, 08:23 PM#11
ZellDominiko
Desync errors I've personally encountered while map making and testing:

1.) Using a Pick Every Unit In Unit Group And Do Action with an If statement during Map Initialization has actually caused WarCraft to crash to desktop

2.) [fact] Pan Camera As Necessary will cause desyncs; instead use Pan Camera (Timed) or whatever the other one is

3.) [fact] If you are using custom trigger text (JASS), GetLocalPlayer() will disconnect everyone whether you're using it in an action or in a condition.

Not much, but I've seen people do these things quite often. And disabling triggers and enabling them in order to find which ones cause problems is a good idea. That's exactly how I find out the problems mentioned above. Remember, though, that you'll need to disable all of the Pick Every Unit functions if you are wanting to see if that is causing the problems.
12-24-2002, 08:27 PM#12
Guest
I don't use any of the 3 things you mention on my map and it still desyncs fairly regularly.

Eventually I'll pull out the randoms and see if that fixes my problem.

Sure wish blizzard would just spend 10 minutes and put out a doc.
12-24-2002, 08:55 PM#13
Locotaur
I'm pretty sure that you can get desync's when you change the game speed in the middle of a map. That's what was happening in my RPG. It may have been because I was changing the speed to slow when you can only select slowest, normal or fastest when you create a game. So if you have any game speed changing, you might wanna check on that.
12-24-2002, 09:12 PM#14
SuperIKI
You don't need to put out the randoms.
IF the random numbers are the reason for desyncing, you can set the random seed on map initialization to zero. You know, like when using the "test button" functionality of the map editor. There's a JASS function to do this in common.j.
So everybody will get the same numbers. It will even repeat the same numbers on different runs of the map.
Everybody gets the same numbers at every time.
12-24-2002, 09:13 PM#15
Guest
I guess a lot of things cause desync because I don't change speed in my map at all either.

Maybe blizzard can't put out a doc because 1000000000000000 cause desync :)

We'll have to send a doc to them.


Groovey SuperKi...thanks for the info. Setting a seed is a bazillion times better than pulling out all my randoms. I'll see if I can find that function. My map editing skills are pretty vanilla so far.