Author Topic: Joystick response curves  (Read 35228 times)

0 Members and 1 Guest are viewing this topic.

Joystick response curves
Greetings and salutations.

A few months ago, I bought a new joystick and discovered that I don't feel very comfortable with the joystick response curve in FSO. After digging through old threads, I discovered there have been a few requests in the past for curve editing, or at least, alternative response curves. So I thought I'd make a few myself.

First of all, there are two existing response curves in FSO: The original (retail) curve and an alternative curve that was added by Wanderer in 2009. As far as I can tell, the new curve by Wanderer was only implemented in the Windows version, while the Linux version of the game used the original, retail curve.

I have now added, with the help of z64555 and HerraTohtori, 5 new joystick response curves, which give us a total of 7. This is a bit overkill. At least one of the curves is redundant, being simply a subset of the existing curves. What we've attempted to do is provide response curves that have different shapes from the existing ones. Both the existing curves were based on power functions, so we added an exponential, a sigmoidal and a "mixed" curve, which can act either as a positive power curve (Xn, n > 1), or a fractional one (Xn, 0 > n > 1).

The new (and old) curves are all neatly demonstrated in this wonderful markdown document on github. If no curve is specified, the game defaults to the retail curve. A joystick curve can be selected using a command line argument
Code: [Select]
-joystick_curves n where n is the number of the curve you want to use (see the glorious github document mentioned above).

The code is based on the Antipodes branch and can be found on my fork on github: joystick_curves branch.

Grab your builds here:
Windows / Debug
Linux / Debug


Would be nice to get some feedback on which curves feel better. I suspect that different joysticks or gamepads will have different preferences. I'm also accepting suggestions for other curves, if anyone has any ideas.
« Last Edit: May 03, 2014, 01:33:40 pm by Achilleas.k »

 
Re: Joystick response curves
Wow, thanks for putting this together!  I've actually been wondering about how the curves work in FSO recently.  I hope to put this to good use.

 

Offline GunHed

  • 22
Re: Joystick response curves
I keep getting "The program can't start start because SDL2.dll is missing from your computer. Try reinstalling the program to fix this problem." Am I doing something wrong?

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Joystick response curves
ive always been a fan of linear curves (and the graphs certainly help me find that). but the power curve 6 (or any of the j curves, 0,1,4) would give you more precision towards the middle which might improve aim. these curves seem like they would work best on joysticks that are fairly linear, such as sticks with the gimbals shafted directly to potentiometers. s-curves (2,3) are somewhat useful if you have a non-linear stick such as saitek or any form of gamepad. it would allow you to flatten out an other wise crooked curve. some gamepads are very weak near the center of their range and i guess thats where #5 comes into play. or anywhere where you need to overdrive towards center, of course higher sensitivity settings form a j curve. all in all, very good work. would be awesome to be able to select a curve in game though, because its going too take a lot of tweaking to find one that works for you.

I keep getting "The program can't start start because SDL2.dll is missing from your computer. Try reinstalling the program to fix this problem." Am I doing something wrong?

i take it this was based off antipodes. you need to install sdl, or at least find the dll and stick it in your fs2 directory. sdl2.dll comes with the antipodes builds so it might just be easier to download those and extract the dll.
« Last Edit: July 29, 2014, 10:00:37 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Joystick response curves
Yep, see this post for the builds Nuke mentioned.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline GunHed

  • 22
Re: Joystick response curves
OK I install sdl, how do I adjust the curve?

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Joystick response curves
I believe you use this command line argument:

Code: [Select]
-joystick_curves n

Where n is a number that corresponds to the curves described here: https://github.com/achilleas-k/fs2open.github.com/blob/joystick_curves/joy_curve_notes/new_curves.md
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: Joystick response curves
OK I install sdl, how do I adjust the curve?

In the wxLauncher, add -joystick_curves followed by a number in the "Custom Flags" box of the "Advanced Settings" tab. See the document linked in the first post for a description of what curve each number corresponds to and it is affected by the sensitivity setting.

EDIT: Redundant post on a 10 minute delay. My internet is being weird!

 

Offline GunHed

  • 22
Re: Joystick response curves
How do I to wxLauncher, it doesn't appear when I start the game.
 
Edit: nm I got to work and 3 works best for me i use the T flight hotas x, appreciate everybody who helped me.
« Last Edit: July 31, 2014, 07:32:24 pm by GunHed »

 
Re: Joystick response curves
Glad to see you got it working. Happy to see the alt. curves are getting some use! :)

 
Re: Joystick response curves
Would this need gui support before it could be merged in trunk?  If not, is there any instability issue that would preclude merging?

 
Re: Joystick response curves
I've been using it quite a bit and there are no instabilities (that I've seen). I can't really claim that I've tested all curves exhaustively. I can't say whether a GUI would be needed before adding it - I'll let the devs answer that.

