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
613
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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top