[freespace2] joystick/mouse turning speed patch

Jonas Laurio digitalsin at adelphia.net
Sun Apr 24 17:32:36 EDT 2005


Taylor Richards wrote:

>On Sun, 2005-04-24 at 13:39 +0200, Geller Sandor wrote:
>  
>
>>axis 0 between 10000 and 63000
>>axis 1 between 5600 and 57000
>>axis 2 between 14500 and 57000
>>axis 3 between 9800 and 50700
>>
>>I don't know what is wrong (the joystick hw, the kernel USB or input
>>layer, the adi driver, ...).
>>    
>>
>
>I've been trying to think where I've heard a similar problem before but
>I haven't so far.  I want to say that there was some calibration trick
>to do before running a (the) game and that would fix it.  If I can
>remember where I saw that I'll get you a link but you'd probably be able
>to find something with a good google search too.  I do think it was
>something with that particular joystick though.
>
>I'm currently working on a slight overhaul of the joystick code in the
>game.  It's so slow that it will knock 15-30 off of the FPS so a fix is
>long time coming.  That's mainly for buttons though and I've got that
>fixed (not in CVS) but need to redo the axis stuff too.  It wouldn't
>really help with your situation obviously, but related fixes are coming
>to CVS shortly so it might help some.
>
>
>Taylor
>
>  
>
@ Geller:
This is a common problem with joysticks AFAIK, where the joystick does 
not actually use the expected entire range of motion. What usually works 
IMHO, is to just lop-off the extreme lower and higher ends of the range 
- hence a lot of people just use a lower range i.e. 32768 or whatever.

What O.S. are you using - Linux? You have 4 axis, so is it an analog 
joystick? If both are yes, have you tried calibrating the joystick (i.e. 
with jscal)?

@ Taylor:
Does the code currently just use the same turning speed ratio at all 
times for joystick? I'd be surprised if it does, but I don't think this 
works very well for the reasons in my previous email to the list (more 
speed = less precision, and vice versa). What I've seen personally is 
two options:
A) Upon axis change, speed of turning increases slowly up to a point 
(point of max accel)
B) Axis range is split furthur into another [half] range, with most 
extreme ends being used as 'accel to max speed rate of turning' (and 
leave low-mid of ranges as 'just turn now, but at reduced speed').

Solution ``A'' works for both digital and analog joysticks/gamepads, but 
``B'' only works for analog. Sometimes (if you want to go all-out) both 
are implemented along with a toggle switch. For example solution ``A'' 
is the default and an option 'Joystick is Analog' is implemented so, 
when enabled, prog switches to ``B'' implementation.

Maybe I'm just being daft heh...





More information about the freespace2 mailing list