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

Attack move Number of units limit?

Status
Not open for further replies.
Level 9
Joined
Sep 28, 2004
Messages
365
Hi all and Happy new year!

I was trying to make a map something like defense game, i want enemy units to zerg the players..

Every 8 seconds i create 5-6 units at 3 points, imagine its like 3 barracks spawning like in AoS games. And i order them to attack move to player base. Somehow they get stuck and don't know what to do when nearing the player base. My regions are fine, they are big enough.

When the units get attacked..
Some of them ignore as if they are not attacked.. or react really slowly.. and move 1 step and stop for 2 seconds. Its not my computer lagging (i know if its lagging).

So i would like to know what is the limit that the AI of warcraft 3 can handle? when they reach player base theres like 180-200 units in the map.

Thanks for your time! +Rep to those who can help me with this.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =) [Happy New Year]

1) As I remember it has something to do with the Collision Size. You should set it to 0.

2) In addition you can create a trigger that force this created unit to attack/walk to your point. This trigger runs every 2 seconds or whatever.

3) I don't know where's the limit is =O but I saw maps, that spawns hundreds of creeps and don't have this problem, so don't worry about your couple of creeps =D
 
Level 14
Joined
Aug 31, 2009
Messages
775
A periodic trigger would cause intense amounts of Order lag - where units stand still for about 2 seconds, take a step forward then stand again.

Also remember to use
  • AI - Ignore the guard positions of all of (<Computer Player>)'s units
As this will stop the AI being able to send units back to their spawn location after being ordered to move.

Also, there IS a limit on how many units you can order to Attack-Move.

If you use "Unit Group - Issue Order targeting a point" then the limit is 12 units maximum.
If you use "Unit Group - Pick Every unit and do (actions)" followed by "Order (Picked Unit) to Attack Move to (Point)" then there is no limit.
 
Level 9
Joined
Sep 28, 2004
Messages
365
@Damage..

1. Do i need to use the AI on every spawn or just 1 time on melee initialization?

2. You mean if i add units spawned to unit group, nomatter how many they are, they won't get jerky when they exceed 180 units ++? because i notice my units start to move and stop after 180 units on map (AI - attack move)
 
Level 5
Joined
Apr 20, 2008
Messages
150
One solution I found (due to my map being tiny and I experienced this bug as well) is to increase the map size beyond the play edges. This problem only seems to happen on larger maps, and only to players that have too many units on said map.
 
Level 14
Joined
Aug 31, 2009
Messages
775
@Damage..

1. Do i need to use the AI on every spawn or just 1 time on melee initialization?

2. You mean if i add units spawned to unit group, nomatter how many they are, they won't get jerky when they exceed 180 units ++? because i notice my units start to move and stop after 180 units on map (AI - attack move)

1. No, use the
  • AI - Ignore the guard positions of all of (Player)'s units
And it will ignore ALL units owned by that player all at once just like it says. There is a version which is specific to an individual unit, but you don't want that.

2. ... 180 units is very very likely to cause massive Ordering lag.
Pick every unit in unit group, then order each picked unit to attack move. There'll be a massive lag at the beginning, but as long as the guard positions are removed, they will move to the target area, and should not be jerky on their movement either.

@Dragon_kid
Extending map bounds does absolutely nothing to unit behaviours.
 
Level 9
Joined
Sep 28, 2004
Messages
365
Damn, i guess i will just reduce the number of units or limit it when it hits the cap.

AI - Ignore the guard positions of all of (player)'s units << Do i use this once on melee initialization or i need to put this trigger in periodic event after units are created?
 
Level 9
Joined
Jul 20, 2009
Messages
427
I had a similar problem on map regarding this command bug thing..And for it I did some tests..Results yield that the command bug bites it at an average between 150-180+ units..Since its a fact that wC3 engine is limited when it comes to handling mass of units,its best and the only soultion is to limit the number of units to about 150 or below..
 
Level 9
Joined
Sep 28, 2004
Messages
365
@Damage

Thanks for clarification +rep.

@pangahas

I stress tested it too with my friend.. once unit count on map exceed 180 for me, it starts to get jerky when ordering. Its like taking turns in queue to move >.>

Well i guess i will just have to lower amount of units spawn and make each unit alilbit stronger.

Thanks for all the help! +rep too!
 
Level 9
Joined
Jul 20, 2009
Messages
427
Maybe you could add a trigger that stops the spawning once you reached the 180 mark or 150 just to be safe.Then turns it on again whenever it gets lower than that..
 
Level 9
Joined
Sep 28, 2004
Messages
365
Update:

After a detail specific check on units limit using orders by AI like attack move/move etc.

Each Player can have up to 150 units ordered to attack move at once. Anything above 150 will start to get jerky.

Eg:
Player 1 has 50 units that are ordered to attack move.
Player 2 has 160.

Player 1 units won't be jerky, but Player 2 will.

I tested this about 20times with debug codes that shows my unit counts and performance.
 
Level 14
Joined
Aug 31, 2009
Messages
775
Evidently an Engine limitation then.

A solution to keeping the large numbers though could be to just spawn them relatively close to the area they need to enter, and create new spawns as the old ones die until you reach how many units you wanted total for that "wave" or whatever.

Eg. in my map, the unit numbers are limited to 30 at any one time, but some waves have 100+ enemies, but they won't spawn until the current amount has reduced below 30.
 
Level 9
Joined
Sep 28, 2004
Messages
365
Yap, its per player basis atleast that is what i discover. I didn't really study the AI, so i can only confirm this with my test experience. I guess the AI guys should know this better.

I capped my units at 150 now, and it looks perfectly fine for the 3 computers when spawning even when the 3 computer players have 140 units each, they won't get jerky. Now it make sense that why warcraft 3 has a unit cap o:.
 
Level 3
Joined
May 3, 2008
Messages
44
If I understand what you're saying, you're having trouble with unit lag with units attack-moving to a certain point correct? I had a similar problem in a map i'm making atm, I used this to fix it

Variables
Your_Timer - Timer variable
tempPoint - point variable
tempGroup - unit group variable
You can name those whatever you want obviously


First Trigger - Start a spawn timer
  • Start Timer
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Your_Timer as a Repeating timer that will expire in 10.00 seconds
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
Trigger Two - Spawn Stuff
For the next trigger, just repeat the actions for every spawn you have.

  • Spawn Creeps
    • Events
      • Time - Your_Timer expires
    • Conditions
    • Actions
      • Set tempPoint = (Center of (creep spawn))
      • Unit - Create 12 Footman for Player 12 (Brown) at tempPoint facing Default building facing degrees
      • Set tempGroup = (Units in creep spawn <gen> owned by Player 12 (Brown))
      • Custom script: call RemoveLocation(udg_tempPoint) <--- not sure if thats needed yet, but ohh well
      • Set tempPoint = (Center of (where the creeps are attacking))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To tempPoint
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Custom script: call DestroyGroup(udg_tempGroup)


The reason I used 12 units in the spawn is because that's as many that will be ordered in a single unit group execution, when you start giving a massive unit group orders it bogs the system down and creates the stop and go walking you mentioned. I've got a system similar to this in my map, and I've got 120+ units attacking random points in a town at once. I think someone mentioned it already, but over 150 units moving at once will probably lag your map no matter what.

Also, it's important to use the custom scripts "Removelocation" and "DestroyGroup" because the leaks will make the spawn trigger lag your map over time.

Good luck, let me know how it works out for you
 
Last edited:
Status
Not open for further replies.
Top