• 🏆 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!

Wave Spawns keep stopping from moving

Status
Not open for further replies.
Level 5
Joined
Jun 16, 2009
Messages
49
Hello guys, I need some help if it weren't so much trouble. I have a castle defense map where there are wave spawns. But by the end of the game, with so much units in the map, the unit waves begins to walk very slow, like they start moving but they take a few steps and stop again, they were supposed to keep Attack-moving/patroling to they targeted point I used via trigger.
They don't actually "stop" they just take too long to get to the targeted area, and that throttles the whole path they travel, making the map unplayable if those spawns aren't killed before they throttle everything.
  • Spawns
    • Events
      • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • Set Attack[4] = (Random point in Attack 3 <gen>)
      • Set Chaos_Demons[1] = (Units in Region 204 <gen> matching ((((Matching unit) is Undead) Equal to True) and ((Owner of (Matching unit)) Equal to Player 10 (Light Blue))))
      • Set Pos[2] = (Center of Spawn 1 <gen>)
      • Set Pos[3] = (Center of Spawn 2 <gen>)
      • Set Pos[4] = (Center of Spawn 3 <gen>)
      • Set Pos[5] = (Center of Spawn 4 <gen>)
      • Set Pos[6] = (Center of Spawn 5 <gen>)
      • Unit - Create 2 Spawn[SpawnInt] for Player 10 (Light Blue) at Pos[2] facing Default building facing degrees
      • Unit - Create 1 Spawn[SpawnInt] for Player 10 (Light Blue) at Pos[3] facing Default building facing degrees
      • Unit - Create 1 Spawn[SpawnInt] for Player 10 (Light Blue) at Pos[5] facing Default building facing degrees
      • Unit - Create 1 Spawn[SpawnInt] for Player 10 (Light Blue) at Pos[6] facing Default building facing degrees
      • Unit - Create 2 Spawn[SpawnInt] for Player 10 (Light Blue) at Pos[4] facing Default building facing degrees
      • Unit Group - Pick every unit in Chaos_Demons[1] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Patrol To Attack[4]
      • Custom script: call RemoveLocation( udg_Pos[2] )
      • Custom script: call RemoveLocation( udg_Pos[3] )
      • Custom script: call RemoveLocation( udg_Pos[4] )
      • Custom script: call RemoveLocation( udg_Pos[5] )
      • Custom script: call RemoveLocation( udg_Pos[6] )
      • Custom script: call RemoveLocation( udg_Attack[4] )
      • Custom script: call DestroyGroup(udg_Chaos_Demons[1])

Any help is much appreciated.
 
Level 12
Joined
Jan 30, 2020
Messages
875
I don't know why you added a loop.

Should be like this :
  • Unit Group - Pick every unit in Chaos_Demons[1] and do (Unit - Order (Picked unit) to Patrol To Attack[4]
 
Level 12
Joined
Jan 30, 2020
Messages
875
By the way why do you create the unit group before creating units?

Not that of a big deal because they will be grouped 4 seconds later, but still strange way of proceeding.

Anyways if the throttling is due to too many units being ordered at the same time, it would probably be a better idea to order units as soon as they are created rather then picking them and ordering them.

I made some modifications to your triggers :

First use this at map init. You are using global variables to store your locations, it is a bad idea to recreate them and destroy them every 4 seconds of the game, so just create them at map init :

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • AI - Ignore the guard positions of all Player 10 (Light Blue) units
      • Set VariableSet Number = 2
      • Set VariableSet Pos[2] = (Center of Spawn 1 <gen>)
      • Set VariableSet Pos[3] = (Center of Spawn 2 <gen>)
      • Set VariableSet Pos[4] = (Center of Spawn 3 <gen>)
      • Set VariableSet Pos[5] = (Center of Spawn 4 <gen>)
      • Set VariableSet Pos[6] = (Center of Spawn 5 <gen>)
Note that I also set the initial value to the counter Number to 2

Now use this for your Spawn trigger :
  • Spawns
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number Equal to 2) or (Number Equal to 4)
        • Then - Actions
          • Unit - Create 1 No unit-type for Player 10 (Light Blue) at Pos[Number] facing Default building facing degrees
          • Unit - Order (Last created unit) to Patrol To Attack[4]
        • Else - Actions
          • Do Nothing
      • Unit - Create 1 No unit-type for Player 10 (Light Blue) at Pos[Number] facing Default building facing degrees
      • Unit - Order (Last created unit) to Patrol To Attack[4]
      • Set VariableSet Number = (Number + 1)
      • If (Number Greater than 6) then do (Set VariableSet Number = 2) else do (Do nothing)

Note I create an extra unit for values 2 and 4 because you create 2 in your trigger.
So it will create the same amount as yours...


I think this would work much better.

If you remove guard positions for player 10 like I did at map init in this example, you won't need to pick all the attackers constantly.

Please test this and tell me if it woks
 
Level 5
Joined
Jun 16, 2009
Messages
49
I don't know how a simple rearrangement can change that much, but I guess it works a lot better, thanks. :grin:
But the units stopped casting active spells like they used to.

  • AI - Ignore the guard positions of all Player 10 (Light Blue) units
Could this have changed anything?
 
Level 12
Joined
Jan 30, 2020
Messages
875
Thats a good question. I don't think ignoring guard positions would prevent casting of active skills.
This usually just prevents the computer controlled units to cancel their current order when they get beyond a certain range to go back to their guarding position.

Now I am far from being omniscient, and maybe something underlying is happening.

But my best guess is that something else has changed. Would you mind sharing your map to try to figure this out ?
 
Level 2
Joined
Feb 16, 2020
Messages
9
There is a hard coded limit on the amount of orders one player can give. Once it's reached orders will be queued and they'll start to 'stutter'. If you split the units between multiple players the movement will be smooth. This is a common problem in any map with high unit count and theres no known solution except for splitting the units between extra players.

Here is two videos from my map which shows the difference

1 Player: Warcraft III 19_04_2019 18_38_57 - Streamable

3 Players: Warcraft III 19_04_2019 18_53_14 - Streamable
 
Level 5
Joined
Jun 16, 2009
Messages
49
There is a hard coded limit on the amount of orders one player can give. Once it's reached orders will be queued and they'll start to 'stutter'. If you split the units between multiple players the movement will be smooth. This is a common problem in any map with high unit count and theres no known solution except for splitting the units between extra players.

Well thank you, that certainly is enlightning.

But my best guess is that something else has changed. Would you mind sharing your map to try to figure this out ?

The map is almost finished, I didn't want to bother, I think Quetra's idea will sort it out.
 
Status
Not open for further replies.
Top