Joystick sensitivity toggle

Make suggestions for improving one of the best games on the net!
Post Reply
User avatar
Workaphobia
Master Sergeant
Master Sergeant
Posts: 252
Joined: Wed May 26, 2004 7:29 pm

Joystick sensitivity toggle

Post by Workaphobia »

I've found problems with each of the three input devices I've tried so far in my bzflag career. The keyboard gave me speedy reactions at the steep price of accuracy and dexterity. However it does have the slowdown key (A) to make climbing platforms slightly easier, and automatically reduces your turning rate when using binoculars. The mouse allowed for more accurate motion, but I found it very difficult to move since my speed depends on the absolute position of the cursor, rather than a relative motion (this is not a problem with bzflag so much as a general drawback to using the mouse). Also, it was much more difficult to aim when in binocular mode, since there was no turning rate adjustment.

Right now I'm using my new gamepad, and for the most part I'm happy with the way bzflag handles, with two exceptions: I still cannot aim with binoculars, and I can't always reach platforms from an arbitrary location, instead overjumping or underjumping by ridiculous amounts. Both of these problems stem from the fact that it's difficult to utilize the lower ranges of motion effectively. If I move the stick a quarter to the right and jump for example, I may end up having turned 30 degrees. Half way may make it 120, and three quarters may be 160ish.


I would like to see two features added.

1: It'd be great if there was an option to extend the slowdown toggle key from the keyboard to all forms of directional input. (I personally would map this effect to a spare gamepad button of course.)

2: I'm not sure if this would help but it might be something to experiment with. Maybe we should change the way bzflag weighs analog input, using some sort of filtering curve. I'm talking about a function applied to the input value to smooth it out a bit when closer to the neutral position, like a sine or polynomial graph. Does anyone understand what I mean here?
"Nifty News Fifty: When news breaks, we give you the pieces."
User avatar
Workaphobia
Master Sergeant
Master Sergeant
Posts: 252
Joined: Wed May 26, 2004 7:29 pm

Post by Workaphobia »

This is awesome! I just started playing with the source code recently, and tonight I managed to implement part two of my last post. I found that bzflag already uses a quadradic function for the joystick, which may be better than linear, but still proved kind of jerky in the lower range. I managed to expand this.. this forgotten spectrum of motion, by replacing it with a fourth-degree polynomial with a horizontal inflection point in the middle -

er.. I mean.. I fixed it to my liking. If anyone wants to see my overly complicated (that is, more math than necessary, but short) solution to what can probably be done in one line of code, PM me. I might release it as a sourceforge patch if anyone likes it.

By the way, the file that controls all of this is ./src/platform/SDLJoystick.cxx
"Nifty News Fifty: When news breaks, we give you the pieces."
Post Reply