Hi,
ioQuake3 is an open source 3D shooter project that has recently moved to
SDL for handling input and such, but the problem is that jerky mouse
movement was introduced. For example, it’s highly noticable when moving
in circles, like around a column in a room.
In my test case, on Windows XP, I capped the game at 7 frames per
second, moved the mouse at a constant speed to the right (for that, I
used a script program called AutoIT3), and noted the relative movement
received from the event system.
When I only moved the mouse, I got continuous movement data (positive
relative x motion values for every frame): 13 13 13 14 13 13 13 14 13 13
13 14.
But when I held down a keyboard key, mouse movement was weird: 3 2 13 2
13 2 1 1 13 2 1 2 13 2 1 2 1 2 1 2 1 3 13 9 14 (key repeats were
disabled, so I still received exactly 1 mouse event per frame).
It seems that somehow, holding a key “chops down” some of the mouse motion.
I even moved the mouse by hand (while holding a keyboard key): 32 3 20
29 16 4 31 3 1 3 31 3 39 6 41 4 34 6 3 3 1 7 2 4 56 9 4 5 32 13 3 (some
minor y-axis movement omitted)
Finally, the jerk lowers as the FPS value increases, at 125 FPS it’s not
noticable: 2 1 2 1 2 1 2 1 2 2 1 2 1 2 1 2 1 2 1
The SDL version used by the game is not the latest one. So just today I
checked out the latest SDL-1.2, and tried to statically link that. I’m
not sure if I did everything correctly, I just packed a bunch of related
SDL .c files into the project, and some dinput8.lib and guid?.lib into
the build project. The in-game movement sensitivity changes as I change
the settings in the operating system, so the game isn’t getting the raw
data.
Previously (before SDL), the game had the option to natively use either
DirectInput or basic Win32 input methods, which worked. In both cases, I
could not reproduce the mouse jittering, which makes me think that SDL
is behind it.
Could some SDL expert please look at this issue? Thx!