Skip to content

Customizable output curve functionality with a graphical web app to draw the output curve

Ryochan7 requested to merge github/fork/mika-n/jay-bezierCurveOutput into jay

Created by: mika-n

New customizable (and graphically drawn) output curve for LS/RS/L2/R2/SX/SA analog axis.

User can create any kind of output curves via an external HTML web app (see BezierCurveEditor subfolder in DS4Windows executable folder). Once the graphical curve in the editor looks OK then the "bezier curve definition" (list of 4 decimal numbers) string value can be copied to DS4Windows app.

NOTE!: GUI doesn't have an edit field for this definition string value, yet. For now the value needs to be copy-pasted directly into a profile XML file (powered by Notepad). However, curve output needs to be set to a new "Custom" value in GUI.

In practice those old pre-defiend curves are also calculated using this new bezier curve functionality. Curve definition of those existing curves (Enchanced Precision, Cubic and so on) are just set to certain curve value to make the curve to match with the old implementation as close as possible. The graphical web app shows these DS4Windows default curves also.

BezierCurveEditor/index.html web app shows a graphical tool to draw the curve interactively. It also visualizes the "axis movement" (input vs output) to highlight how fast or slow the the output curve would be.

Technically this new feature also makes the output curve calculation super fast during a gamepad poll because the result is taken directly from a lookup table (axis raw input as index key to lookup table and a value as a re-mapped output value). The lookup table is calculated using the bezier functions only when a curve is changed (ie. normally when a profile is loaded).

DS4Win_BezierCurveOutput1

DS4Win_BezierCurveOutput2

@ryochan7 What do you think? Is this something which could be included in DS4Win master branch? If this looks OK then I can finalize the implementation (field to enter the custom curve definition in GUI and a web link from DS4Windows Output Curve tabpage to the graphical curve editor and providing the existing curve definition as default value to the editor).

Merge request reports