Delay while hosting, not while testing

elpini0

New Member
Reaction score
1
Hi, i'm working on a new map and to improve little details i'm playing through battle.net with a friend of mine.

The problem is that while hosting the game on warcraft 3 RoC (after changing it with WinMPQ) i found a little delay from other players and myself just from the starting of the map... Like 0.6 seconds.

NOT GRAPHICS LAG, no stops, just actions delay... Like when you give order "move" and the animation of the green arrows play instantly but the guy doesn't move at all.

But when i test the map in TFT with World Editor it has no delay at all.

Any idea of what can it be?

I have a trigger that every 2 seconds of game picks ALL enemy units (normally around 100-150 units divided among 4 CPU players) and divide them in 20 different groups...

Then, another trigger runs every 0.10 secs and goes one by one for each division of the total units and makes the following:
*For each integer A from 1 to (number of units in UnitGroup[X]) do actions:
-Set Temp_unit= Random unit in UnitGroup[X]
-Pick up every unit within 99999.0 of Temp_unit] and do actions:

-Set MinDistance=99999
-Set ActualDistance=distance between (picked unit) and Temp_unit
-If ActualDistance < MinDistance then:
-Set MinDistance=ActualDistance
-Set AttackedUnit=(picked unit)

-Order Temp_unit to (attack) AttackedUnit

[The trigger is more complex than this, but this is more or less the essence of it...]

Resuming: Every 2 seconds CPU units attack the closest enemy in 99999.0 range

And this is the only periodic trigger with high frequency i have.

-Could this be the cause of the delay?? What could it be instead?

-Why does the game not have delay in World Editor Testing but it DOES have delay while hosting on B.net?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
im pretty sure thats whats doing it
thats picking every single unit, checking them for certain qualifications, and then doing actions based on those qualifications 10 times a secondit may not be, but i would BET, that that is what is causing the delay

the editor means it uses only your computer and does not send info over the internet, playing on bnet, all of those computers are trying to do the same thing 10 times a second and sync together and compare information... i would feel comfortable betting money on that, plus u leak an every unit in the map group 10 times a second, that takes up a shitload of ram
 

elpini0

New Member
Reaction score
1
thanks for replying!! (+ rep for you, your other posts have been quite useful :D )

But no, i'm not leaking xD i have checked for any leaks in my map using the object manager.

But if you read carefully, i said that just from the begining of the map, it has delay, and the delay is the same for the whole game.

That means that when the periodic trigger which runs every 0.10 secs is TURNED OFF (cause it takes 20 secs for the first units to spawn) the game still has delay


More ideas?
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
thanks for replying!! (+ rep for you, your other posts have been quite useful :D )

But no, i'm not leaking xD i have checked for any leaks in my map using the object manager.

But if you read carefully, i said that just from the begining of the map, it has delay, and the delay is the same for the whole game.

That means that when the periodic trigger which runs every 0.10 secs is TURNED OFF (cause it takes 20 secs for the first units to spawn) the game still has delay


More ideas?

Normal network delay? Are you on wireless internet? Typically there is some delay when playing any game online. Warcraft 3 probably isn't optimized to have a very small delay, as the melee game style doesn't really need it as much as a game such as an FPS. Is it just this map? Is it visible for the host as well?
 

elpini0

New Member
Reaction score
1
Normal network delay? Are you on wireless internet? Typically there is some delay when playing any game online. Warcraft 3 probably isn't optimized to have a very small delay, as the melee game style doesn't really need it as much as a game such as an FPS. Is it just this map? Is it visible for the host as well?

(+rep for replying, thank you :D )

I play with wireless but my conexion is quite fast (50 MB/s downstream, 5Mb/s upstream, 4-7 ms ping in TS3 servers)

I know there is some delay, but i think this map has more delay than the rest of my maps...

I don't get the question "Is it visible for the host as well?"
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
is it everyone that gets the lag or everyone except the host
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
and you are leaking a unit group, the leak checker missed it, if you actions are what you said they were...
ex:
this is what you have:
Trigger:
  • Actions
    • Set Temp_unit= Random unit in UnitGroup[X]
    • Pick up every unit within 99999.0 of Temp_unit] and do actions:
      • Loop - Actions
        • Set MinDistance=99999
        • Set ActualDistance=distance between (picked unit) and Temp_unit
        • If ActualDistance &lt; MinDistance then:
        • Set MinDistance=ActualDistance
        • Set AttackedUnit=(picked unit)


This is what i would do:
Trigger:
  • Actions
    • Set Temp_Point = Position of (Random unit from UnitGroupVar[X])
    • Set Temp_Group = units in 99999.0 range of Temp_Point
    • Set MinDistance=99999
    • Pick up every unit in Temp_Group and do actions:
      • Loop - Actions
        • Set ActualDistance=distance between (picked unit) and Temp_unit
        • If ActualDistance &lt; MinDistance then:
        • Set MinDistance=ActualDistance
        • Set AttackedUnit=(picked unit)
    • Custom Script: call DestroyGroup(udg_Temp_Group)
    • Custom Script: call RemoveLocation(udg_Temp_Point)


PS. [noparse]
Trigger:
  • paste your triggers here for ^ that effect