The only reason for not merging is that it's hard to make clear what the flag does (which curve is which) without reading some documentation. Perhaps I could add a wiki entry for it (the descriptions are already written, anyway).

In a perfect world, it would be great to have a curve editor, where people can adjust their own curves however they want. That's where this idea started, but ended up getting simplified to a few common curves that can be switched. I don't expect something like that (a curve editor) to happen soon (at least, I don't think I'll be making it), so a few alternatives to switch between is the next best thing, in my opinion. The only thing I'm worried about is whether there are specific curves that are more appropriate for specific types of controllers (gamepads, different joystick types/brands, etc). It would be cool to be able to recommend to people what curve would give the best response given the controller they are using, but that would require testing each option for a while with each different controller type.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Joystick response curves
Perhaps have one of the curve options be to read a customizable curve from a file?  e.g., define your own custom curve if you know what you are doing.  Dunno if that would be hard to code or not but at least it would make it possible to swap good curves with other users of same / similar controllers.  I dunno, just an idea.

 
Re: Joystick response curves
I've been using it quite a bit and there are no instabilities (that I've seen). I can't really claim that I've tested all curves exhaustively. I can't say whether a GUI would be needed before adding it - I'll let the devs answer that.

The only reason for not merging is that it's hard to make clear what the flag does (which curve is which) without reading some documentation. Perhaps I could add a wiki entry for it (the descriptions are already written, anyway).

In a perfect world, it would be great to have a curve editor, where people can adjust their own curves however they want. That's where this idea started, but ended up getting simplified to a few common curves that can be switched. I don't expect something like that (a curve editor) to happen soon (at least, I don't think I'll be making it), so a few alternatives to switch between is the next best thing, in my opinion. The only thing I'm worried about is whether there are specific curves that are more appropriate for specific types of controllers (gamepads, different joystick types/brands, etc). It would be cool to be able to recommend to people what curve would give the best response given the controller they are using, but that would require testing each option for a while with each different controller type.


How about a dropdown in the settings gui with icons showing the curve, so even if you don't know exactly what each one might be ideal for different controllers, you at least get a visual representation and make make a semi-informed decision from that?  I'm pretty sure I've seen similar functionality in other games/sims using joysticks.

 
Re: Joystick response curves
How about a dropdown in the settings gui with icons showing the curve, so even if you don't know exactly what each one might be ideal for different controllers, you at least get a visual representation and make make a semi-informed decision from that?  I'm pretty sure I've seen similar functionality in other games/sims using joysticks.

That would be pretty cool, actually. Solves the issue of having to look up what each option represents and also makes the availability of different curves obvious to a player who hadn't considered it.

I've been thinking a bit about what jr2 said about custom curves. I'm too busy these days to implement user-defined response curves. The current curves are purely functional (response = f(input), where f is the curve function), but I've seen games which let you define the response sensitivity based on input bands/ranges. IL-2 comes to mind, which basically lets you draw your own curve using a series of sliders (see here).

First thing that comes to mind for implementing this is just shoving a sequence of numbers at the command line, or through a file and then populating a lookup table so that response = lotable[input_int]*input, where lotable would just be an array that holds the user-defined response values and input_int is some integer representation of the input percent (e.g., input_int = (int)(length(lotable)*input) --- I'm sure there's a better way to do this).


EDIT: Might give it a shot next month, when things are quieter work-wise.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Joystick response curves
lua defined curves perhaps. but i dont think games should make players do math. it would be more robust to pick a curve function from a gui and tweak its parameters. might also roll in deadzone and sensitivity adjustment as well. how are things on the in game interface overhaul front?
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
Re: Joystick response curves
lua defined curves perhaps. but i think it would be more robust to pick a curve function from a gui and tweak its parameters. games shouldn't make players do math.

There's no math involved for the user the way I described a user-defined curve. It's just sliders (see IL-2 screenshot). Any reference to math in my last post is just my thoughts on implementation details.

The current curves will remain as is; no need to remove them. I was just considering maybe adding a extra option that lets a user define a curve using sliders. If the devs are considering merging this into trunk, I'd suggest merging as is and we can see about user-defined options in the near future.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Joystick response curves
its also possible to swap math based curves with graph based curves. players edit the points on the graph to create their desired response curve. the game finds the nearest two graph points to the input and interpolates between them to find the output. each two points define a bezier curve and you can create both s and j cuves and linear gradients with them. you can also define dead zones with such a system. definitely considering something like that for my game engine.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Joystick response curves
Problem: Where is the interface for editing said curves?
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Joystick response curves
freespace still doesn't have a customizable interface? headdesk. maybe i shouldn't have stopped working on nukeui (an attempt at writing a gui class that runs in lua and makes use of freespace's lua graphics library).
« Last Edit: October 01, 2014, 05:45:51 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN