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

[Trigger] What are the dangers of using periodic .01 triggers?

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
In an attempt to smooth out the cameras and ship movement in my Star Wars dog-fighting map, I am considering replacing the .02 second periodic trigger with a .01 second periodic trigger for player ships at least. This means that every .01 second, I will move via SetUnitX; SetUnitY actions, up to 10 player ships.

Is this likely to cause problems when playing BNet?

Also, as the game is now I use a periodic .02 second trigger to move all AI ships, all lasers, all missiles and all capital ships. Would it be better to replace that trigger with a .01 second trigger that half of the time moves the lasers, and half of the time moves the ships? This way each laser and ship will move every .02 seconds, but the computer would split those calculations in half.

When I first started my map, people suggested that I shouldn't dip below .03 seconds for periodic triggers. I managed to do .02 without problems, but now I'm nervous.

Any advice would be appreciated.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
I don't know if you want to hear it but the answer is easy.
0.03 for triggered unit movement is low enough. If you got problems with stuttering they are caused by something else.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
0.03 is the highest amount that is still unnoticeable by the human eye... at leasy by most people.
Use it, as Ezekiel12 mentioned, for updating location, checking collision, anything that has direct effect to behavior.
Also use this to have as a loop amount for accurate timers.

For other things like updating the buffs of your custom aura and stuff, you are updating a state of a unit. (The bonus granted by the buff.)
For this, you can use a larger amount.
The most recommended amount is 0.5 but you can also use it up to 1 second if you are realy afraid of lagg.
 
Level 14
Joined
Aug 30, 2004
Messages
909
I'm not sure if I was clear, guys. I have been using .02 and want to make the repeater even faster at .01. I suppose I can just try it and see, but I'm worried about BNET performance and I can't really host or test that.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
But why do you want it to be faster?

Imagine how it actually works:

You see "something" happening.
"something" changes (+1)
"something" changes (+1)
You see "something" happening.
"something" changes (+1)
"something" changes (+1)
You see "something" happening.

Why do you want to make another "something" changes between it?

The rule in loops is that there is no interval allowed below 0.03
At least in WC3 that rule exist.

Lets go back to the example and you will notice that between your eye speed, the "something" has changed +2
So this will never be differnet:

You see "something" happening.
"something" changes (+2)
You see "something" happening.
"something" changes (+2)
You see "something" happening.

So dont go back to 0.01 but instead go forward to 0.03
 
Level 14
Joined
Aug 30, 2004
Messages
909
Hmm...you guys are making some reasonable points. I'm beginning to think making the movement trigger .01 wouldn't fix my problem.

The reason I'm asking is because my movement system will look kind of choppy around the edges. I've made a test map to illustrate my problem. I tried to fix it by setting the camera smoothing factor, but that hasn't worked:

http://www.hiveworkshop.com/forums/pastebin_data/u2ax47/_files/camera choppiness.w3x

The griffon will fly around just fine with the camera looked on him. The griffon looks really good and smooth, but if you stare at a grassy patch or a tree, it looks really choppy.

Now if you press the UP ARROW key, the camera smoothing factor will be set to 1. Now the tree and grass patch look smooth, but the flier looks awful. Press DOWN ARROW to switch back.

What I'm hoping for is a camera system that's smooth for both the ship and the terrain.

UPDATE: fixed link, sorry about that.
 
Last edited:
Well, 0.01 is risky when you don't know what you're doing (and it's triple the danger compared to 0.03).

Is this movement system involves movement similar to default behavior just a little altered with SetUnitLoc[icode=jass]/[icode=jass]SetUnitX/Y, then try http://www.hiveworkshop.com/forums/...?prev=search=Speed&d=list&r=20&u=Purgeandfire

Else, I can't download the test map (redirects to Forum Main Page), so I can't see the issue itself.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Well, 0.01 is risky when you don't know what you're doing (and it's triple the danger compared to 0.03).

Is this movement system involves movement similar to default behavior just a little altered with SetUnitLoc[icode=jass]/[icode=jass]SetUnitX/Y, then try http://www.hiveworkshop.com/forums/...?prev=search=Speed&d=list&r=20&u=Purgeandfire

Else, I can't download the test map (redirects to Forum Main Page), so I can't see the issue itself.

So sorry about the link. I've updated it (here again: http://www.hiveworkshop.com/forums/pastebin_data/u2ax47/_files/camera choppiness.w3x)

I think I know what I'm doing...in as much as I have released the map with the current movement system in play and everyone seems to like it (see my signature for a link to the real map). I'm just hoping to improve it a bit.

I've played around a bit with .01 repeated trigger and it might make it look a bit smoother, but I'm not sure...I get a headache staring at these things and I don't have people to play with on BNET. Regardless, there seems to be a fundamental tradeoff between having the camera show your unit smoothly and having the camera show the terrain panned smoothly.

I know I've taken up a lot of your time, but if you could take a look at the test map now that I've fixed the link I'd greatly appreciate it.

p.s. The movement system is GUI but uses JASS commands for SetUnitX and SetUnitY.
 
At higher speeds, there's no getting around the choppiness. I'd recommend panning the camera over time (as opposed to locking the unit), and to hide the unit's choppiness you could add a large SFX on the unit (afterburners or something) when the speed is above X.

The reason people say you shouldn't go below 0.03 is because that's the frequency at which the game updates frames. 0.01 is only necessary if you need a very high resolution on a collision system.
 
Level 14
Joined
Aug 30, 2004
Messages
909
The reason people say you shouldn't go below 0.03 is because that's the frequency at which the game updates frames. 0.01 is only necessary if you need a very high resolution on a collision system.


This makes so much sense of what other people were saying! Thanks.

The inevitability of choppiness is sad, but I suppose I can stop beating myself senseless trying to stop it. Thanks.
 
Status
Not open for further replies.
Top