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

[General] Lags because of the number of units

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
579
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!
 
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 19
Joined
Feb 27, 2019
Messages
563
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 63
Joined
Jan 18, 2005
Messages
27,180
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 19
Joined
Feb 27, 2019
Messages
563
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:
Level 4
Joined
May 19, 2020
Messages
319
I didnt know this about items! That is very useful information. I dont remember reading about this in any guide about leaks.
Check it out... :
It might be useful to you!
 
Level 19
Joined
Feb 27, 2019
Messages
563
Check it out... :
It might be useful to you!
I have removed items manually but in doing so found a lot of hurdles and problems. Using the automatic item removal system the problem is 100% fixed in an efficient way opposed to removing items manually where one always has to consider every possibility and account for every item. Buy Item Cleanup 1.3 today call 06040-tome-away for 80% off. ;)
 
Status
Not open for further replies.
Top