• 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.

Timers Vs Waits

Status
Not open for further replies.
Level 16
Joined
Jul 31, 2012
Messages
2,217
before reading: this is not a "need help thread" it is just that i don't know where to put it anw:
the attached test map will proove that timer waits are not always so much accurate compared to normal waits, here is the description:
This test map is gonna proove that timer waits are not always as accurate as ordinary waits
Here is what's going to happen: at 9.99 seconds elapsed a timer trigger will begin while a normal wait will also begin (both for 5 seconds)
A loop trigger will show the time elapsed when the wait will occure
the normal wait will kill the red peasant and the timer wait will kill the gray one
 

Attachments

  • Timer vs Waits.w3x
    18 KB · Views: 92
Er... this test is pointless unless you do it in multiplayer with 12 players in the game.

Even then, the test is pointless, lol...

timers are asynchronous
trigger sleep action is synchronous

you are going to lose accuracy from the trigger synchronization delay in TriggerSleepAction


Source: Me, I wrote Network, which is all about trigger synchronization. I know what I'm talking about :p
 
Level 5
Joined
May 6, 2013
Messages
125
Note that the main problem of waits is their accuracy with smaller steps. Do the same test with a wait time of 0.05 and watch it again. And then think what the difference will mean for sfx's where everything has to be timed exactly.
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
Er... this test is pointless unless you do it in multiplayer with 12 players in the game.

Even then, the test is pointless, lol...

timers are asynchronous
trigger sleep action is synchronous

you are going to lose accuracy from the trigger synchronization delay in TriggerSleepAction

not seeing your point :p
and this test map is only for: "what i sad above"
 
For a packet to go from you to the host back, it takes x amount of ms. This x amount of ms adds on to your TriggerSleepAction delay. The more players in the game and the more network traffic, the longer this delay will be. Warcraft 3 standard delay is 250 ms. This is why TriggerSleepAction can normally only go down to a minimum of like .24 seconds or so (240 ms).

If you are doing massive data synchronization in the game cache, then ur delay is going to be gigantic =) (1-5 minutes).
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
For a packet to go from you to the host back, it takes x amount of ms. This x amount of ms adds on to your TriggerSleepAction delay. The more players in the game and the more network traffic, the longer this delay will be. Warcraft 3 standard delay is 250 ms. This is why TriggerSleepAction can normally only go down to a minimum of like .24 seconds or so (240 ms).

If you are doing massive data synchronization in the game cache, then ur delay is going to be gigantic =) (1-5 minutes).

i read this information and i know it, the main and precise reason for this test map is to show that a "every 0.5 seconds of game time" event for ex will not fit a 0.9 wait for ex, cz the trigger (even turned off) will still launch every 0.5 s without doing anything...
Time = 1 s, wait started
Time = 1.00 first action (ON) of the loop trigger
Time = 1.5 second action (still the 0.9 wait is not passed)
Time = 1.9 wait should be stopped but
Time = 2.0 s the loop trigger will begin and will stop the wait with a 0.1 s retard
Those are examples
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
haha that is so weird timers should be much more accurate than that.. well in any case i guess waits are great for 1 player maps however since they pause the trigger for a certain period of time you need to use inaccurate timers for mui spells

They can be but the loop time should be very low at max of 0.05s
And i don't see the problem if they pause the trigger
 
Ya this is kinda pointless. Waits are less accurate than timers. Otherwise u would notice the difference when use spells with timers. spells with waits are horrible. i have a sell trigger in my map and that uses waits. when i tested it on single player it was noticeable but not enough to care about. but with multiplayer it was horrendous.

Anyways im pretty sure Nes knows what hes tlking about as he already stated he wrote Network, which is all about trigger synchronization. Plus he is really good at this stuff i would take his word at it.

Also not everyone has wc3 installed on this forum. So if u want more feedback u have to post triggers.
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
i read this information and i know it, the main and precise reason for this test map is to show that a "every 0.5 seconds of game time" event for ex will not fit a 0.9 wait for ex, cz the trigger (even turned off) will still launch every 0.5 s without doing anything...
Time = 1 s, wait started
Time = 1.00 first action (ON) of the loop trigger
Time = 1.5 second action (still the 0.9 wait is not passed)
Time = 1.9 wait should be stopped but
Time = 2.0 s the loop trigger will begin and will stop the wait with a 0.1 s retard
Those are examples

For all of you;
Change the objective i told you, the main objective is not to proove that waits are more accurate than timers but that the loop triggersis not always accurate if the value is not very low
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
You still didn't see my point, make yourself a test map where a loop trigger of 5s loop is turned off then turn it on on at for ex time = 4s the turning on (my point) of the trigger won't make it begin to loop, it loops from the begining of the game so basically:
Loop 5 s
Time 4s (turned on)
Time 9 s first action (terrribly wrong)
But time = 5/10 the trigger will be triggered
 
Status
Not open for further replies.
Top