• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Wait limited of 0.27?

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Wait
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Countdown Timer - Start timer as a One-shot timer that will expire in 30.00 seconds
      • Wait 0.25 seconds
      • Game - Display to Player Group - Player 1 (Red) the text: (String((Elapsed time for timer)))
      • Trigger - Run (This trigger) (checking conditions)
Testing like this, you'll notice that the elapsed time is always 0.1-0.2 seconds more than the defined wait value.

In multiplayer it could be even worse.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I said it wasn't true, and I made a test-map (in JASS though).

Your map clearly proves that waits are much slower than timed events though :p

This is the table of results I found while testing:
Wait Time: 0.01 secWait Time: 0.10 secWait time: 0.20 sec
Avarage Wait:0.1356 sec0.2243 sec0.3191 sec
Minimum Wait:0.06 sec0.16 sec0.27sec
Maximum Wait:0.20 sec0.29 sec0.37 sec

This was tested with absolutely no other triggers running, and as efficiently as possible.
The first wait is (I believe always) equal to the "maximum wait".

Obviously waits are pretty crappy, they're quite random and work better/worse depending on the conditions.
In a multiplayer-map with a lot of heavy systems, waits will be much slower than in my testing conditions (again: as smooth as possible).

Additionally: I did test it with a timer (and a timed event, but both worked equally well) inside the World Editor, so that might have affected my results as well (in comparison to actual software to test it, but I don't know what I could possibly use).
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can also compare Waits (in loop) with the Event - Time - Periodic Event by using the famous "knockback" system.

Put 2 units side by side (ranged at about 300 would be fine) facing same direction of 0 degree.
1 unit use Waits (in loop) method while the other unit uses Periodic Timer.
Try use a value of 0.03 for both function, 0.03 for Event, 0.03 for Waits (in loop)

Notice that the Event runs smoothly while Waits (in loop) runs a bit weird (this shows that Wait is not equal to 0.03 second (which in this case, the Wait could be greater than that))
You have to keep repeat this experiment until you can actually get a satisfying result

Waits (in loop) is this,

  • For each (Integer LoopingInteger) from 1 to 10, do (Actions)
    • Loop - Actions
      • Wait 0.03 seconds
      • Unit - Move (Triggering unit) instantly to (Center of (Playable map area))
This Wait will move the unit for 10 times.
 
Status
Not open for further replies.
Top