[/noparse]
 

elpini0

New Member
Reaction score
1
MAIN TRIGGER

Trigger:
  • Main
    • Events
      • Time - Every 2.02 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in Covenant and do (Actions)
        • Loop - Actions
          • Set AttacksGroup = (Units owned by (Picked player) matching ((((Matching unit) is alive) Igual a (==) True) and (((Matching unit) is in Independents) Igual a (==) False)))
          • Unit Group - Add all units of AttacksGroup to CountUnitTotal
      • Set TempNum = 1
        • If Multiple Actions For each (Integer A) from 1 to (Number of units in CountUnitTotal), do (Actions)
          • Loop - Actions
            • Set TempUnit = (Random unit from CountUnitTotal)
            • Unit Group - Add TempUnit to AttackFraction[TempNum]
            • Unit Group - Remove TempUnit from CountUnitTotal
            • Set TempNum = (TempNum + 1)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • Conditions
                • If TempNum Igual a (==) 21
              • Then - Actions
                • Set TempNum = 1
              • Else - Actions
      • Set AttackCounter = 1



Periodic Trigger:

Trigger:
  • Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • If AttackCounter Smaller or Equal to (&lt;=) 20
    • Actions
      • For each (Integer A) from 1 to (Number of units in AttackFraction[AttackCounter]), do (Actions)
        • Loop - Actions
          • Set TempUnit = (Random unit from AttackFraction[AttackCounter])
          • Unit Group - Remove TempUnit from AttackFraction[AttackCounter]
          • Set TempHandleID = (GetHandleIdBJ(udg_TempUnit))
          • If Multiple Functions If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Conditions
              • If (Load 0 of TempHandleID from CreepAttackTime) Greater than (&gt;) 0
            • Then - Actions
              • HashTable - Save ((Load 0 of TempHandleID from CreepAttackTime) - 2) as 0 of TempHandleID in CreepAttackTime
            • Else - Actions
              • Trigger - Run Nearest Enemy Unit &lt;gen&gt; (checking conditions)
              • Unit - Order TempUnit to Attack TempUnit2
              • Hashtable - Save ((Random integer number between 1 and 5) x 2) as 0 of TempHandleID in CreepAttackTime
      • Set AttackCounter = (AttackCounter + 1)


Check For Nearest Unit

Trigger:
  • Nearest
    • Events
    • Conditions
    • Actions
      • Set TempReal = 99999.00
      • Set PickGroup = (Units within 99999.00 of (Position of TempUnit) matching (((Owner of (Matching unit)) is in Playersgroup) Equal to (==) True))
      • Unit Group - Pick every unit in PickGroup and do (Actions)
        • Loop - Actions
          • If Multiple Functions If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Conditions
              • If ((Picked unit) has buff Invisibilidad) Equal to (==) False
              • If ((Picked unit) has buff Invulnerable) Equal to (==) False
              • If (Distance between (Position of TempUnit) and (Position of (Picked unit))) Smaller than (&lt;) TempReal
              • If ((Distance between (Position of TempUnit) and (Position of (Picked unit))) x (Percentage life of (Picked unit))) Smaller than (&lt;) TempReal
            • Then - Actions
              • Set TempReal = (Distance between (Position of TempUnit) and (Position of (Picked unit)))
              • Set TempReal = (TempReal x (Percentage life of (Picked unit)))
              • Set TempUnit2 = (Picked unit)
            • Else - Actions
      • Custom script: call DestroyGroup (udg_PickGroup)



So, the first trigger separates units in 20 different groups every 2.00 s

The second one goes group by group every 0.10 and checks the remaining time left for each unit in that group to refresh their target. If this time is equal to 0, it calls the third event.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
It might not be the leaks that are causing the lag.
I have a trigger that every 2 seconds of game picks ALL enemy units (normally around 100-150 units divided among 4 CPU players) and divide them in 20 different groups...
Most likely WC3 can't handle the number of units and their orders, since you're running a trigger to issue an attack order over 100 times every tenth of a second. Try making any map with 100 units, and issue orders for all of them. Chances are the same thing will happen.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
make an empty map and try it online with your friend, if still lags it's your connection

that wouldnt necissarily be a good indicator, as it would be sending much less data over the internet resulting in less lag even if they have a bad connection

i think the issue is what ^ he said, that sounds like the kind of issue that might result in a ton of lag
 

elpini0

New Member
Reaction score
1
It might not be the leaks that are causing the lag.

Most likely WC3 can't handle the number of units and their orders, since you're running a trigger to issue an attack order over 100 times every tenth of a second. Try making any map with 100 units, and issue orders for all of them. Chances are the same thing will happen.

(+ rep for answering, thank you :) )

I'm not... actually it's over 100 times every 2 seconds, dividing the units in 20 groups of equal number of units.

And i still wonder, WHY does lag appear since the very begining of the game, when the number of units in the map is 0 ???

These days i wasn't able to play wc3, but today i'll try hosting other games. Maybe it's my connection, but i doubt it...

Anyways, when i finish the BETA map, ill post it here and you can check it out and tell me if the triggers can give any problems or not. Thank you all :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top