duration 0.01 or 0.03

Status
Not open for further replies.
Level 4
Joined
Oct 19, 2010
Messages
71
Hello. Thanks for reading this post.
I was wondering if 0.03 duration might be faster than 0.01 for some reason. It looks like the duration is longer than .01 (maybe 0.1), and I seem to remember seeing a post that said 0.03 was 3 times faster than 0.01. I tried searching the forums but get no results when I search for 0.01 .01 even though I saw many posts with those numbers in them.
Thanks again.
 
Level 4
Joined
Oct 19, 2010
Messages
71
Maybe that's what they were referring to (doing something less frequently would be faster). The durations that I'm concerned with are durations for abilities (or maybe even buffs or effects). When I create abilities, sometimes I don't really want there to be a duration, but apparently 0 means it never ends.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Just like Maker, I advice you to use 0.03, certainly when it comes down to abilties.

For some buffs it is easer to calculate if you use every 0.20 or 0.25 seconds (I'm thinking about DPS), which has two advantages: you can easily calculate the damage per second (who wants to calculate with 33.3333, right? and it won't strain the game that much.
For DPS it is certainly enough to damage something 4-5 times a second

Abilities with moving missiles, knockback or something similar: 0.03.

Either way, every 0.01 secondsi s definitely faster (at a higher rate) than 0.03.
The game will run faster if you use every 0.03 seconds though (less strain, in case you've got a lot of triggers running at the same time it can really make a difference).
I hope this kinda covered it (although I just said what Maker said before, with more words).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Minimum wait time is 0.27 seconds.
It isn't, I have empirical proof of that, but I won't discuss this here as it is completely off-topic (hasn't got anything to do with timers).
The entire 0.27-second-wait is an urban legend, a myth (or else I have an uber-PC with a special version of warcraft with which I could get waits of 0.06 seconds).
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
I use 0.01 when I want to attach a unit to another unit by 'instantly move' trigger so that when they move together, you see the one sticking to the other. And if you use 0.03 or more you will see how it is 'teleported' to the other unit which would look bad. Unless this is the case you want to use with, use more than 0.01. Reason: less memory leak and less lag if the game gets too long.
 
Level 4
Joined
Oct 19, 2010
Messages
71
That's very helpful Maker and Apocolypse. Thank you so much for taking the time to help me. It's good to find this out now so I won't have to go back and change it later.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
0.01 is so fast it runs in subframe timing (or should if it keeps acurate). As such it will appear slower than it actually is cause it will update 100 times a second yet only display 60 different images during that time.

TriggerSleepAction is MUCH slower, with a minimum of 0.27 in singleplayer and much more in multiplayer. Sleeping for minutes in multiplayer can even result in large errors like being out by over a minute.

The smallest sensible value is 0.02 which will run 5/6 frames in a row while using half as many itterations per second as 0.01. 0.03 is advisable however because it still appears smooth to most people unless large distances are involved while consuming even less.

For very demanding code you may even have to go as low as 0.05 seconds.
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
I use 0.01 when I want to attach a unit to another unit by 'instantly move' trigger so that when they move together, you see the one sticking to the other. And if you use 0.03 or more you will see how it is 'teleported' to the other unit which would look bad. Unless this is the case you want to use with, use more than 0.01. Reason: less memory leak and less lag if the game gets too long.
But think about it.

Using 0.02 will reduce the memory usage to HALF and the difference CAN NOT be seen by the eye.

In most cases 0.03 cant be seen either. But 0.02 is just so much easier to calculate.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
.01 will be slower on most computers,

0.01 will use up more processor time on all computers than 0.02. Ultimatly you must remember that processors are farely sequential in their execution order and have a finite number of clock cycles per second to run instructions. Thus slowness is a reference to the quantity of time used to run a task/process (or trigger/timer in this case).

0.01 is still horriabley uadvisable in any case because most people run WC3 at 60 frames per second which would result in 40 wasted executions per second (ultimatly for perfect smooth movement you want it run on every frame). Running at 0.02 will result in 10 missed frames which is mostly smooth but results in no wasted time performing calculations that are undetectable to the human player.

For a summary....
0.01 = 40% wasted time
0.02 = 0% wasted time

If timers function to 3 decimal places (not too sure) then ultimatly the lowest possible time you will ever want to use is 0.016. This will update for every 60 frames per second while nearly having no wastage at all. Additionally the opposite can be done with rendering almost every frame but having no wastage at 0.017 seconds.

0.016 = 4% wasted time
0.017 = 0% wasted time

Wasted time refers to time spent executing the code that can not possibly have any effect noticable by the player.

Ofcourse for demanding systems you must raise the interval even more to atleast 0.03 to allow it all to be computed within a second without dropping frames.

Blizzard really should have added a "On engine update" even or system which would run every time the game engine updates itself (garunteed no wastage of time). This would also reduce timer abuse.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
But think about it.

Using 0.02 will reduce the memory usage to HALF and the difference CAN NOT be seen by the eye.

In most cases 0.03 cant be seen either. But 0.02 is just so much easier to calculate.
THe maximum FPS of warcraft is 64, every 0.01 seconds generates 100 changes a second, which is higher than the FPS of warcraft.
And it is very common for screens to have a refresh rate of 60Hz (Hertz = cycles per second, thus the screen will refresh 60 times a second, even lower than the 64 FPS).

All of a sudden 100x per second seems a bit of an overkill, no?
If you want something to happen really fast, then you should use 0.02 (50 FPS, which is 10 or 14 lower than the maximum FPS).
If you just want a fluid missile thingy, use 0.03 or 0.04 (33 and 25 fps, respectively), because missiles can be numerous and we demanding full power of a system is nearly never a good idea.

Edit: Argl, DSG was ahead of me
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
I think his question is how you make something go really fast. The fastest way is not to use the action wait, but the event "each x seconds do action".

In order to do this you need 2 triggers.
one Trigger to "Turn on Trigger 1"/"Turn off Trigger 1" and trigger one trigger with the event "each 0.01 seconds do action".

Lets name the trigger which has the "0.01" event and perhaps the effects or whatever you want to do each 0.01 seconds Trigger1
Lets name the trigger which turns Trigger1 on/off Trigger2

Now simply make the 3 actions in Trigger2
saying "Turn on Trigger1"
"Wait x Seconds"
"Turn off Trigger1"

By this you can control how many times Trigger1 will run since 0.01 x 100 = 1 Second so if we take that for an example, that you want Trigger1 to be runned 100 times, it would look like this:
"Turn on Trigger1"
"Wait 1 Second"
"Turn off Trigger1"

Hope that I helped you.
// Sverkerman creator of Bosses of Warcraft
_________________


"Give a man a fish and you feed him for a day, Teach a man to fish and you feed him, for a lifetime."
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I think his question is how you make something go really fast. The fastest way is not to use the action wait, but the event "each x seconds do action".

In order to do this you need 2 triggers.
one Trigger to "Turn on Trigger 1"/"Turn off Trigger 1" and trigger one trigger with the event "each 0.01 seconds do action".

Lets name the trigger which has the "0.01" event and perhaps the effects or whatever you want to do each 0.01 seconds Trigger1
Lets name the trigger which turns Trigger1 on/off Trigger2

Now simply make the 3 actions in Trigger2
saying "Turn on Trigger1"
"Wait x Seconds"
"Turn off Trigger1"

By this you can control how many times Trigger1 will run since 0.01 x 100 = 1 Second so if we take that for an example, that you want Trigger1 to be runned 100 times, it would look like this:
"Turn on Trigger1"
"Wait 1 Second"
"Turn off Trigger1"

Hope that I helped you.
// Sverkerman creator of Bosses of Warcraft

[Advertisement]

Hmh, I actually think his question was about every 0.01 second of game time versus every 0.03 seconds of game time.

Either way, this is incorrect:
By this you can control how many times Trigger1 will run since 0.01 x 100 = 1 Second so if we take that for an example, that you want Trigger1 to be runned 100 times, it would look like this:
"Turn on Trigger1"
"Wait 1 Second"
"Turn off Trigger1"
If you use every 0.01 seconds (as in your example, and as stated by many posts above is quite bad), the trigger will run 110-150 times, NOT 100 times.
Waits are very inaccurate and they always wait longer than you tell them to.

If you tell the game to wait 0.80 seconds, you'd be a lot closer to 100 cycles than with wait 1.00 second.
According to some testing I've done, the wait greatly varies if there are a lot of triggers runnig, but even if there is only 1 trigger running (1 every X seconds), it can still be 0.3 seconds off (with a minimum of 0.06 seconds wrong, so 1.00 seconds is 1.06-1.30 seconds if it is the only trigger running).

Basically: don't use waits (unless you really need them), don't use every 0.01 second (never).
 
Status
Not open for further replies.
Top