Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: short wait triggers
short wait triggers
Apr 1 2009, 1:14 am
By: okeee  

Apr 1 2009, 1:14 am okeee Post #1



I have about 10 wait triggers for 1 player,
like this:
action: set hitpoints for all buildings to 100%
wait 10ms
preserve trigger

The first trigger of the list runs fine, but the others always have a few seconds delay, and the changing the wait to 0 or 100ms doesnt change the amount of delay.
I know that you better prevend using long multiple wait triggers, but setting them all to 0ms doesn't change anything.



None.

Apr 1 2009, 1:21 am Biophysicist Post #2



You're encountering wait blocks. You can use a Death Count timer instead of Wait, which doesn't have this problem.



None.

Apr 1 2009, 2:29 am okeee Post #3



I thought that was prevented by using short wait triggers (less than 1000ms), I have used several of them this way without problems before (each of them 100ms) so are there other things that could cause the delay as well?



None.

Apr 1 2009, 4:09 am Falkoner Post #4



Wait 0 ms is actually the same thing as wait 42 ms, waits are rounded to the next closest multiple of 42. You can sort of use them and get away with it, but after you do enough of them they do begin to add up, just use death counts instead and you'll have no issues.



None.

Apr 1 2009, 11:19 am NudeRaider Post #5

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Falkoner
Wait 0 ms is actually the same thing as wait 42 ms
I thought the smallest wait you can have is 84ms and THEN in 42ms steps?
Hyper triggers also seem to indicate that as they run every 84ms.




Apr 1 2009, 8:59 pm Falkoner Post #6



Quote
I thought the smallest wait you can have is 84ms and THEN in 42ms steps?
Hyper triggers also seem to indicate that as they run every 84ms.

I'm pretty sure I've discussed this with you before on another topic.. However, upon testing you seem to be right, on the first part, however, other tests show that hypertriggers are faster or slower whether or not you have 42 or 43, you thought the same thing in the other topic, IIRC, however I can't explain why lone waits don't seem to work the same way.



None.

Apr 1 2009, 9:17 pm rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

Only a theory, but each frame is 41.667 milliseconds, which rounds to 42 ms. When a wait is encountered, it waits 1 frame, then causes all other triggers to run on the next frame. That means hyper triggers have to run every other frame, unless the wait is for more than 1 frame (ie... 43 ms).

However, I think this needs some further testing. Specifically, can we get actions to run on odd frames? If we can, then this concept is proven. If we can't this is incorrect, and waits simply defer to the next hyper trigger cycle available (ie... every 2 frames).



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Apr 2 2009, 7:55 pm okeee Post #8



What exactly is the difference between having a couple of triggers of 0ms and hypertriggers, as hypertriggers do not seem to have this problem.



None.

Apr 2 2009, 10:01 pm Falkoner Post #9



Quote
What exactly is the difference between having a couple of triggers of 0ms and hypertriggers, as hypertriggers do not seem to have this problem.

The difference is that with Hypertriggers you are fine with wait blocks, as they do cause them, but since they are only to speed up other triggers, it isn't an issue, when the wait in in a trigger with other actions, it having to wait for other waits to finish becomes an issue.



None.

Apr 3 2009, 10:02 am NudeRaider Post #10

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Yeah basically hyper triggers are one huge wait block. Even though they consist of only
3 * 63 wait(0)'s which would add up to 189 * 84ms = 15.875s
it takes like 6 hours (exactly (x + 1)^n * ht)
With x = number of waits = 62, n = number of hypers = 3, ht = time until the next trigger check loop = 0.084s
63 ^ 3 * 0.084s = 21004s = 5h 50m 4s
until all waits have been gone through.
So your hyper triggers are blocking each other *1), but since they serve no other function than to increase the trigger checking speed *2) there's no action you're missing / waiting for.


*1) They are not blocked completely, but they are calling each other in a huge cascade, so that even these wait(0)'s add up. Basically every wait is calling every other wait. Check this tutorial for deeper understanding of hyper trigger theory.
Summary of how they work:


*2) If you checked the link / read the collapse box you already realized that: Hyper triggers increase the trigger checking speed because whenever StarCraft hits a wait it is checking all other triggers and then waits the time specified until it continues the trigger. At which point it hits another wait which again causes the triggers to be checked.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:59 am]
zsnakezz -- >:)
[04:59 am]
zsnakezz -- :)
[04:58 am]
zsnakezz -- somebody gets it
[04:58 am]
zsnakezz -- and its not all just numbers in my file screen
[04:57 am]
zsnakezz -- thank you for your comment though, good to know some people out there tried my map out
[04:57 am]
zsnakezz -- just kidding
[04:57 am]
zsnakezz -- ultra you have any thought or notes on undead invasion?
[2024-5-31. : 2:36 pm]
Wing Zero -- Bop em
[2024-5-31. : 2:36 pm]
Wing Zero -- Mods
[2024-5-29. : 9:40 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: jjf28, RIVE, Roy, C(a)HeK