[General] Lags because of the number of units

Level 10
Joined
Mar 17, 2012
Messages
582
Greetings. I have a map for 8 ppl where players send units and build towers. The problem is every player has about 40 towers and 50 units operating at the same time and it causes lags in the late game.
Any idea how I can avoid lags not reducing the number of units?
I know there're maps much bigger and they work well, so maybe there's some lifehack or sometnig. Thanks in advance!
 
Level 23
Joined
Mar 15, 2012
Messages
2,669
Less complex pathing or triggered movement or smaller collision sizes of units or using ghost visible... Maybe could do a trick with waygates but unlikely. Also since your only using 8 slots then you could use another 8 slots with shared control if your using refailed. Edit: You meant delay right? If its actual lag then use lower poly models or if GUI unitgroups then change ForGroup's to FirstOfGroup loops.
 
Level 9
Joined
Feb 27, 2019
Messages
215
Do you remove dead units? You can try setting Combat - Death type to Cant raise, does not decay. Unless you need those functions. If Im not mistaken this will cause units not to show an explode unit animation if killed by the likes of Canon Towers though.

Lower death time for units in Art - Death time (seconds). But be vary, it can cause death animations for certain models not to play if put it too low.

Does some towers have an insane attack speed and intensive effects? Bad.

In Gameplay Constants you can change the time it takes for units and structures to decay aswell as effects and missiles. Perheaps you could try and see what happens if you lower these values a bit. The time may be dependant on mainly the death animation of effects and missiles etc
 
Last edited:

Dr Super Good

Spell Reviewer
Level 59
Joined
Jan 18, 2005
Messages
26,664
Could possibly be a leak of some kind causing this. As the game progresses the amount leaked increases as well which makes each frame more difficult to calculate.

A common example of this is trigger created special effects. Unless they are explicitly destroyed after creation they will cause a visible object leak. This is one of the worst kind of leaks in Warcraft III since when the area is viewed by players each leaked effect has a computational overhead on both CPU and GPU. A thousand such leaks in a small area can bring even a high end computer to slide show frame rates. The reason this leak is so common is because many models visually disappear as part of their animation leading inexperienced editors to believe the effect magically removed itself even though it still exists and is still being drawn by the game.

Another common example of this are powerup items like on pickup tomes or runes. Each time such item is used the game immediately kills the item where it is located. Since items never decay, the dead item remains forever on the map. Since items also have a model associated with them, the result also is very similar to a special effect leak as described above since even though dead item animation appears invisible, the model is still being drawn. After a few thousand or tens of thousands of tomes are used in the same area of the map players may start to experience slide show frame rates when viewing that area of the map. The solution is to have triggers that periodically remove dead items or explicitly remove powerup items soon after they are used, cleaning up the leak.
 
Level 9
Joined
Feb 27, 2019
Messages
215
Another common example of this are powerup items like on pickup tomes or runes. Each time such item is used the game immediately kills the item where it is located. Since items never decay, the dead item remains forever on the map. Since items also have a model associated with them, the result also is very similar to a special effect leak as described above since even though dead item animation appears invisible, the model is still being drawn. After a few thousand or tens of thousands of tomes are used in the same area of the map players may start to experience slide show frame rates when viewing that area of the map. The solution is to have triggers that periodically remove dead items or explicitly remove powerup items soon after they are used, cleaning up the leak.
I didnt know this about items! That is very useful information. I dont remember reading about this in any guide about leaks.
 
Last edited:
Top