[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Direction of Linux games...



Keith Lucas wrote:

> >Can't someone just shove a usleep() in there, for heaven's sake? Will
> >not make it properly done, but will make it *run* properly at least
> >(what? being penalized because I have a better computer/video card? I
> >don't even have a friggin' Turbo button!)...
> 
> You could do it by timing a couple of frames & working out how much to
> usleep, but the problem is that it will add a constant delay to each frame,
> which could cause currently borderline frame render times (plus the delay)
> to break frame where they shouldn't. Plus the issue is that you'd have to
> drop to the common factor of the frame-rates: which is 15fps. Not that good.
> This actually saves you slightly from the frame-break issue, because the
> actual frame boundaries can occur on the granualarity of the refresh
> sequence. But 15fps physics would probably be noticeable. And anyway, I wunt
> be happy getting the same performance out of my 120MHz/Voodoo1 machine as
> out of my 400MHz/VoodooII one.

He said 60 Hz refresh rate, so I assume 60 fps (or maybe I'm slipping
and it should be 30 fps? whatever, if you do it wrong, you'll notice and
it'll be easy to fix).

I didn't say adding a constant delay to every frame, but only "padding"
each frame to make the whole thing (not just the physics or just the
frame rate) go to 60 fps max. To hell for people with slower computer
(it won't be slower, as the computed padding will always be zero). I
think usleep() is good enough for that kind of padding. If you're a
nitpicker, you can always make this a busy-wait loop that gettimeofday()
like crazy. I suggest stuffing a "sleep(0);" in the loop, to ease the
load on the CPU.

I *did* say this is NOT doing it properly, this is only making it
playable for people with dual Pentium III 700 with Voodoo3.

Having the game go too fast because of having a good computer is so
dumb, so passé, so 80's, whatever you want to put it... :-)

-- 
Pierre Phaneuf
Ludus Design, http://ludusdesign.com/
"First they ignore you. Then they laugh at you.
Then they fight you. Then you win." -- Gandhi