• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Initially off triggers consume resources?

Status
Not open for further replies.
Level 21
Joined
May 16, 2012
Messages
644
Do you enable in-game? If you leave it disabled then it will be ignored by the compiler.

I'm editing a map, and it has a lot of triggers (100+ triggers), most of them are for heroes skills and others for items, so i just enable a trigger if this trigger belongs to a unit that is controlled by a player user, otherwise all of non used trigger stay disabled during the game. So disabled ones will not be a problem right?
 
Level 12
Joined
May 22, 2015
Messages
1,051
Yeah, ahahha, i think i've been editing this map for like 1 year, almost every day!! Thx Man.

Btw, how bad is for gameplay a periodic trigger that's always on?
It's not a problem as long as the trigger doesn't do ridiculous amounts of work or doesn't run often.

1) How low is the timer?
2) What happens in the trigger?

You can have tons of triggers and timers without any problems.

I don't know about turned off triggers, but I doubt they will be a problem.
 
Level 21
Joined
May 16, 2012
Messages
644
It's not a problem as long as the trigger doesn't do ridiculous amounts of work or doesn't run often.

1) How low is the timer?
2) What happens in the trigger?

You can have tons of triggers and timers without any problems.

I don't know about turned off triggers, but I doubt they will be a problem.

Considering the one's that is always ON, they usually just move units to position.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Considering the one's that is always ON, they usually just move units to position.
As long as you are clearing the memory leaks when when the trigger runs, there should be no problem (and that is only if it's going to be run A LOT during a single game).
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Triggers that are disabled are not compiled so have no overhead in game.
Triggers that are off and have evenets should have practically no overhead in game as their actions will not fire. I am unsure if the events are deregister from internal event lists or if the event just does not cause the JASS virtual machine to run but in any case it is a lot faster than having the trigger on.
Triggers that are on and have events will cause the JASS virtual machine to run every time the event fires. Although quite fast, it is not trivial so if it happens hundreds of times at once it can result in performance problems.
 
DSG, I think they he means "disabled" like the trigger is simply turned off.
Though there is an extra option in trigger editor to completly deactivate a trigger (marked with a red cross), then it would not even compile.

---
Normaly disabled triggers, so ones you can turn on later again, won't be unregistered by the used event(s).
But that's probably not so important because onEvent, it won't fire the trigger's evaluation and execution part (so running the trigger), and so it's not really consuming resources.

It's good practice to turn triggers off that are needed only temporary.
And the bigger the code-body is and the more operations are done insde, the more effect it will have obviously.
 
Status
Not open for further replies.
Top