Customized "Land Mines"

Accname

2D-Graphics enthusiast
Reaction score
1,465
In the trigger you add events for each unit spawned. These events add up, they are getting more and more each time the trigger is called. Thats a memory leak as well.
And games usually not start to leak due to lags. The lag only happens when the memory leaks are this heavy, that all RAM on your computer is used and it has to use hard drive memory to store game data. since hard drives are by far slower then RAM this process will take far more time thus lag the game.
but the main problem is not the lag but the heavy loading time when you exit the map, this time is needed to clean all the leaked memory in your map.
besides that its just bad style and why not avoid it if possible?

but as you can see in my example triggers this very simple ability can be done much easier and faster and with by far better performance.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
this was only adding an event for the mines that are spawned and if i were doing it through jass i would just destroy the event after the unit is destroyed, but thats getting more into it, once the mine is destroyed the event would remain but not be fired and unless you are spamming multiple mines per second that would not effect the map overall...

with yours it may be more effecient but it is a quite bit more complicated, why trigger the damage and effects if the land mines already do that? and my attempt was to make it MUI without a unit indexxing system or hashtable, although it probably would have been much easier just to use a hastable with the unit as the key like you, i try and avoid getting into them though unless i know exactly how versed the OP creator is with them
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top