[gameprogrammer] Re: Fixed Rate Logic

  • From: David Olofson <david@xxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Thu, 7 Dec 2006 01:50:22 +0100

On Thursday 07 December 2006 01:30, Alan Wolfe wrote:
[...]
> Doh!
> 
> oh man, end of the day lul made me brain dead...or your just really
> smart. 
> 
> thanks, that would indeed keep things from locking up while still
> updating everything necesary.

Nothing should lock up unless you set something to fire ever 0 ms or 
something... Keep in mind that we always have this timestamp > now 
stop condition, that will break any "feedback loops" as soon as they 
try to run beyond the current frame.

Are you perhaps thinking about the infinite "mutual redraw recursion" 
that's easy to get in GUI toolkits when trying to implement smart 
refresh? :-)


> how about this then...
> 
> lets say you have an event that's meant to fire every 1ms (yeah
> overkill but stay with me on this one) and lets say it was last
> scheduled to fire at 1050 miliseconds and then it ran and when it
> was 
> finished, and it's time to go back into the queue while the current
> time is 1070 miliseconds it seems like the "most right" thing to do
> would be to put it in at 1051 miliseconds (this is an extreme case
> of 
> course) but logically it seems better, if not less realistic to put
> it at 1071.
> 
> What do you guys think?

Well, it depends on what the event is actually supposed to do, but if 
it's some weapon firing at 1000 rounds per second, considering 
current time in the event handler would be a plain bug. The firing 
rate is really supposed to be 1000 RPS, regardless of the rendering 
frame rate - that's the whole point of using fixed rate logic in the 
first place. :-)

Try killing lopers with the Venom Gun in RTCW while restricting the 
frame rate to say 20 fps or so, and you'll see what I mean... ;-)


//David Olofson - Programmer, Composer, Open Source Advocate

.-------  http://olofson.net - Games, SDL examples  -------.
|        http://zeespace.net - 2.5D rendering engine       |
|       http://audiality.org - Music/audio engine          |
|     http://eel.olofson.net - Real time scripting         |
'--  http://www.reologica.se - Rheology instrumentation  --'

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: