• 🏆 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] Huge delay problems

Status
Not open for further replies.
Level 7
Joined
Apr 27, 2008
Messages
94
I have been experiencing a huge amount of delay in my game (which is a hlw/hw hybrid). I believe that it is due to summoning, but I am not that sure. Here are my summoning triggers if anyone can point out a leak (do they cause delay), or any other problem.

If you can play the game (4v4 or more to experience delay) to see for yourself and maybe even find a source, I would be grateful (put the delay in context, and what the triggers are doing).
Hero Line Armageddon 1.2.2 - The Hive Workshop - A Warcraft III Modding Site

Here are the triggers
  • Summoning
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Red]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Red]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Blue]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Blue]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Lane[(Player number of (Owner of (Triggering unit)))] Not equal to 0
        • Then - Actions
          • Set Integer_Income[(Player number of (Owner of (Sold unit)))] = (Integer_Income[(Player number of (Owner of (Triggering unit)))] + (Point-value of (Sold unit)))
          • Set Integer = (Random integer number between 1 and 7)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Triggering unit)) is in PlayerGroup_TeamOne) Equal to True
                • Then - Actions
                  • Set UnitType = UnitType_RedAlt[(Level of (Sold unit))]
                • Else - Actions
                  • Set UnitType = UnitType_BlueAlt[(Level of (Sold unit))]
            • Else - Actions
              • Set UnitType = (Unit-type of (Sold unit))
          • Unit - Remove (Sold unit) from the game
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is in PlayerGroup_TeamOne) Equal to True
            • Then - Actions
              • Set Point = (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
              • Unit - Create 1 UnitType for Neutral Victim at Point facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Point)
              • Set Point = (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Unit - Order (Last created unit) to Attack-Move To Point
              • Custom script: call RemoveLocation(udg_Point)
              • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
              • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
              • Player - Add 1 to (Owner of (Triggering unit)) Food used
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_TeamOneMass[Integer_Lane[(Player number of (Owner of (Triggering unit)))]] Greater than 0
                • Then - Actions
                  • Set Integer = (Random integer number between 1 and 2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer Equal to 1
                      • ((Owner of (Triggering unit)) Food used) Less than or equal to 48
                    • Then - Actions
                      • Set Point = (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
                      • Unit - Create 1 UnitType for Neutral Victim at Point facing Default building facing degrees
                      • Custom script: call RemoveLocation(udg_Point)
                      • Set Point = (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
                      • Unit - Order (Last created unit) to Attack-Move To Point
                      • Custom script: call RemoveLocation(udg_Point)
                      • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
                      • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
                      • Player - Add 1 to (Owner of (Triggering unit)) Food used
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Set Point = (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
              • Unit - Create 1 UnitType for Neutral Extra at Point facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Point)
              • Set Point = (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Unit - Order (Last created unit) to Attack-Move To Point
              • Custom script: call RemoveLocation(udg_Point)
              • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
              • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
              • Player - Add 1 to (Owner of (Triggering unit)) Food used
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_TeamTwoMass[Integer_Lane[(Player number of (Owner of (Triggering unit)))]] Greater than 0
                • Then - Actions
                  • Set Integer = (Random integer number between 1 and 2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer Equal to 1
                      • ((Owner of (Triggering unit)) Food used) Less than or equal to 48
                    • Then - Actions
                      • Set Point = (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
                      • Unit - Create 1 UnitType for Neutral Extra at Point facing Default building facing degrees
                      • Custom script: call RemoveLocation(udg_Point)
                      • Set Point = (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
                      • Unit - Order (Last created unit) to Attack-Move To Point
                      • Custom script: call RemoveLocation(udg_Point)
                      • Unit - Change color of (Last created unit) to (Color of (Owner of (Triggering unit)))
                      • Unit - Set the custom value of (Last created unit) to (Player number of (Owner of (Triggering unit)))
                      • Player - Add 1 to (Owner of (Triggering unit)) Food used
                    • Else - Actions
                      • Do nothing
                • Else - Actions
                  • Do nothing
        • Else - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Please en...
          • Unit - Remove (Sold unit) from the game
          • Player - Add ((Point-value of (Sold unit)) x 5) to (Owner of (Triggering unit)) Current gold
          • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Region 010 <gen>) over 0.00 seconds
  • Advanced Summoning
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • Integer_Rounds Less than or equal to 15
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Red]
          • (Unit-type of (Triggering unit)) Equal to Summoning Shrine [Blue]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_Noob[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions
          • Set Integer_Noob[(Player number of (Owner of (Triggering unit)))] = 1
          • Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
            • Loop - Actions
              • Camera - Pan camera for (Owner of (Picked unit)) to (Center of Region_Summon[(Player number of (Owner of (Triggering unit)))]) over 0.00 seconds
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Good job,...
              • Cinematic - Ping minimap for (Player group((Owner of (Triggering unit)))) at (Center of Region_Send[(Player number of (Owner of (Triggering unit)))]) for 5.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
          • Wait 1.00 game-time seconds
          • Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
            • Loop - Actions
              • Unit - Order (Picked unit) to Attack-Move To (Center of Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Push your...
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Region_Send[(Player number of (Owner of (Triggering unit)))]) over 3.00 seconds
          • Wait 5.00 game-time seconds
          • Unit Group - Pick every unit in (Random 1 units from (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
            • Loop - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cff00ff00Good luck
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Picked unit)) over 0.00 seconds
              • Selection - Select (Picked unit) for (Owner of (Triggering unit))
        • Else - Actions
          • Do nothing
      • Set Integer = (Random integer number between 1 and Integer_Rounds)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 1
          • Integer_Lane[(Player number of (Owner of (Triggering unit)))] Not equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is in PlayerGroup_TeamOne) Equal to True
            • Then - Actions
              • Set UnitType = UnitType_BlueNorm[(Level of (Sold unit))]
              • Set Integer = (Random integer number between 1 and 7)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Equal to 1
                • Then - Actions
                  • Set UnitType = UnitType_BlueAlt[(Level of (Sold unit))]
                • Else - Actions
                  • Do nothing
              • Set Point = (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Unit - Create 1 UnitType for Neutral Extra at Point facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Point)
              • Set Point = (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
              • Unit - Order (Last created unit) to Attack-Move To Point
              • Custom script: call RemoveLocation(udg_Point)
              • Unit - Change color of (Last created unit) to Black
            • Else - Actions
              • Set UnitType = UnitType_RedNorm[(Level of (Sold unit))]
              • Set Integer = (Random integer number between 1 and 7)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Equal to 1
                • Then - Actions
                  • Set UnitType = UnitType_RedAlt[(Level of (Sold unit))]
                • Else - Actions
                  • Do nothing
              • Set Point = (Random point in Region_Send[(Player number of (Owner of (Triggering unit)))])
              • Unit - Create 1 UnitType for Neutral Victim at Point facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_Point)
              • Set Point = (Random point in Region_Summon[(Player number of (Owner of (Triggering unit)))])
              • Unit - Order (Last created unit) to Attack-Move To Point
              • Custom script: call RemoveLocation(udg_Point)
              • Unit - Change color of (Last created unit) to Black
        • Else - Actions
          • Do nothing
 
Level 7
Joined
Oct 14, 2008
Messages
340
I believe he means delay as in, you issue an order for you unit to do something, and the order isn't accepted until x seconds afterward.
 
Level 7
Joined
Apr 27, 2008
Messages
94
Yeah, that kind of delay, it takes a certain number of seconds to recognize a command, whether it be move or summon a unit.

As for whats happening... They're summoning triggers.
The summoning triggers do three main things, first they cause your bought unit to summon in your summoning region, second they cause a scaling smaller portion of your summons to summon as enemy units in the enemy summon, and lastly they tell noobs what to do once they summon for their first time.

Due to the huge amount of custom units, switching units types, 3 lanes, and 3 functions, that it why the triggers are so big.
 
Level 7
Joined
Apr 27, 2008
Messages
94
Those Do Nothings aren't there just for kicks, isn't there a leak if you don't put them there? I know in other programming languages if you don't have something like that there at the end of loops or something that there's a leak.

Anyway, I don't believe that massive armies is the problem. I have two neutral players that control the two team's units. Hero line war lition/custom/roc/any other hlw has many units, yet I do not get the same type of lag (i get the frame-skip lag). Comparatively, my map has very few units for the players out at the same time, yet it still gets delay (not regular lag).
 
Level 6
Joined
Sep 5, 2007
Messages
264
My opinion here is that you should start learning JASS. You seem like a person who is reasonably experienced with GUI. I'd get yourself into it.

JASS is a relatively easy language to learn, especially it you've got the hang of GUI, and if you've got tools like JassCraft. Everything you put into GUI is converted to JASS when the map saves, it's just REALLY ugly JASS. Try going to "edit/convert to custom text" in the trigger-editor menus, when you've got one of those triggers open. I bet that the resulting code will be half a mile long. You can optimise it FAR better, probably stopping your lag problem while your at it. :thumbs_up:
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Those Do Nothings aren't there just for kicks, isn't there a leak if you don't put them there? I know in other programming languages if you don't have something like that there at the end of loops or something that there's a leak.
Nope, just leave them out.

Anyway, I don't believe that massive armies is the problem.
Frankly, it is. Ways to speed this up is to avoid armies above 100 units, remove dead units instantly (or reduce their decay time if you need skeletons), don't use aura's or large area of effect spells. Still, don't go over 100 units per player.
 
Status
Not open for further replies.
Top