On Jun 28, 2004, at 3:16 AM, Nick Lockwood wrote:
At the time, I was thinking of allowing the user to adjust the Timer
so that if it is choppy that they could at least make it less
irregular and unpredictable.
I've done something a bit like this with my game, but rather than
adjusting the rate at which the timer fires, the user can adjust the
number of times the engine goes round a tight loop before exiting
until the timer next fires. To be honest though this is a really ugly
hack and I hate it, I just don't see a better way of coping with the
fact that timer performance is dreadful, but tight loops can cause the
interface to freeze. In any case this approach requires a frame-rate
independent graphics engine.
What *would* be better than a timer adjustment is a control to adjust
the complexity of the graphics -- and I am working on that too.
Agreed
The way my timer is setup is to call the game loop once -- not multiple
times. The performance is really good.
Basically, the way a timer is suppose to operate is it will fire at or
after the time you specify in the period. If something else is going
on, then it will not fire until that task has completed.
If you are getting really slow performance with the timer, it is more
likely that your game loop is the cause -- optimize it a bit and you
should see better performance with the timer.
On the original PowerBook G4 500 MHz with a pitiful 8 MB ATi RageM3
video card, I am getting an average of 50 fps in a sprite based game
when I have the timer period set to 0 -- so effectively, my timer is
really firing every 20 ticks.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|