All we need now for Linux is retrace sync’ed flips. :-/
So, from what I gather, linux sucks for game development
Well, we still have fast OpenGL drivers, and some even seem to
implement retrace sync. Still, I have to agree to some extent, as I’m
coming from the PAL/NTSC hard-sync’ed, ultra smooth world of the Amiga,
C64 and co…
I mean, if
it can’t even give you the moment a synced flip can happen? Isn’t SDL
in some way solving this already for us, or is it really that
unpredictable with linux installations?
SDL can’t solve it, and probably shouldn’t even try. It’s a driver issue.
Sure, it’s possible to poll the retrace bit from within an application on
Linux (“just” be root and ask for permission to touch those ports
directly - which is a trick you can’t pull on Windows, AFAIK), but that’s
not exactly portable, reliable or nice.
Now I just have to find a driver that supports h/w pageflipping -
preferably with more than two pages. heh
Any suggestions for a G400 card? (I have a GeForce 2 GTS as well, if
that would be better for some mysterious reason, and some 32 MB ATI
Rage Pro card here at work…)
I really do not know much about Linux driver issues. I mean, any card
should be able to do h/w pageflipping these days, right? Or at least
emulate it in the drivers? Because then my solution would work also…
The problem is that remarkably few cards have retrace IRQs these days. It
seems like they rely on certain accelerator commands + some way of
blocking when on the command buffer. As the cards can only do real h/w
pageflipping this way, most Linux drivers are ruled out, as they don’t
support h/w pageflipping at all. heh
Even so, drivers that do support h/w pageflipping don’t implement retrace
sync for some reason. Either it’s some kind of general hostility towards
smooth animation among Linux driver hackers, or virtually all cards have
severely broken designs.
[…]
Is that assuming that the logic frame rate is also 10 Hz? Well, it
doesn’t have to be, but anything else will complicate the API a bit,
as any interpolator will need at least two sets of coordinates.
Either the application will have to tell the engine where a sprite is
going as well as when it’s supposed to be there - or the
interpolator will just have to wait and buffer at least two “move
commands” before even starting to move the sprite.
The 10 Hz above was just an example I used to illustrate my point. It
could be anything, ofcourse. And the linear interpolation is really
simple: Every sprite knows it’s former position and it’s position where
it should be in the next frame… So you got 2 (x,y) positions. All I
do is interpolate those two coordinates, nothing more, nothing less,
actually.
Exactly.
In the Spitfire Engine (Kobo Deluxe), I chose the easy way and simply
assumed that the game’s control system would deliver a constant rate
stream of coordinates for all objects, one set for every control
system frame. That way, I can use a simple interpolation algorithm,
mathematically equivalent to the linear interpolation your average
wavetable soft synth is doing.
What’s that with you and the softsynths
Dunno. Just can’t stay away from that kind of stuff!
Linear interpolation: Say
for 0.5 logics frame: (X + deltaX * 0.5), or: (X1+(X2-X1)*factor), same
for y. I hope that’s what you meant? If so, then yes, it is the simple
way.
Yeah.
The best part is that the control system callback of the game doesn’t
even have to be aware of the fact that there is interpolation. It just
assumes that the objects are like h/w sprites, and that the screen
refresh rate equals the control system frame rate.
I am calling the control system more often than the game logics
themselves. Works really nice, because it gives the user better
feedback when moving a mousepointer with the mouse etc. And it’s not
that processor-intensive anyway. This is also a tip I read from, I
guess it was a, Team 17 developer.
Ah! “Control System” in the above was meant as the whole fixed rate part
of the game, rather than user input.
Either way, I have a problem with the ridiculously low mouse update rates
usually seen on Windows, so I’m running the mouse crosshair in Kobo
Deluxe through the interpolation as well. It’s smooth, but I can’t play
with the mouse anyway, so I can’t really tell if it’s responsive
enough… (I prefer the keyboard, or a digital arcade joystick.
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Tuesday 12 March 2002 01:41, Martijn Melenhorst wrote: