Staredit Newtork
Community
StarCraft
Games
Site
Favourites
 
[*]
Hyper Triggers
Hyper triggers are triggers that utilize Wait actions to speed up the check rate of triggers at up to 8.0 times per "game-time" second, or 11.9 times in real-time seconds (fastest game speed with wait(0); actions).
Normally the trigger cycle only occurs once every two seconds, but when a Wait action "waits" the trigger cycle repeats prematurely. A hyper trigger is simply a collection of waits that are constantly activating, making the trigger cycle occur as fast as Starcraft will allow, or however fast the mapmaker chooses.

Common Hyper

The most commonly used method of creating hyper triggers only requires one player without other wait triggers. Note, however, that there is a disadvantage to having waits constantly being activated. A player can only have one Wait action waiting at any given time, so hypers can cause extreme wait blocks.

The player who the hyper triggers are assigned to will not be able to reliably use any other Wait actions. For this reason it is highly recommended that hyper triggers not be set to All Players or any of the Forces, as these options simply copy the trigger over to multiple players.

In order to bypass the restriction of not being able to use waits, death counters-- as a timer-- are often used in their place.

Another possible problem with this form of hyper trigger is the next ending occurence, or "NEO" for short, which is a moment where the hyper triggers lapse, and the normal 2 second cooldown between trigger cycles occurs. This can be mostly avoided by adding extra copies of the hyper trigger. NEO is explained below. To avoid a quick NEO there only needs to be three copies of the hyper trigger, any more is simply a waste of space.

Hyper triggers are usually made like this:
Quote
Players:
(A player that doesn't use any other waits. Avoid using the Forces or All Players.)

Conditions:
Always.

Actions:
Preserve trigger
Comment. "Hyper Trigger"
Wait 0 milliseconds
Wait 0 milliseconds
Wait 0 milliseconds
Wait 0 milliseconds
Wait 0 milliseconds
(Fill the action list with waits)

Switch Hypers

This method of hyper triggers does not have a NEO. It is not quite as simple, however, and it requires an additional player with no other wait triggers. This method will also never cause wait blocks. At the most this method will add a fifth of a second to the wait, although while the wait occurs the hyper triggers will turn off, this method also gives the ability to turn the hyper triggers on and off without having to wait for them to turn off.
Quote
Players:
(Player "X")

Conditions:
Switch 1 is set.

Actions:
Preserve trigger.
Comment. "Clear"
Wait 0 milliseconds.
Clear Switch 1.
Quote
Players:
(Player "Z")

Conditions:
Always

Actions:
Preserve trigger.
Comment. "Set"
Wait 0 milliseconds.
Set Switch 1.
Wait 0 milliseconds.

Calculating the NEO

The frequency of the NEO (in seconds) can be calculated by finding the power (number of copies of the hyper triggers) of the number of wait conditions in a single hyper trigger plus one, then by finding the product of the result and 0.084 (the speed of the hyper trigger cycle in milliseconds).

NEO = (x + 1)n * 0.084 seconds; x < 64, n > 0

In this example, I have 4 copies of hyper triggers with 62 waits per hyper trigger which will look like this:

[62][62][62][62]

[]=hyper trigger
62=# of wait actions

NEO = (62 + 1)4 * 0.084 seconds
NEO = 634 * 0.084 seconds
NEO = 15792161 * 0.084 seconds
NEO = 1323248.724 seconds

1323248.724 seconds is around 367.56909 hours, which is over two weeks of a grace period before the NEO comes around. Nobody in their right mindset will play a map for over two weeks straight, usually.

Hyper Triggers and Map Lag

Often, complex maps or maps that require actions every trigger cycle will cause map lag, due to the CPU load of running triggers 12 times every 1.008 seconds. Fortunately with hyper triggers, the Wait time can be customized to determine how many cycles per second the triggers will run. Since in most cases it is not necessary to run hyper triggers as fast as Starcraft allows, unintentional map lag is often caused by attempting to run triggers faster than is necessary.

Most of this misunderstanding seems to be centered on a confusion around what the Wait action actually does. When the computer comes across a wait action it will run a full trigger cycle at approximately 1/12th of a second, then wait the alotted time. An isolated Wait(0) action will thus run two trigger cycles at 1/12th of a second, whereas an isolated Wait(168) action will run one cycle at 1/12th of a second and one cycle after waiting 1/6th of a second.

Basically, Starcraft always runs triggers at 1/12th of a second, regardless of how long the cooldown between trigger cycles is. The Wait action, when used properly, customizes this cooldown to whatever the mapmaker wishes, with a minimum of 84 milliseconds. Common hypers at Wait(84) are thus equivalent to hypers set at Wait(0), simply because the trigger cycle in Starcraft will NOT repeat faster than 84 milliseconds.

Applying this understanding, say you wanted to run a trigger cycle 6 times every second instead of 12 throughout the entire game. You would use something similar to the common hypertrigger above, except with your wait set at 168 milliseconds instead of 84 or 0 milliseconds:
Quote
Actions:
Preserve trigger
Comment. "Hyper Trigger"
Wait 168 milliseconds
Wait 168 milliseconds
Wait 168 milliseconds
Wait 168 milliseconds
Wait 168 milliseconds
(Fill the action list with waits)


Four times every 1.008 seconds would be 252 milliseconds, three times would be 336 milliseconds, etc.


Using the knowledge on this page it is possible to fully customize when and how fast your triggers are running, eliminate map lag and optimize trigger timing. Using a combination of simple hyper triggers and switch hyper triggers, an understanding of how adding more Wait actions influences how many trigger cycles will reset prematurely, and varying wait times, a mapmaker has total control.


[06:31 pm]
MePHiStO_IS_GoD -- nicce wanna game on east?
[06:24 pm]
[DeVouReR]:] -- now
[06:15 pm]
MePHiStO_IS_GoD -- still there Dev?
[06:05 pm]
MePHiStO_IS_GoD -- er Afternoon
[06:04 pm]
MePHiStO_IS_GoD -- Good morning SEN
[05:56 pm]
madroc -- there are some things even i cannot fix, i am moving on now
[05:48 pm]
madroc -- I feel bad
You must log in to shout.

©2003-2008 Staredit Network.
Starcraft & Starcraft II are trademarks of Blizzard Entertainment.
Site Index   |   Terms of Service   |   Privacy Policy   |   Contributions