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

Incredible map lag with stackable abilities

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

I implemented a system where I use the binary count offs to stack stats like attack speed, spell resistance, and mana. For health and damage though I only use tomes (a tome is added to the hero's inventory which he automatically uses).

I have a simply trigger when I type "-level" it levels up the hero 100 times, including their attributes. This involves the hero receiving about 600 tomes in a second (for damage and health) During that there is some lag, but then it goes away.

But now the lag stays. And if I keep leveling more heroes, the lag gets unbearable.

So clearly something must be leaking? The only things I'm using are
JASS:
 call UnitAddAbility [code=jass] and [code=jass] call UnitAddItemById [code=jass].  Do these create things that need to be destroyed?  Here is the function that gets called on each level up--I understand calling it a 100 times in a row would cause lag initially, but the lag shouldn't stay forever...
 
Last edited:
Level 15
Joined
Aug 7, 2013
Messages
1,337
There is no setup trigger.

It does everything for you. Just simply copy it to your map and its all done.

Wow I made several thousand tomes and lo and behold the lag cleared up in a few seconds. Thank you for pointing me to this solution.

But how on earth does this clean item system work if there's no trigger? How does it just fire off every 15 seconds?

And also, I notice when the map is very laggy (from calling my function 500 times) something really really weird happens to the map for a split second. Why is this?

Actual picture/map
bitd8z.png


What I see for a second when making 500 function calls
mkurzq.png
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
That is odd it must be sacrificing the graphics to reduce the lag.

That system fires off every 15 seconds. It enumerates all items in the map. Then it checks the enumerated item to see if its health is below 0.405 ( the death value.)

But how does he make it so it fires off every 15 seconds? Can you give me the line? Wait, do the function calls in the struct actually get called immediately when the map loads, i.e. this line is located inside a struct called S.

JASS:
 call TimerStart(s_timer, CLEANING_PERIOD, true, s_code)

So if he didn't use a trigger to do this, is there anything reason you should ever make your system into a trigger if you can just have a function call like that?
 
But how does he make it so it fires off every 15 seconds? Can you give me the line?

  • Time - Every 15.00 seconds of game time
Wait, do the function calls in the struct actually get called immediately when the map loads

Timers start ticking when the map starts (after load).

So if he didn't use a trigger to do this, is there anything reason you should ever make your system into a trigger if you can just have a function call like that?

What are you talking about?
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
  • Time - Every 15.00 seconds of game time


Timers start ticking when the map starts (after load).



What are you talking about?

I am referring the JASS version of that resource. If you have a system that is based off a timer, when would you ever want to make it into a trigger? Or are all timer based actions not triggers?

In the library there are no TriggerRegisterEvent, there's just a call when he defines a struct.
 
Status
Not open for further replies.
Top