• 🏆 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 lags to the point of being unplayable

Status
Not open for further replies.
Level 12
Joined
Dec 11, 2014
Messages
662
In my map after playing it for some times it start to lag so much it brings you down to even 1 FPS, later it will be 0, then it unlags for 1 minute and again start choking.

I read about leaks but no matter what I still don't understand them. I use GUI.
Can anyone tell me why they think it might be happening, with my low knowledge of WE I just can't seem to figure it out. Ty<3
 
It "unlags"? Leaks are permanent until you end the game.

Though mass heavy operation and creation may be cause of lags.
(Too heavy operation for example: PickingAllUnitsInmap each 0.01 seconds)

For leaks: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
Focus on triggers that run periodicly at first. It's especially them, who can have bad influence.
 
Level 12
Joined
Dec 11, 2014
Messages
662
It "unlags"? Leaks are permanent until you end the game.

Though mass heavy operation and creation may be cause of lags.
(Too heavy operation for example: PickingAllUnitsInmap each 0.01 seconds)

For leaks: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
Focus on triggers that run periodicly at first. It's especially them, who can have bad influence.

The only time of unit group i have is when a player leaves that it gets all his units and deletes them, there are some other but they are triggered by an event. it doesn't do "every 0.01 seconds of the game"
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
You have a lot of errors in your map that should be corrected.

You have a lot of unit group leaks. These can eventually cause lag.

Never use integer A / B. Create your own integer in the variable editor and use that integer in place of integer A / B.

Anything you use twice or more should be stored in a variable and the variable should be used. Example: Set tempUnit = (Picked unit). Then use tempUnit in place of picked unit.

Use triggering unit instead of trained unit / entering unit / dying unit / sold unit / and others.

You have location leaks which can cause lag.

You use a gold giving trigger that is inefficient. You can use mine. It is on this site and is more efficient and allows a couple of different options on how to give gold. It will also decrease your map size by a little bit. My system is in jass but everything you need to edit / change is all in GUI so it is easy to use. http://www.hiveworkshop.com/forums/spells-569/give-gold-lumber-system-v-1-0-1-4-a-238447/ There are 2 systems one for giving gold and one for giving lumber in that link. You can use one or both if you feel like it.

You should take a look at my tutorial Things you should know when using triggers / GUI. This will help you to code more efficiently.

Other than the things mentioned the map looks pretty good. ( I didn't test for any corrupted objects)
If you have a lot of location leaks then the game typically lags when your screen is focused on the general area of the location leak. As you move away the lag goes away. (not all the way away )
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You have a lot of unit group leaks. These can eventually cause lag.
From what I could tell he had some, but not a lot. Those were finite in number since they were mostly initialization or once off events like player leaves.

Never use integer A / B. Create your own integer in the variable editor and use that integer in place of integer A / B.
Not his problem. Those do not leak nor do they cause poor performance for most purposes.

Anything you use twice or more should be stored in a variable and the variable should be used. Example: Set tempUnit = (Picked unit). Then use tempUnit in place of picked unit.
That is correct however makes only really a difference in high performance code, of which he has none of.

Use triggering unit instead of trained unit / entering unit / dying unit / sold unit / and others.
Makes only a difference in performance code. He has none of such code.

You have location leaks which can cause lag.
Currently this is what I am thinking is the cause of the poor performance. Every spawn and every way point leaks a location which will add up over time.

Without a replay which ends by performing badly I cannot rule out other factors such as excessive visual effects etc.

You use a gold giving trigger that is inefficient. You can use mine. It is on this site and is more efficient and allows a couple of different options on how to give gold. It will also decrease your map size by a little bit. My system is in jass but everything you need to edit / change is all in GUI so it is easy to use. Give Gold and / or Lumber System v 1.0.1.4 There are 2 systems one for giving gold and one for giving lumber in that link. You can use one or both if you feel like it.
As good as it is, that is not his problem. It is not like he has any performance critical code in the first place let alone such code that deals with gold.

If you have a lot of location leaks then the game typically lags when your screen is focused on the general area of the location leak.
Incorrect? Location leaks do not alter performance at all by themselves. Instead they will make location based operations more computationally expensive (especially ones that return location objects).

You might be confused with special effect leaks. Although the model is not visible (due to animations) it will still be animated and rendered when in view. With enough special effect leaks viewing an area might require several frames of GPU time to generate a single display frame.

Items also suffer a similar graphic leak if they are killed instead of removed. Since items lack decay and then removal, all killed items persist until end of session or removal. His map does not suffer from this item leak since he removes all his items. His map might suffer from internal widget leakage however but that is hard to prove.

His sell trigger leaks a special effect. This should be minor for most TDs (as selling is bad) however if selling occurs a lot it would explain his performance problem.

I do not think locations have to even be valid. People used to use them as data structures by direct typecasting integers into them. Locations also do nothing with the camera so I doubt viewing them can possibly lower performance.
 
Status
Not open for further replies.
Top