|
Taking StarCraft Map Making to the Limit!
|
Hyper Triggers are just a whole crapload of waits, as short as possible, which is 42 milliseconds, or usually put as 0. The waits all run, and they all get stacked up, and every time one ends, a new one starts 42 milliseconds later and updates the entire trigger list while it's at it. So you get updating every 84 milliseconds.
|
|
Write your own destiny, or else someone will write it for you!
|
I'm not sure if Falk means the right thing, so I'll clarify:
The smallest wait time is 84ms, which seems to be some built-in minimum wait time. From 84ms you can increment the wait times in 42ms steps. So the 2nd smallest wait time is 126, then 168, etc. That means waits can be used to time events with double the accuracy than you'd be able using death counters and hypers. The Maplantis wiki article also contains an explanation about what waits do when you scroll down: http://www.staredit.net/maplantis/index.php?sid=03b8dbddda;wiki=6#wiki_4 Wait blocks occur when one player is executing 2 waits the same time. So obviously you should avoid waits when you're using hyper triggers. However there's 3 strategies how you can use hypers and waits: - Give the hypers to a single player which has no other waits (obvious) - Give the hypers to all players and place them at the bottom of the trigger list. The hypers of one player will be blocked when he runs a wait, but the wait will run correctly. The other players' hypers ensure that the hyper trigger effect is still working if not all players run a wait the same time. If they do all run a wait, the wait itself will run correctly but the hyper trigger effect is offline until the wait ends. - Use switched hypers (see ML wiki) to temporarily switch off hypers via an additional switch. (Unlike common hypers, switched hypers end as soon as the condition is no longer met) In the old Tutorials of SEN v4 there was a very detailed explanation how hypers work and in which order the actions are executed. I reformatted my PC and thus lost my link to Doodle's Tutorials which, when I remember correctly, contained this explanation. I'll try to dig it out for ya, or maybe Falk can link you to it. EDIT: There it is: http://doodle77.dyndns.org/tutorials.php?id=128 This post was edited 1 time, last edit by NudeRaider: May 13 2008, 2:54 am.
![]() ![]() ![]() ![]() ![]() ![]() ![]() http://sonsofwar.pyrom.net/index.html___0% 100% |
|
Taking StarCraft Map Making to the Limit!
|
Wrong, the shortest wait time is 42, not 84. Proof: 1000 Seconds: Milliseconds: 0 Number of runs: 8007 Milliseconds: 42 Number of runs: 8007 Milliseconds: 84 Number of runs: 5338 Milliseconds: 85 Number of runs: 4004 It's just that the trigger looping causes an extra 42 milliseconds to be added, giving you once every 84 milliseconds. |
|
What would be the particular order of executing wait actions I've labeled:
CodeExample 1. TRIGGER T1 Owners: Player 1. Conditions: Always. Actions: A11: Wait 0 milliseconds. A12: Wait 0 milliseconds. Preserve trigger. END T1 TRIGGER T2 Owners: Player 1. Conditions: Always. Actions: A21: Wait 0 milliseconds. Preserve trigger. END T2 If we assume, when encountering a wait, all triggers (excluding those of them which execute at the moment) are previously checked and this is stacked for different waits the sequence must be like this: ( T1( /* before A11 get executed we check all other triggers first */ T2(A21), A11, T2(A21), A12), T2(T1(A11, A12), A21) ). I mean sequence of actions (A21, A11, A21, A12, A11, A12, A21) with an additional information about what trigger SC remembers to be executing at the moment. But there are 7 waits executing instead of predicted 6 by http://doodle77.dyndns.org/tutorials.php?id=128. Where am I wrong? This post was edited 7 times, last edit by Wormer: May 13 2008, 4:08 pm.
![]() ![]() ![]() ![]() ![]() ![]() |
|
If SC is rechecking triggers from the beginning when wait is met, how could you explain the next test is creating only one marine?
CodeTest 1 //-----------------------------------------------------------------// Trigger("Player 1"){ Conditions: Switch("Switch1", not set); Actions: Preserve Trigger(); Create Unit("Current Player", "Terran Marine", 1, "Anywhere"); } //-----------------------------------------------------------------// Trigger("Player 1"){ Conditions: Always(); Actions: Preserve Trigger(); Wait(0); } //-----------------------------------------------------------------// Trigger("Player 1"){ Conditions: Always(); Actions: Set Switch("Switch1", set); } //-----------------------------------------------------------------// ![]() ![]() ![]() ![]() ![]() ![]() |
|
How then we get that exponential growth with classic hyper triggers? And further, reasoning that way we should conclude that the hyper triggers owners' triggers are still executeing one time in two game seconds, which, we know, is not like that.
This post was edited 1 time, last edit by Wormer: May 13 2008, 6:27 pm.
![]() ![]() ![]() ![]() ![]() ![]() |
|
It seems I began to subconsciously understand how it works... but if one asks me I still would not be able to describe the algorithm.
I wonder, could somebody there distinctly describe the percise algorithm of how SC behave when it hits the wait? The devilesk's description is not right at least beacause of this. Well, lets have a little competition! I'll give 50 minerals to that person who first will intelligiblely explain me (which means povideing the percise algorithm at least) how the whole system with waits works before I figure it out myself.Head topic is edited. This post was edited 1 time, last edit by Wormer: May 20 2008, 11:53 am.
![]() ![]() ![]() ![]() ![]() ![]() |
|
My expanation is incorrect.
![]() ![]() ![]() ![]() ![]() ![]() :: Firefox :: Trillian :: Crap Cleaner :: AusLogics Disk Defrag :: :: AVG Anti-Virus :: Spybot :: RegSeeker :: 7-Zip :: Winamp :: :: Audacity :: Irfanview :: OpenOffice :: |
|
Taking StarCraft Map Making to the Limit!
|
It's game seconds, and I did it at fastest, to test I simply had a trigger: If elapsed game time is at most x(in this case 1000 seconds) Set Minerals for P1 +1 Preserve Trigger I always imagined it that every single trigger runs when it hits a wait, since otherwise hypertriggers wouldn't work so well unless at the bottom of the list, I imagine that when a wait is hit, every trigger after the wait is run, then all triggers ahead of the wait are run. Other than that, the theory about wait stacking seems correct. |
|
I paid eleven minerals for THIS?
|
To add a small piece to the puzzle: the 'minimum wait time' is due to timer granularity, and should be unaffected by game speed.
![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |