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

[Trigger] My map is lagging because of something unknown?

Status
Not open for further replies.
Level 6
Joined
Jul 12, 2017
Messages
139
Hi, I have been working on this map for a while now. I have been testing this on almost daily basis and there's an issue that I cannot solve so I need help if possible.

My map is a co-op heroes survival map where people do objective and survive waves of enemies. I always notice that there is a small lag spike here and there. After wave 6 or 7, the map begins to lag bit by bit (You can check at wave trigger folder). After wave 10, the map starts to lag unreasonably even if there is so little unit on the map. An ability like flamestrike or something with big animation can create lag like crazy, including summoning ability too. I wonder where did I do wrong since I tried to check my trigger one by one and nothing seem to be unusual?

Here's my map, really appreciated your help!

Azeroth Heroes Survival Arena
 
Level 6
Joined
Aug 28, 2015
Messages
213
I opened your map and had a quick look over your triggers and there are some position leaks by order attack to position of random unit...
also I would recommend you to have a look into arrays you have a lot of things that would be easier to handle with few arrays.
I will have a deeper look into it when I get some more time.
Ps: post here some of your trigger please; if you believe or not but I think 50% of the forum don't has their editor installed at this time.+ it's takes to much time to open your map then they will spend just to check over some issues.
 
Level 12
Joined
Dec 11, 2014
Messages
662
Well my editor crashed a couple of times but ok. First of all I recommend shortening the map file name, Warcraft doesn't like when they are too long and it may cause problems to some. Another thing is the
trigger names, someone correct me if im wrong but longer trigger names need more time to fire (even tho it's not that much difference it would still add up in your map.

Also things like these:
  • Avatar Muradin
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Avatar (Muradin)
    • Actions
      • Floating Text - Create floating text that reads |c00FF7F00Avatar!|r at (Position of (Casting unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Wait 2.50 seconds
      • Floating Text - Destroy (Last created floating text)
It's not good to use waits, because the "Last created floating text" (And things like (last created unit)) aren't local and could change within those 2.5 seconds, thus you'd leak a floating text. This goes for other triggers as well like:
  • Anduin Cutting Edge Level 3
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
      • (Level of Cutting Edge (Anduin) for (Attacking unit)) Equal to 3
    • Actions
      • Unit - Add Armor Bonus -12 to (Attacked unit)
      • Wait 15.00 seconds
      • Unit - Remove Armor Bonus -12 from (Attacked unit)
Other than that it's as they already told you, code is really inefficient in a lot of places, could be made shorter, thus helping the map's performance.
 
Status
Not open for further replies.
Top