i have recently modded a ps5 controller so that i have a anlog stick soldered to a arduino and then the arduino has a duel channel digi pot outputing analog values to the controllers right stick, so that i can code custom response curves, deadzones, anti deadzones and stuff like that.
but one thing i need to do is convert what i think is a sigmoid curve applyed in game to a linear response on the arduinos side.
i have had succsess removing power curves and exponential curves and have been asking various ai chat things how i might counter a sigmoid curve in game but it never works the way i intend it, usually just making the stick go all over the place but will have small sections in the sticks travel where it behaves as you would think.
basically i am asking how you might counter the in game sigmoid curve from the arduino/controllers side bearing in mind each axis on the right stick has a range going from -125.5 to 125, 0 being the center, or if you know a better place to ask this question i am all ears
if you imagine the point where the red and blue line cross as zero, that's what i think the game is applying, probably more like the red though.
im sorry if that answer seems off i am not to familiar with actuall math side of these graphs or the curves them selfs and only know them as is relevant to analog stick aim, i am thinking of a -1 to 1 x and y grid where the point where those two lines meet would be 0
Have a look at multimap, which does a non linear mapping using two tables of values.
yes it is an approximation, and you can improve accuracy by adding points.
More points is also slower due to searching of the right interval.
Above ~20 points binary search is faster, you can use MultiMapBS
It seems to me that the shape of the curve is not important - the main thing is that you need to shift the graph down along the y-axis so that the intersection point of the graph with the coordinates is at the 0,0 point.
sorry, the analog stick is just a small joy or flight stick you would use with your thumb it has 2 potentiometers, 1 for left and right and 1 for up and down.
these pots generally come with a linear response curve from the factory and this value is the initial value you would get from the game pad in the game engine that the game was made in and each pot is usually represented as a value going from -1 to 1, -1 being full left on the stick, 1 being full right on the stick for the x axis.
games will often apply different response curves to the analog sticks to try to make it easier to aim the in game camera, but there is no standardized way that game devs will code this, meaning that it is different from game to game and its actually kind of rare that they will get it right.
what i mean by countering the sigmoid curve is converting the sigmoid back to linear
the game in question i am pretty sure has a sigmoid curve applied to the right stick, witch is coded in the game engine,
i want to convert the analog sticks sigmoid response curve that is applied in game from the arduino and digi pot i have modded my controller with
i dont really understand alot about these functions and only know enough of the mathy symbols to get a extremely basic idea of what the function is doing.
so i dont know exactly what your asking, i have a example of a typical sigmoid function and a example of a inverse sigmoid function but i dont know how to paste them here in a way they are readable
this is the inverse sigmoid in code,
-log((1.0 / y) - 1.0) / k;
but it does not scale properly across the sticks range
i need to apply this function to ether both the myX and myY variables in the code above or to the r_out variable in the code above but that inverseSigmoid() function does not give the desired effect whether it is applied to the individual x and y axis or the r_out
Trying to interpret your words (actually trying to mind read) ... I'm guessing you want the first plots you presented to pass through the origin and run from -1 to -1 on both axes. So the equation you presented needs to be scaled and shifted:
That plots as:
A little High School Algebra produces the inverse function (what I think you want):
That plots as:
Note that Eq 1 only approaches +/-1 asymptotically. So you'll want to clip the input (y) value to Eq 2 so that:
Haha, that's cut from Desmos | Graphing Calculator where I put x into the forward function H and that result of that into the inverse function H^(-1) that you showed in pictures.