HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

TriggerSleepAction: the dangers using it alone?

01-14-2006, 11:38 PM#1
Norbo
I've been searching on the forum and I've read that TriggerSleepAction() could cause desyncs because of lag.

I know that PolledWait() uses a timer in conjunction with TriggerSleepAction()
But, all I really want is a very short delay used for a loop without the overhead of PolledWait(). How much of a risk am I taking by using TriggerSleepAction()? Are there certain situations where TriggerSleepAction() is fine and some where it is not?

In my current situation, I would be using a short TriggerSleepAction() constantly.
01-14-2006, 11:43 PM#2
iNfraNe
TriggerSleepAction wont last shorter than polledwait. Minimum wait time is around.. 0.25 s (ithink). For shorter durations, avoid using triggersleep and use timers.
01-14-2006, 11:52 PM#3
Norbo
I realize that timers will give me much shorter, exact waits, but I don't need an exact wait, I only need a short one, about the length of a minimum TriggerSleepAction. I'm wondering though about the ramifications of using many TriggerSleepActions() in regards to desynchronization.
01-15-2006, 12:01 AM#4
iNfraNe
On short waits polledwait is the same as triggersleep in time. So dont use triggersleep.

I does desync, but only rarely on long waits when someone lags in between.
01-15-2006, 12:32 AM#5
shadow1500
Never heard of dysnchs with TriggerSleepAction, if a player lags then the wait should stop for all players until the lag is over.
01-15-2006, 12:49 AM#6
Vexorian
TriggerSleepAction doesn't have any direct relationship with desyncs or lag
01-15-2006, 03:05 AM#7
PitzerMike
Also for such a short wait I'd use TriggerSleepAction(0) instead of PolledWait, because polled wait just adds the overhead of a new temporary timer and internally still calls TriggerSleepAction.
01-15-2006, 07:43 AM#8
Anitarf
Quote:
Originally Posted by shadow1500
Never heard of dysnchs with TriggerSleepAction, if a player lags then the wait should stop for all players until the lag is over.
Well, it doesn't, that's why they made PolledWait. I remember earlier versions of my EoW map, if you got that "waiting for players" crap, your hero would revive a lot sooner because I used the regular wait.
01-15-2006, 09:24 AM#9
iNfraNe
Quote:
Originally Posted by PitzerMike
Also for such a short wait I'd use TriggerSleepAction(0) instead of PolledWait, because polled wait just adds the overhead of a new temporary timer and internally still calls TriggerSleepAction.
Thats true, but isnt triggersleepaction(0) about the same time as triggersleepaction(0.2) which means it doesnt make any difference at all which you use, besides that it doesnt wait if a player lags at that moment (which is.. rather unlikely but could happen)
01-15-2006, 10:42 AM#10
Blade.dk
By the way don't use regular PolledWait, it has a leak. Better fix the leak and then use it.