Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

Post gaming related scripts
Otfbihhh
Posts: 7
Joined: 10 Jan 2018, 15:28

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 12:36

And when I press two buttons at the same time one end up getting stuck
Oliver
Posts: 27
Joined: 11 Jan 2018, 10:50

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 12:45

evilC wrote:@Oliver So you want a remapper that preserves your detente position?
That, Sir, is exactly what I need.
Otfbihhh
Posts: 7
Joined: 10 Jan 2018, 15:28

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 12:49

Yes they be getting stuck in the corners or sometimes on the left or down...and that's where I see that they get stuck at in.joy.cpl
User avatar
evilC
Posts: 4183
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 13:34

Oliver wrote:
evilC wrote:@Oliver So you want a remapper that preserves your detente position?
That, Sir, is exactly what I need.

It would be totally trivial to make a plugin with custom logic, we just need to work out the formula that dictates what the output should be, given an input value.
Oliver
Posts: 27
Joined: 11 Jan 2018, 10:50

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 13:40

So what formula are you looking for, the one that would plot the graph I posted? Because that one would need two inputs (X,Y). It would result in a line drawn from (0,0) to (X,Y) and from (X,Y) to (100,100).
User avatar
evilC
Posts: 4183
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 13:52

Well it does not need to be a mathematical formula, we just need to work out what parameters are required and what calculations to do with them.

As far as I can tell, we need 3 values:
1) The raw input value
2) The point of the physical detent
3) The point of the virtual detent

Although given these 3 values, I am not quite sure yet how you would end up with the correct answer.
User avatar
evilC
Posts: 4183
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 14:11

Think I have it...

Given your example where the input detent is at 80%, and the output detent is at 60%...

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by evilC on 11 Jan 2018, 14:17, edited 1 time in total.
Oliver
Posts: 27
Joined: 11 Jan 2018, 10:50

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 14:22

Aight, where do I put that stuff to test it?

I take it the 'curves' are linear up to the detent point as well as from the detent point to (100%,100%)?
Helgef
Posts: 2992
Joined: 17 Jul 2016, 01:02
Contact:

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 14:28

I didn't follow the disscusion, but this graph clearly is,

Code: [Select all] [Download] GeSHi © Codebox Plus

f(x){
static breakPoint := ?
if (x < breakPoint )
return x
return 2*x
}
Oliver
Posts: 27
Joined: 11 Jan 2018, 10:50

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 14:33

Ehm... Sorry, but I don't think so.

For starters, your formula says if X < breakpoint, then y = x. So let's take my graph, breakpoint is at X = 80 and Y = 60. With your formula, X = 80 would yield Y = 80...

If I read your formula correctly it basically says: before the breakpoint Y = X, after the breakpoint Y = x2. While my example graph may look like that, the formula doesn't support the flexibility of moving the breakpoint to an X-coord and Y-coord of my choice.
Helgef
Posts: 2992
Joined: 17 Jul 2016, 01:02
Contact:

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 14:41

Yes, clearly my eyes were crossed. You should return x*8/7 before the breakpoint as it seems.
User avatar
evilC
Posts: 4183
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 15:07

Oliver wrote:Aight, where do I put that stuff to test it?


That is a standalone script, not part of UCR. It was just meant to allow us to test proposed logic.
It's just a form with an editbox - you type in the input value and it displays the output value as a tooltip
Just tryin' to work out the calculations that need to be done and the best way to implement them in AHK code. Once we know what code we need, I can quickly whip up a plugin.
Oliver
Posts: 27
Joined: 11 Jan 2018, 10:50

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 15:33

That's fair. In any case, isn't it easier to just have the user defined X breakpoint and Y breakpoint as percentage of Xmax and Ymax? Formula for a linear line before the breakpoint as well as after the breakpoint would be:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


This is basically the formula for a linear line: Slope Coefficient = ( deltaY / deltaX ) but it generates a slope coefficient for the linear line before the breakpoint and one for the linear line after the breakpoint.
StrikeEagleCC
Posts: 1
Joined: 11 Jan 2018, 16:48

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 17:20

Thanks evilC, for the work on UJR and now UCR. Fantastic utilities.

There was one feature in UJR that I have been unable to replicate in UCR: the "Rests L"/"Rests H" selections in the special operations drop-down for mapped axis. Is there another way to apply a deadzone to the ends of a range in UCR?

An additional feature that would be welcome would be multiple deadzone adjustments for a single axis. Perhaps this could be implimented with a plugin dedicated to applying deadzones to previously mapped axes, and include deadzone setting for range extents, and also separate deadzone settings for either side of center.

In the meantime, I will continue to use UJR, which works great, but lacks the axis range to button mapping.
User avatar
evilC
Posts: 4183
Joined: 27 Feb 2014, 12:30

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 17:32

In UCR, all axes are get/set in the range 0..100, so it makes life simpler.

So, to make the plugin, all you do is this:

Copy Plugins\Core\AxisToAxis.ahk to the Plugins\User folder
Rename it to AxisToAxisDetent.ahk
Edit it in a text editor, change the first couple of lines, wherever it says AxisToAxis, replace with AxisToAxisDetent (The class name MUST match the file name, the descriptions, not so important)

Then for now I just added a little extra code in two places - the end of Init(), and the end of MyInputChangedState().
In both instances, where I added extra stuff I put some comments like ; Detent Mod Start / End

For now you can set the breakpoint values in the code, but if all works well I will rig up guicontrols to do it. We can probably lose the sensitivity / deadzone as well, that makes no real sense in this scenario

Code: [Select all] [Expand] [Download] (AxisToAxisDetent.ahk)GeSHi © Codebox Plus

Helgef
Posts: 2992
Joined: 17 Jul 2016, 01:02
Contact:

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 17:39

Hello again.
the formula doesn't support the flexibility of moving the breakpoint to an X-coord and Y-coord of my choice.

For an arbitrary amount of arbitrary breakpoints,

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Input for segmentsFromPoints(startPoint, breakPoint1,...,breakPointN, endPoint). Points are defined as [x, y]. You call segmentsFromPoints once per setup. Then you get y := f(x, segs) for every x.
line.png
(53.97 KiB) Not downloaded yet

The top image is segs := segmentsFromPoints([0,20],[30,80], [50,40], [60,70], [100,100]). The bottom image is segs := segmentsFromPoints([0,0], [80,70], [100,110]).
Image credis: SVGraph.ahk.

Cheers.
Oliver
Posts: 27
Joined: 11 Jan 2018, 10:50

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 18:08

@ evilC

I'm assuming LowFactor is the slope factor for when X <= Xbreakpoint and HighFactor is the slope factor for when X > Xbreakpoint.

The formula seems to work for Xbreakpoint = Ybreakpoint which makes sense as that would result in Ybreakpoint / Xbreakpoint = 1. This yields a linear translation.

However, for different values of Xbp and Ybp something is not quite right. I'm trying to figure out what you're attempting to do when the HighFactor should be used but I'm currently not following that and cannot relate it to my formula. I'll try again tomorrow with a fresh brain (midnight here).

PS - Your response to user input/requests is awesome!
Oliver
Posts: 27
Joined: 11 Jan 2018, 10:50

Re: Universal Control Remapper (UCR) - v0.1.19 26th Dec 2017

11 Jan 2018, 18:14

Oh fuck me!

It seems for both my physical throttle axes as well as the vJoy sliders, sliders down/idle = 100, sliders maxed = 0. So the values for InDetent and OutDetent have to be '100 - desired percentage' instead of 'desired percentage'.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 4 guests