1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Why not to use "Wait X Seconds" function

Discussion in 'Map Making' started by Woodenplank, Nov 28, 2017.

  1. Woodenplank
    Offline

    Woodenplank Brigand Map Maker

    Messages:
    1,041
    Trophy Points:
    129
    The Wait X Seconds function seems like an innocent little function, nice for spacing out actions while keeping them neat in the same trigger... Right?

    But beware! This little function can fuck you up in a fashion that will make you pray for lubricant.
    Temp01.PNG
    This little fucker is bad.

    Wait X Seconds is bad because it's real-time seconds. So imagine this
    • Trigger starts...
    • Action - Wait 50 seconds
    • Someone begins lagging, and for 45 seconds the game is paused before he/she drops.
    • Now there's only 5 seconds until the timer expires, even though the game has been frozen since it started.
    So that really sucks. If someone pauses the game, or someone has a lag spike, or if you're in Single Player and check the Quest log or anything... This greedy little piece of shit keeps ticking down. Wait Function don't give a shit what you're doing with your life, that sly minx ticks on down like a workaholic nuclear clock on crack.

    If you feel the need to put in a wait function, at least use "Wait (game-time) seconds" function instead, as it stops whenever the game stops.

    But wait... there's more!
    That's only one of the problems with using the "Wait function".
    There are also other issues; notably that several event response variables becomed nulled/overwritten when a wait is used.
    • A unit is damaged
    • Action - Wait 5 seconds/game-time-seconds
    • Heal Damaged-Unit for <Amount of damage done>
    • Deal <Amount of Damage Done> to Damaging-Unit
    A simple little damage-reflect system? Right? Right?!?
    WRONG.

    GetTriggeringUnit is the only function which continues to persist after a wait function. Damaging Unit, Leaving Unit, Dying Unit, etc. etc. These event response functions all vanish like 5 minutes of Watergate recording sessions if you do a Wait Function.

    But this little piece of dung doesn't even Wait properly. You hear that? Your name; your entire being and function is a freaking failiure.
    First off; Wait functions are only accurate down to about 0.27 or 0.28 seconds. Something like "Wait 0.05" seconds, which you might use for a fluid-looking movement loop, simply won't work, and it'll perform at no more often than 0.28 second intervals.

    Statistic tests by players have also shown that Wait is innacurate. Anywhere between 10-30% off. So "Wait 0.500 seconds" could go to "Wait 0.600 seconds, because fuck you and this function" - even in Singleplayer! So it's not even ping lag.

    Piece of shit.

    Attached Files:

    • Informative Informative x 1
  2. Robovision
    Offline

    Robovision

    Messages:
    131
    Trophy Points:
    31
    "Statistic tests by players have also shown that Wait is innacurate. Anywhere between 10-30% off. So "Wait 0.500 seconds" could go to "Wait 0.600 seconds, because fuck you and this function" - even in Singleplayer! So it's not even ping lag."


    Isnt it because nobody play at normal speed but on fastest speed as is possible to set up in W3 option menu?
  3. Yousef
    Online

    Yousef Paladin of the Alliance Brigand Map Maker

    Messages:
    1,907
    Trophy Points:
    125
    Weeeell, do you know a replacement?
  4. Woodenplank
    Offline

    Woodenplank Brigand Map Maker

    Messages:
    1,041
    Trophy Points:
    129
    You raise a valid point, however "Warcraft seconds" should always be equally "short". This isn't the case with Wait, however, as it simply varies up and down with different scales.
    These statistics are a little old, but don't expect Blizzard to have done much (unless 1.28 magically fixed the Wait Timer, of all things).
    WaitStatistics.PNG
    As you can see (when you view in in full size, any way)... Shit's pretty inconsistent, the min/max are quite different, and neither is really close to the actual value set in the function.

    Well, as I said, Wait Real-Time seconds is acceptable in some cases. If you were doing a cinematic intro (like you have in LTF, Azeorth Wars, or whatever) you could get away with something like

    -Game - Display to Player 6 Orange the <msg> for 30 seconds.
    -Wait 30 Game-Time seconds
    -Game Display to Player 6 Orange the <msg2> for 15 seconds.
    -Wait 15 Game-time Seconds
    -something else...

    And it should be fine.
    But if you're triggering something more complex you're gonna have to split it into several triggers. For instance...
    Cutout08.PNG
    cutout06.PNG

    You can also start Countdown Timers in one trigger, and have another trigger react to them. Like...
    1. Action... Start 'My Event Countdown Timer' as a One-shot Timer that will expire in 60 seconds.
    2. Event - 'My Event Countdown Timer' expires
      Condition - Something?`
      Actions - Do the delayed actions
    Countdown timers are more accurate, can display Timer Windows (like the <Income> you see in maps like LTF and Azeroth Wars), and will always pause/unpause along with the rest of the game.
    • Like Like x 1
  5. Marshmalo
    Offline

    Marshmalo Brigand Map Maker

    Messages:
    1,468
    Trophy Points:
    140