Benoit,
There are a couple of things you should note about timing in
Director. First
of all, timeout objects are *not* interruption events. This
means that they
will not always occur exactly when they should, just as soon
after as the
Director engine is able to. This means that if a timeout
event occurs just
as the screen is being updated between frames, or during
some other 'hard'
engine operation, you're out of luck. Only timeouts that
occur while Lingo
is executing will occur exactly when expected.
So, the question becomes, do you need fixed-intervals (ie.
constant rhythmic
like a clock?) -- or are you looking to cause events at
specific, but random
intervals? Because if the latter, Director is not the tool
you're looking
for.
A separate scenario is if you're just after doing sequenced
music, which is
another typical source of the want for rock-solid timing...
here, it's best
to use the new-fangled pre-spooling sound syntax where you
can 'prepare'
sounds to start playing ahead of time, to be triggered at a
precise ms.
If, however, you're looking to just have a solid framerate,
there are a
couple of things you can do to achieve that. First of all,
you'll want your
game's media assets to not be so heavy that the combined
duration of
redraw-time + script-execution-time can ever exceed your
framerate interval.
Next, make pretty damn sure that all your code executes
within the
prepareFrame event time. The only code that should ever go
on the exitFrame
event time, is "go to the frame". Many Lingo
jocks (including myself!) have
scratched their heads over why framerate was wobbly until
they figured out
that anything that is executed in the exitFrame event
actually *adds* to the
frame duration.
Then there are the things that you just plain can't
control. Director and
even projectors are second-rate citizens in modern OS'es at
best, so you'll
be subject to the whims of the OS. It may be that XP and
most previous
Windows versions let you get away with being the dominating
app, and hence
give you all the attention you need, but who's to say that
will go for VIsta
as well? It's certainly not the case on Mac OS X. There, if
some scheduled
event goes off in the background, like Entourage fetching
mail, that will
bring your projector to its knees. Simple as that. Sucks,
but there you go.
I hope I've helped your decision a little bit. Director is
still a kick-ass
tool, but like you, most of us have at some point wished
away all the 'bad
things' that mean we can't get strictly-timed events.
/Rasmus
On 31/03/06 0:39, "Benoit Martin"
<benoit808subs gmail.com> wrote:
> I am working on a game project where timing is very
critical to the game
> play.
> I need to keep my tempo's accuracy to a few
milliseconds. I started
> experimenting with timeout objects and other methods
using
> _system.milliseconds but I can't seem to get any
consistency in time
> intervals.
> I know there have been many threads about miliseconds
not being accurate but
> I need an honest opinion from people who had similar
experiences.
> Before I get too far along in the development and get
stuck, I am wondering
> if Director is the right choice. Are there methods to
keep up a tempo
> accurately to a few milliseconds?
>
> More info:
> Game will be a Windows Projector so it won't be ran
within a browser
> My testing was with basic looping with no logic but in
the final game, there
> will be animations and sounds playing
>
> Should I just go toward C++?
>
> thanks
> _______________________________________________
> dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
> http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
_______________________________________________
dirGames-L mailing list - dirGames-L nuttybar.drama.uga.edu
http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames
-l
|