Hi is there a way to see if i need to optimize some of my triggers? I have some large ones that fires every 1 sec.
And can triggers effect your frame rate in anyway?
I have one that update some dialog items alle the time.
And one for door opners. that if a unit is close to it it open. the problem with enter region is the if you run fast in and out before doors animation are done. it dont work and you have to run in and out again.
Go start your map with the debug-window open.. And see how much time these triggers uses.
I recently did some optimizations on my map, where I, with other things, changed the events for these periodic events. The map is without a doubt smoother now.
I can help with the door problem, so you can use unit enters region instead of every 1 second. Just figure out how long the animation takes, and have the door-closing trigger wait that many seconds before it closes the door. So if you run in and out quickly, the door will open immediately, but then it'll wait until the animation is finished before it closes the door again.
Then you can have the 2 triggers turn each other on/off to prevent problems with running in, out, and back in again quickly.
nahr, you need to use your own logic, and see how much time it uses in comparison to your other triggers. For example, my Initialization-trigger uses about 1second which is a lot, but there is no way to optimize this. I had a pretty simple trigger that simply selected a unit for a player if that unit was not selected already. This trigger ran 5 times each second. Around 20seconds into the game, this trigger had used more time than my initialization-trigger. I had to do a work-around on this because it simply stole too much frame-rates, and was a bad system overall. I had a bunch of uneffecient triggers like this, and now it takes many, many minutes before one trigger has used up as much as my Initialization trigger. And by using other events than periodic(for example a leaderboard showing total-kills), then instead using an event(Any unit dies) I has reduced number of runs over 1 minute from 120 runs, to something around 10 and getting a smoother update.
Debugger is just helping you to discover which triggers are especially bad, so that you can fix those, but you should optimize all triggers to the fullest really.
I just tryed some things. And the time on the triggers dont change if i set in a new condition that only make it run half the time. ?
So the only way to change it is to change the event?
If you have problematic triggers you could have them deactivated until players are close to activating them.
Also it's usually better to have more smaller triggers that run in a queue instead of having many large ones that may be duplicates of one another. Have a look at Blizzard campaign maps.
Don't use the debugger, it's someway broken and causes too much lag. Also if you try your map in the editor, it will cause much more lag than ingame. That's becuase you are running both the sc2 game and the editor at the same time, and the editor consumes too much memory. The best way to test your latency is to publish your map as private and test it ingame.
I have yet to run into a situation where I have too many triggers going and my map routinely has dozens of complex and lengthy triggers running even in the editor. My pc is decent, but by no means beastly.
The few times I have had problems with trigger slowdown was because I did something stupid. Typically things like forgetting to add some sort of delay into loops, accidentally creating duplicate graphical/sound effects, or some other boneheaded error along those lines. A good rule of thumb is to activate triggers thru actual events rather than a periodic timer. If you can't find a workable event then add in some conditions to prevent the trigger from running needlessly.
Although some things are better to periodically update if they change rapidly. IE if you're updating some sort of status and it's constantly changing then using a periodic sample at a second or so would reduce the trigger load and make the read out easier on the player.
I have optimized alot of them now. and i can feel it :) It was really nice.
I alos done so one trigger fires on start turning on the other triggers i need in the game mode type the player selected in the lobby. So alle triggers that are to the other mods dont run :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi is there a way to see if i need to optimize some of my triggers? I have some large ones that fires every 1 sec. And can triggers effect your frame rate in anyway?
@kongkim82: Go
Poor use of triggers absolutely can kill your framerate or cause other game-breaking issues. What do you need a trigger that fires every second for?
@Chiquihuite: Go
I have around 5 of them :)
I have one that update some dialog items alle the time. And one for door opners. that if a unit is close to it it open. the problem with enter region is the if you run fast in and out before doors animation are done. it dont work and you have to run in and out again.
And some for making timers.
@Chiquihuite: Go
But how much impact do large triggers have on the game?
@JakeCake26: Go
Hmm ok i will try that. Is there a time where you can say its ok an that bad?
I can help with the door problem, so you can use unit enters region instead of every 1 second. Just figure out how long the animation takes, and have the door-closing trigger wait that many seconds before it closes the door. So if you run in and out quickly, the door will open immediately, but then it'll wait until the animation is finished before it closes the door again.
Then you can have the 2 triggers turn each other on/off to prevent problems with running in, out, and back in again quickly.
Ok thx all.
I just tryed some things. And the time on the triggers dont change if i set in a new condition that only make it run half the time. ? So the only way to change it is to change the event?
If you have problematic triggers you could have them deactivated until players are close to activating them.
Also it's usually better to have more smaller triggers that run in a queue instead of having many large ones that may be duplicates of one another. Have a look at Blizzard campaign maps.
@OutsiderXE: Go
Ok thx. Whare do i find the campaign maps?
File => Open => Campaign tab
@dgh64: Go
Cool thx didten know :)
Don't use the debugger, it's someway broken and causes too much lag. Also if you try your map in the editor, it will cause much more lag than ingame. That's becuase you are running both the sc2 game and the editor at the same time, and the editor consumes too much memory. The best way to test your latency is to publish your map as private and test it ingame.
I have yet to run into a situation where I have too many triggers going and my map routinely has dozens of complex and lengthy triggers running even in the editor. My pc is decent, but by no means beastly.
The few times I have had problems with trigger slowdown was because I did something stupid. Typically things like forgetting to add some sort of delay into loops, accidentally creating duplicate graphical/sound effects, or some other boneheaded error along those lines. A good rule of thumb is to activate triggers thru actual events rather than a periodic timer. If you can't find a workable event then add in some conditions to prevent the trigger from running needlessly.
Although some things are better to periodically update if they change rapidly. IE if you're updating some sort of status and it's constantly changing then using a periodic sample at a second or so would reduce the trigger load and make the read out easier on the player.
@Foolish_Fool: Go
I have optimized alot of them now. and i can feel it :) It was really nice. I alos done so one trigger fires on start turning on the other triggers i need in the game mode type the player selected in the lobby. So alle triggers that are to the other mods dont run :)