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

Mass unit lag with immobile units?

Status
Not open for further replies.
Level 10
Joined
Jun 7, 2008
Messages
420
Hi, you know that dreaded bug all of us large mappers hate? When 500 vs 500 battles occur, units stop-go-stop-go?
I was wondering, if there were 200 IMMOBILE units with 0 speed and not given any orders (they are faction destructables, making a urban battleground where you pwn each other's buildings) and about 100 units from each side bashing each other, will it happen?
 
Level 13
Joined
Mar 24, 2010
Messages
950
If its a ward or building with little/no animation and no movement it wont affect it. wc3 engine is limited to about 50 units per player moving without problems after that it starts to get worse and worse the more you add. 100 should be fine as long as your not mass moving them all at once.. If you removed collision it no longer really affects it as bad either. But no those 200 non-moving units that cant take order should hurt the move lag much at all.
 
Level 10
Joined
Jun 7, 2008
Messages
420
Erm those units are 'buldings'. But I had to uncheck building so that I can rotate them however I please. They have no attack movement shadow or animation, and a collision size of 1 (I use pathing blockers). This method works only for pre-placed buildings, which is fine for this particular map, you dont build or destroy any immobile objects in it, it just changes owner and catches fire.
 
In order to stop this problem from occuring, you need to distribute the units' owner into several players, e.g. 100 units per player. If you want totally passive units, you can create an ability based on "Spell book" ability, set Maximum and Minimum spells to 1, and add "Root" in the spells' list. Add this custom "Spell book" ability in the units you want immobile and go to the unit-type you want, scroll to Stats - Classification and set it to "Ward".
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
WC3 movement is done in steps.
You might order Archimonde to move from to your base but what infact is happeing is the move order acts as a guide for the move algerthim. The game then issues individual move orders to Archimonde as needed telling him to avoid trees and such.

The problem is that each player can generate only 1 of these micro move orders to issue to any troop per game frame which I recon is about 1/60th of a second as a rough guess. The result is that if you move 60 units at once, that will be 1 micro move order per unit per second.

Micro moves are not that small though, they can last upwards of 3 seconds depedning on unit movement speed. However this is only in ideal conditions as you will soon find out.

Micro moves will be considerably shorter near complex terrain aspects (like when lots of trees are present) meaning they may not even be enough for a whole second of movement. Worse still (and this is the main problem with total movement failure) is that micro move orders are cancled completely if a unit bumps into another unit causing the unit to come to a complete stop until the next micro move order is issued.

This leads to the problem you describe. The unit micro move generation system can not generate enough micro orders to keep everything moving at the same time. Worse still, the units that do get micro moves have them cancled by colliding with units waiting for micro orders meaning even less movement is performed. The result is a total movement system failure where movement becomes near impossible.

In such a situation the best thing to order all units you own to stop. Then select groups on the edge of the cluster and order them to move 24-48 troops at a time to the target point and send the next 12-24 after a while until pathing system problems start to be visible and wait till they reach their desternation. This is faster than letting them continue moving all at once cause you avoid wasted micro moves due to unit collisions.

Symptoms of this occuring are when units sit for a noticable time before starting to move. Units moving in a wave patter. Huge masses of units not moving anywhere you told them to go.

You can cure this to a degree by using an open map with nothing collidable and removing unit collisions. In my green circle TD you can quite easilly have 200 enemies moving at once on the paths without them suffering the above symptoms cause the paths are straight and open while the units have no collision.

StarCraft II does not have this problem at all, you can move 1000s of units at the same time fluidly. It does however usually suffer major performance problems (low frame rate) when doing so. This is because it uses a pathing mesh system meaning that it pre determines areas that are pathable and can order the micro move orders as soon as they expire by looking up the mesh system (no idea how that works) and unlike WC3 it does not cancle movement when 2 units collide.
 
Status
Not open for further replies.
Top