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

Map Lag

Status
Not open for further replies.
Level 4
Joined
Dec 3, 2012
Messages
51
Hi,

I am nearly finished with my map, but it has become very laggy. I have checked most of my triggers, and they appear leakless. What I am afraid could be causing lag is the number of objects on the map.

Here are the stats:

Map size- 180x212
Total units- 863
Destructibles- 4726
Doodads- 3509
Trigger- 345
Variables- 308

Although there are a lot of units, they are spread out across the map, and the player doesnt have too many on screen at once. There are also 200 neutral passive units, so I have to see if I can reduce that. Whats strange is when I play the map the lag comes in waves; there are periods when it is not laggy and when it is.

Could these obejcts cause a massive amount of lag or do you think it could be triggers? My machine is pretty old, so its difficult to tell if the map would run better on a more modern computer. Any insight would be helpful

Thanks
 
Level 18
Joined
May 11, 2012
Messages
2,103
it could be your machine...
It could be many periodical triggers running at the same time (especially 0.03 triggs(increase to 0.05))
Also, are you sure they are leakless? check again, you maybe missed a location or smth...
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Actually,one of the main causes of lags by units is that they are playing animations
Except the game clips animations far away from the field of view.

AI is often a common cause of lag as it can try doing stupid pathing operations which are computationally expensive but do nothing. Islands do this to the AI especially.
 
Level 4
Joined
Dec 3, 2012
Messages
51
Thanks for the replies. After looking through the Object Manager, its really hard to cut units out, as the map doesnt really feel cramped given the dimensions. I feel like other maps this size have a similar number of units. Any idea of a number I should shoot for? 600, 500? There are 280 creeps, I could try making them stronger and then reduce the number of units, but again, there arent too many units on screen at any given moment. Not that it matters much, but about 40 units and 70 items need to be subtracted from that list in the OP because I am just balancing the heros, so those would not be present in the initial version.

The map is an AoS, so many more units are being spawned periodically. There are also 277 imported files, so maybe custom animations of imported files could slow performance? To be honest, my machine is really not very good (3 gb ram, AMD turion X2, nvidia 8200m) so it is difficult to gauge the true lag of the map. As of now, the map is playable, but it has periods that are very laggy. Im just worried what will happen when I try multiplayer, as there are 10 human slots. I have spent a great deal of time making this map, and just need to finish the tool tips for the spells, and would hate to not be able to finish due to lag.

Another thing I forgot to mention is I increased the corpse decay time to 180 secs, since my creep respawn system is dependent on the corpse. A number of members have suggested other systems so I think I will review those and see if they need the corpse too.

Could the number of variables or triggers slow down the performance? Would anyone be willing to look through representative triggers to help me hunt for leaks?

Sorry for the long post, I just wanted to be thorough
 
Level 14
Joined
Jul 12, 2011
Messages
1,370
Lots of units cause great lag especialy if they are close to each other.
However there could be other factors causing this problem.
Like the 180 seocond decay time.
If you put lot of units and corpses that stay longer then BOOM!

Edit: Also check the triggers if they leak.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
nvidia 8200m
I think this is the cause of the performance problems. That card is old and was very weak for its time (low range of old series). Performance wise it is probably similar to the cards WC3 recommended for high settings at time of release.

Since it is a laptop, it might also overheat during a sessions, in which case performance is cut and the game performs even worse.

I strongly recommend using desktops to game. The number of problems people post in technical support forums that are laptop related is astounding.
 
Level 4
Joined
Dec 3, 2012
Messages
51
Thanks for the system Garfeles

My PoS machine makes it hard to tell if the map is truly lagging. Perhaps I should just finish it and then see if others have problems, and if so, then try different methods to reduce lag.
 
Level 4
Joined
Dec 3, 2012
Messages
51
My map has a lot of trees, would it help if I made them into doodads? There is no real reason to have them as destructibles (no spells or resource gathering use trees). I would probably be able to significantly reduce the number of destructibles.
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
Replacing destructables with doodads is ALWAYS encouraged! If you don't need those trees destructable, go for it! As a nice benefit, it also improves the graphical style of your map, as doodads are considered when creating the shadowmap (destructables are not, as they have a dynamic shadow).

However, as you described, your lag seems to be a trigger issue, because you said "the lag comes in waves". Lag from too many objects is usually a constant.
Try to narrow it down by disabling all spell triggers and check if the lag persists.

Also check if the lag comes from creating units, which is the slowest action you can ever have in triggers.
If it does, try to create less units at the same time and instead spawn them periodically (one unit at a time with a 0.1 second delay).
 
Status
Not open for further replies.
Top