True second for TimerInterval?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
lexdr
Posts: 108
Joined: Thu Dec 26, 2013 3:29 pm
Location: France

True second for TimerInterval?

Post by lexdr »

Interval for timer should be in seconds:

Code: Select all

Timer:setTimerInterval(interval)
Sets the timer interval in seconds.
However, some simple tests reveal on my computer that 1 second in TimerInterval corresponds to two true seconds.
Is there a problem on my computer or did I missed something?
lexdr
Posts: 108
Joined: Thu Dec 26, 2013 3:29 pm
Location: France

Re: True second for TimerInterval?

Post by lexdr »

Actually, I was testing akroma222's magic shield spells and the author said:
I find the spells stay in effect for roughly twice as long as the time I have set them to... or maybe that is just my warped sense of time?
So that it might be a side effect of casting?!
User avatar
DesperateGames
Posts: 90
Joined: Sun Oct 06, 2013 1:54 pm

Re: True second for TimerInterval?

Post by DesperateGames »

Normally the timer Interval should be the same as entered (and now comes the big surprise) as long as the timer is on the same level as the party is currently on. This issue is discussed a bit further down in the thread you have linked in your post:
Just a quick note here on time... if the timers are on the same level as the party, they are updated every second, however if they are 1 level above or below they are done on alternate seconds (making timers last twice as long!).. higher or lower than that and they are done on an as and when basis.
For that reason, for any timed spells, I have been spawning the timers on the party level at the moment the spells are cast and destroying them... this reduces the chance that the timer will be on a different level of the dungeon than the party. (still open to abuse if players cast spells and then deliberately change levels, but without a lot of extra coding to move timers between levels, that's hard to fix)
lexdr
Posts: 108
Joined: Thu Dec 26, 2013 3:29 pm
Location: France

Re: True second for TimerInterval?

Post by lexdr »

Oh I've missed that. :?
Thank you DesperateGames.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: True second for TimerInterval?

Post by Komag »

I highly recommend setting up a universal timer system, one main timer on each level, and just tie into it for anything like this along the way.
Finished Dungeons - complete mods to play
lexdr
Posts: 108
Joined: Thu Dec 26, 2013 3:29 pm
Location: France

Re: True second for TimerInterval?

Post by lexdr »

Thank you for your recommendation. :)
Is it based on effectiveness measurement (less cpu consuming that spawning temporary timers for example) or for ease of use?
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: True second for TimerInterval?

Post by Komag »

Definitely ease of use, and possible efficiency. For any decent dungeon you'll need timers a lot, and if you constantly spawn or set up new ones when you could just tie into a single master set then you'll be creating needless complexity.
Finished Dungeons - complete mods to play
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: True second for TimerInterval?

Post by Isaac »

What about spawning a timer with the party each time the arrive on a new floor, or return to the previous one?

Yes I certainly remember experimenting with a ''feather-fall" effect that relied on the default timers, and discovering that as I increased the number of floors the party fell through, I had increased inaccuracy of the timer I was using... One can assume it's not the timer per se, but that all processing is likely fractionated on the other floors in both directions; and likely further so on the floors beyond the immediate neighboring ones.

There is always getStatistic('play_time').
Post Reply