realbasic-games
[Top] [All Lists]

Re: Timer Precedence (Using Multiple Timers)

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Timer Precedence (Using Multiple Timers)
From: Phil Mobley <phil at mobleybros dot com>
Date: Mon, 28 Jun 2004 08:36:56 -0700
Delivered-to: realbasic-games at lists dot realsoftware dot com
List-help: <mailto:realbasic-games-request@lists.realsoftware.com?subject=help>
List-id: REALbasic Games <realbasic-games.lists.realsoftware.com>
List-post: <mailto:realbasic-games@lists.realsoftware.com>
References: <02BC7581-BFE7-11D8-9248-000A95EED9D2 at comcast dot net> <0CE5AACD-BFEA-11D8-829B-000393101B4A at mobleybros dot com> <D8B94EFE-BFF1-11D8-BBD2-000A95CDD7B0 at charcoaldesign dot co dot uk> <6778211C-C074-11D8-829B-000393101B4A at mobleybros dot com> <3C8359BA-C8EC-11D8-9DB0-000A95CDD7B0 at charcoaldesign dot co dot uk>
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>

<Prev in Thread] Current Thread [Next in Thread>