• 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.

[Trigger] Problems with serversplits

Status
Not open for further replies.
Level 4
Joined
Jul 24, 2008
Messages
108
I've been having this problem for a while now where randomly half the server leaves. I keep think i have fixed the problem and then when i test it, i desync and half the people get dced. The map is my take on kodo tag i made a few years back and now i want to update it but it keeps splitting. anyways, i think i have narrowed it down the triggers to these few

  • Flag
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
      • (Unit-type of (Triggering unit)) Equal to Runner
    • Actions
      • Set deathgroup = (Units owned by (Owner of (Triggering unit)))
      • Unit Group - Pick every unit in deathgroup and do (Unit - Kill (Picked unit))
      • Custom script: call DestroyGroup (udg_deathgroup)
      • Unit - Create 1 Flag for (Owner of (Triggering unit)) at (Random point in Flag <gen>) facing Default building facing degrees
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |c00cc3399You died!
      • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Jail <gen>) over 0.00 seconds
      • Game - Display to (All allies of (Player((Player number of (Triggering player))))) the text: (((Name of (Player((Player number of (Triggering player))))) + has been captured. ) + (Jail bonus at + ((String(((Number of units in (Units of type Flag)) x 50))) + gold!)))


and the rescue trigger


  • Rescue
    • Events
      • Unit - A unit enters Jail <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Runner
      • (Number of units in (Units of type Flag)) Not equal to 0
    • Actions
      • Trigger - Turn off (This trigger)
      • Player - Set (Owner of (Triggering unit)) Current gold to (((Owner of (Triggering unit)) Current gold) + (50 x (Number of units in (Units of type Flag))))
      • Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ((( received + ((String(((Number of units in (Units of type Flag)) x 50))) + gold for rescuing )) + (String((Number of units in (Units of type Flag))))) + player(s) from jail!!!))
      • Special Effect - Create a special effect at (Center of Runners Start <gen>) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
      • Set playercreate = (All players matching ((Number of units in (Units owned by (Matching player) of type Flag)) Equal to 1))
      • Player Group - Pick every player in playercreate and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Runner for (Picked player) at (Center of Runners Start <gen>) facing Default building facing degrees
          • Camera - Pan camera for (Picked player) to (Center of Runners Start <gen>) over 0.00 seconds
      • Custom script: call DestroyForce (udg_playercreate)
      • Set flaggroup = (Units of type Flag)
      • Unit Group - Pick every unit in flaggroup and do (Unit - Remove (Picked unit) from the game)
      • Custom script: call DestroyGroup (udg_flaggroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • lastperson Equal to True
        • Then - Actions
          • Trigger - Turn off last one left <gen>
          • Sound - Stop Doom <gen> After fading
          • Sound - Play music <gen>
          • Set lastperson = False
        • Else - Actions
          • Do nothing
      • Sound - Play escape <gen>
      • Trigger - Turn on (This trigger)



then if its not those there is a reoccurring trigger that happens 3 times but different unit types so ill link just one of them



  • Orders
    • Events
      • Time - Every 21.00 seconds of game time
    • Conditions
    • Actions
      • Set tempgroup = (Units of type |c000033ffCrazy Kodo)
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Random player from (All allies of Player 1 (Red))) matching ((Unit-type of (Matching unit)) Not equal to Flag))))
      • Custom script: call DestroyGroup (udg_tempgroup)

if anyone can just take a look at those 3 triggers and point out what can possibly cause server desyncs i would really appreciate it
 
Last edited:
Level 23
Joined
Nov 29, 2006
Messages
2,482
Desyncs can depend on different things, mainly because of a leak/leaks somewhere.
If you have a fixed time of when it happends, then the source would mainly be there.

Some cleanups you could do:
Remove all Do Nothing. These is indeed doing nothing. Having nothing under Else instead of Do Nothing is making the script faster.

Unit - Create 1 Flag for (Owner of (Triggering unit)) at (Random point in Flag <gen>) facing Default building facing degrees

This leaks: Do like you did with the other handles. Create a point where you store the random point, and then destroy it after its used.

(Number of units in (Units of type Flag)) Not equal to 0
Leaks: this is a unit group, but its never destroyed. So everytime the trigger is ran it keeps creating duplicated unit groups of the same condition. Use an if action in the beginning of the trigger instead where, if its true, do actions, else (dont do anything here)

Special Effect - Create a special effect at (Center of Runners Start <gen>) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
Destroy (last created special effect right after its created, in this case)
Also this leaks a point.

Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Random player from (All allies of Player 1 (Red))) matching ((Unit-type of (Matching unit)) Not equal to Flag))))
Leaks a position here too. I dont know about the player force, but start with the other one

Srry for not using trigger tags. I had no time
 
Level 4
Joined
Jul 24, 2008
Messages
108
thahnks a lot dude, i never knew the do nothing event actually was bad, or slowed things down. I am trying to learn jass right now, do you think if i did these triggers in jass it would remove all leaks potentially and stop server desyncs?
 
Level 4
Joined
Jul 24, 2008
Messages
108
Desyncs can depend on different things, mainly because of a leak/leaks somewhere.
If you have a fixed time of when it happends, then the source would mainly be there.

Some cleanups you could do:
Remove all Do Nothing. These is indeed doing nothing. Having nothing under Else instead of Do Nothing is making the script faster.

Unit - Create 1 Flag for (Owner of (Triggering unit)) at (Random point in Flag <gen>) facing Default building facing degrees

This leaks: Do like you did with the other handles. Create a point where you store the random point, and then destroy it after its used.

(Number of units in (Units of type Flag)) Not equal to 0
Leaks: this is a unit group, but its never destroyed. So everytime the trigger is ran it keeps creating duplicated unit groups of the same condition. Use an if action in the beginning of the trigger instead where, if its true, do actions, else (dont do anything here)

Special Effect - Create a special effect at (Center of Runners Start <gen>) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
Destroy (last created special effect right after its created, in this case)
Also this leaks a point.

Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Random player from (All allies of Player 1 (Red))) matching ((Unit-type of (Matching unit)) Not equal to Flag))))
Leaks a position here too. I dont know about the player force, but start with the other one

Srry for not using trigger tags. I had no time

Ok, i did everything you suggested, have no massive splits where half the people leave, however, the game i did test it with (10 players) 3 people got disconnected at random times during the game, first 2 left within 5 minutes, and last one like last 20 minutes. There is no repeating triggers except for 3 of the "orders" trigger from above with different units. Could something like this leak


  • five minutes
    • Events
      • Dialog - A dialog button is clicked for DiffDialog
    • Conditions
    • Actions
      • Wait (16.00 + 300.00) seconds
      • If (diff Equal to 6) then do (Unit - Create 1 |c000033ffCrazy Kodo for Player 1 (Red) at (Center of Jail <gen>) facing Default building facing (270.0) degrees) else do (Do nothing)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • diff Equal to 6
              • diff Equal to 5
              • diff Equal to 4
        • Then - Actions
          • Unit - Create 3 |c000033ffCrazy Kodo for Player 11 (Dark Green) at (Center of Jail <gen>) facing Default building facing (270.0) degrees
        • Else - Actions
          • Unit - Create 2 |c000033ffCrazy Kodo for Player 11 (Dark Green) at (Center of Jail <gen>) facing Default building facing (270.0) degrees
      • Set isSoundPlaying = True
      • Sound - Play five <gen>
      • Game - Display to (All players) the text: A kodo has entered ...
      • Wait 10.00 seconds
      • Set isSoundPlaying = False
What i want to point out is the trigger is started 5 seconds into the game and just waits for 5 minutes, there are another bunch like this with times from 5-30 minutes, could these wiats cause problems. I wouldnt think the creating units would cause a problem because the trigger does it once, and doesn't repeat.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I wouldnt think the creating units would cause a problem because the trigger does it once, and doesn't repeat.

Even so, you should strive to leak as less as possible.
Can't see any reason it should sync, though.

I think its the pan camera. I remember hearing that one of those actions was known to cause desyncs.

Pan camera is used in about 90% of the maps ever made and I never saw it cause any syncs.
 
Level 4
Joined
Jul 24, 2008
Messages
108
Can't see any reason it should sync, though.

Could it just be that i got unlucky and got people with shitty computers/dialup who usually disconnect anyways?

I think its the pan camera. I remember hearing that one of those actions was known to cause desyncs.

If its pan camera, how could i clean it up because i still need to use it. Plus in all other variabtions of this map, they all pan also, along with bunch of other maps that pan camera
 
Level 4
Joined
Jul 24, 2008
Messages
108
Sweet....i made all the suggestions everyone made, no splits until the last 10 minutes, then we were doing pretty good so we kept going on, 5 minutes later my computer started lagging, then froze, unable to do anything. Computer restarted, now my bios doesn't see my harddrives and book disk errors and im unable to restart my computer and turn it back on. So, all those above triggers are the only triggers that occur more than once, so if those are all fixed (and im sure they are now, unable to post fixed ones as my other computer is done for). I know the object editor can cause leaks, but all my dice are set to 1 and 1. Would posting my map here help at all in finding the leaks?
 
Status
Not open for further replies.
Top