Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: 'Wait' takes far longer than it should
'Wait' takes far longer than it should
Feb 17 2010, 1:22 am
By: darkeye123  

Feb 17 2010, 1:22 am darkeye123 Post #1



Hello again,

I having a really weird issue regarding 'wait.' I have several triggers that rely on 'wait', in order to determine unit respawn and such. However, I only have one major trigger that it is always running that uses wait: Adding 2 gas/second to the players. Now the issue lies in the fact that none of these 'wait' triggers occur when they are supposed to. For example, I have a zerg queen that should die in 5 game seconds (from wait), but ends up living for around 15 before it is finally killed.
Even if I set the wait to 0 seconds, it still takes forever to proceed. If I take the wait commands out, the triggers proceed just like they should. (not they way I want them too, (since endless gas was not really the idea) but the way one would expect.)

I understand that I may have to use Hyper-Triggers, and I am looking into the simple Hyper trigger example for use. The issue is that, even with the simple hyper trigger (3 of those condition always, wait 0 (63X)), the gas accumulation and unit kills still take a long time. How can I make it so that these wait times are exactly as I type them?

Thanks for any help you can provide, and if you need any more information, please let me know!



None.

Feb 17 2010, 1:24 am Neki Post #2



With Hyper triggers, you are limited to one wait per player. Constantly running a wait is not a good idea, you'll need to use death counters.
http://www.staredit.net/wiki/Death_Counters
They're basically like waits, but do not impede the map progress. They take a little longer to set up, but they are much more versatile.




None.

Feb 17 2010, 1:27 am rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

Read up. It will tell you everything that is happening, why it is happening, and how to prevent it from happening.

Even without hyper triggers, you are still limited to one wait per player. If two triggers run which have waits, the waits are added together to a timer (IDK where the timer is) which counts down at a constant rate. It's common for war type maps to have a heal -> wait 60000, and a spawn -> wait 60000 trigger. If you spawn and heal, you can't heal or spawn for 120000 ms.



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

Feb 17 2010, 1:38 am darkeye123 Post #4



Alright, So I will use death count timers in place of the waits then. The one followup question I have is the following:

Suppose I initialize Player 7's terran marine Death Counter to have a certain of counters on it, let's say 100.
I then create another trigger that continually subtracts 1 from the death total, until the Death total is one.
Then A third trigger with the condition of "When Player 7's Marine Death total is one" activates and pulls off an effect, and then resets the Death countdown.

My question is: Without Hyper triggers, how many death counters are removed per second?
Also: Would Hyper Triggers be logical to use in an AOS style map?



None.

Feb 17 2010, 1:40 am Biophysicist Post #5



One death count would be removed every two seconds without HT. With them, it's 11.8 DCs per second.

Hyper triggers are logical in EVERY map.



None.

Feb 17 2010, 1:42 am darkeye123 Post #6



Alright.

Thanks for all of your help, Everyone! :)



None.

Feb 17 2010, 2:41 am rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

Hyper triggers run every other frame, so long as the waits in hyper triggers are 0-42 ms. If you use 43 ms, hyper triggers will run every third frame. the number increases every 42 ms wait. Fastest runs at 24 frames per second.



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

Feb 17 2010, 2:52 am Lanthanide Post #8



If HT run every 2nd frame, and fastest has 24 fps, why do we get 11.8 HT/s instead of 12 HT/s?



None.

Feb 17 2010, 3:11 am Falkoner Post #9



Good question, and honestly, I don't know for certain, but I think it has something to do with the normal 2 second trigger intervals still running behind the hypertriggers.



None.

Feb 17 2010, 3:30 am Lanthanide Post #10



How was 11.8 determined? Was a 10 second period started with create unit on each hyper trigger, with the final result being 118 (and not 120) units created?



None.

Feb 17 2010, 3:43 am CecilSunkure Post #11



I actually did the math on this with wavs and I got about 11.95 seconds. I had to approximate, of course. The way I did this, was with really long wavs. If I used a conversion factor of 12 seconds, I ended up with a slight overlap.

So to solve it, you set up your conversion factor resulting in a value of seconds as an integer (so you can use deathcounts to loop), make a wav exactly that length, and then loop it. If you hear an overlap, or gap, then your conversion factor is off. The longer the wav, the more accurate your guess as to the correct conversion factor is likely to be.



None.

Feb 17 2010, 3:48 am Vrael Post #12



Or just use a stopwatch and make a "add 1 mineral for current player" trigger. Preserve, wait a while, then # minerals/time elapsed. voila.



None.

Feb 17 2010, 4:03 am rockz Post #13

ᴄʜᴇᴇsᴇ ɪᴛ!

24 frames per second isn't exact. 11.8 isn't really exact either. It's best to use "they run every 84 ms" than "11.8 times per second". The best way to know is to just manually guess/check.



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

Feb 17 2010, 4:16 am Sacrieur Post #14

Still Napping

Just use it in game seconds. SC runs at 16 frames per game second on fastest. It is, however, much easier to think of things in terms of 12 regarding mathematics.

Post has been edited 1 time(s), last time on Feb 17 2010, 4:22 am by Sacrieur.



None.

Feb 17 2010, 4:19 am CecilSunkure Post #15



Uh, I definitely think it is faster than 16. How do you know that? I would assume it is at least 25.



None.

Feb 17 2010, 4:24 am rockz Post #16

ᴄʜᴇᴇsᴇ ɪᴛ!

SC runs at 16 game seconds regardless of speed. When you use "at least 1 game second", that means 8 hyper triggers have passed. That number is exact. It's also important to note that normal is 15 fps, so no speed will ever be the same speed as game seconds (ie, a time on SC will never match up perfectly to real time).



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

Feb 17 2010, 4:24 am Sacrieur Post #17

Still Napping

Quote from name:Cervantes
Uh, I definitely think it is faster than 16. How do you know that? I would assume it is at least 25.

Every 2nd frame the HT executes. A HT will run exactly 8 times in one game second. So by simple mathematics 2*8 = 16 frames.



None.

Feb 17 2010, 4:40 am CecilSunkure Post #18



Frames does not directly equal gameplay mechanics. It is a VERY bad idea to make both of those synchronized, and is frowned upon while programming games. You make the game processes independent from the framerate, to allow framerate fluctuation all the while maintaining constant mechanics and calculation processes. This is a bit limited though during extreme lag, which is why that timer shows up for dropping people.



None.

Feb 17 2010, 4:46 am rockz Post #19

ᴄʜᴇᴇsᴇ ɪᴛ!

This isn't some 3d shooter. This is starcraft. frames equal gameplay mechanics. Everything is linked through the framerate except wait. Certainly you're not suggesting we use wait for the mechanics?



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

Feb 17 2010, 5:03 am Falkoner Post #20



Quote
Frames does not directly equal gameplay mechanics. It is a VERY bad idea to make both of those synchronized, and is frowned upon while programming games. You make the game processes independent from the framerate, to allow framerate fluctuation all the while maintaining constant mechanics and calculation processes. This is a bit limited though during extreme lag, which is why that timer shows up for dropping people.

This is an old single-threaded game that simply goes through basically a Sleep() between frames, that's how almost every old game works, they didn't multithread anything back then.

So what I got out of this is that the 24 FPS on Fastest is just an estimation, not an exact number. The most exact way is to simply remember that 84 milliseconds per trigger cycle on Fastest is how SC works(slightly slower on lesser speeds, due to slower normal trigger checking speed, not change in Wait times, because Waits are the same between speeds), which is mathematically 11.90476 frames per second.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
Please log in to shout.


Members Online: Roy