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

Re: Direction of Linux games...




On 18-Nov-99 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.
> 
> You could use the microsecond time functions to generate a usleep of nearly
> the
> right length each frame, buuuuut.. usleep isn't accurate.
> 
> The actual solution without re-doing the physics is hard... essentially in
> each
> 75Hz frame you have to do 4/5 of what you'd do in a 60Hz frame and all the
> timing will get screwed up.


no it's not, just add a delta time multiplier to all translations, rotations,
inputs, etc. It's really easy to make games independant of system speed, and
pretty easy to convert games that aren't built right...

I would have figured everyone knew how to do this, but to yeild this much
discussion, I guess not? If anyone wants, I can write up a tutorial on making
programs apperant speed independant of system speed (barring framerate
comparisions). Should only take an hour or two, and I'll have time this
weekend? lemme know

        -Erik <br0ke@math.smsu.edu> [http://math.smsu.edu/~br0ke]

The opinions expressed by me are not necessarily opinions. In all
probability, they are random rambling, and to be ignored. Failure to ignore
may result in severe boredom or confusion. Shake well before opening. Keep
Refrigerated.