Creating a sensitivity curve for an analogue stick?

GPC2 script programming for Titan Two. Code examples, questions, requests.

Creating a sensitivity curve for an analogue stick?

Postby Colour Magician » Mon Mar 30, 2020 9:52 am

I have 0 idea how to actually do this; I'm trying to find a way to adjust the sensitivity of the right analogue stick in the same way that I'd be able to adjust the sensitivity curve for a mouse using an input translator. Through the ReWASD program on PC I'm able to adjust the curve on the analogue stick, but I cannot find any way to replicate this effect through the Titan Two yet?

If anyone can help, it would be extremely appreciated, moreover if anyone knows how, this is the curve I'm trying to recreate on the Titan Two -
aimadjust (2).png
aimadjust (2).png (6.84 KiB) Viewed 2766 times


I'm also trying to recreate new aiming zones in a similar way and have 0 idea how to do that as well, trying to adjust it like this -
aimadjust (3).png
aimadjust (3).png (88.75 KiB) Viewed 2766 times


Really, any help here is appreciated as I cannot get the analogue sticks to become more responsive on console.

Thank you in advance :smile0201:
User avatar
Colour Magician
Sergeant
Sergeant
 
Posts: 7
Joined: Sat Nov 17, 2018 9:57 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby J2Kbr » Fri Apr 03, 2020 8:25 am

Please create the wanted sensitivity curve using the Input Translator interface. In the X axis you have the controller input, and in the Y axis the wanted output value. After that click on the copy icon (blue arrow point up) and paste here. It will be something like this:
Code: Select all
GIVMXYF:FF028C014C00301659165900F2000010781AA8234A29912F0F32FA36E63A0A3C633EBD411942A8443A45CC475E48F04A824B4A4C144DA3

I will then use this data to make a GPC script for the right stick custom sensitivity response curve. :smile0517:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby Colour Magician » Mon Apr 06, 2020 3:18 pm

You're seriously the best! Thank you so much for this! :smile0202:

I'm not 100% sure which of these is correct, because I'm unsure where to start 0 from, so I have two guesses, I think it's this:
Code: Select all
GIVMXYF:FF010001000002000000000100191A1B1C1D1E1F202124272A2D2F32353840495264


But if 0 has to be at 0 on both axis, then I think it's this:
Code: Select all
GIVMXYF:FF010001000000000000000100001A1B1C1D1E1F202124272A2D2F32353840495264


If 0 doesn't have to be on both at the same time, then totally ignore that second one I guess, I really have no idea how this all works :unsure:

Again, THANK YOU, so much for taking the time to do this, you're the true best :smile0203:
User avatar
Colour Magician
Sergeant
Sergeant
 
Posts: 7
Joined: Sat Nov 17, 2018 9:57 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby J2Kbr » Tue Apr 07, 2020 9:16 am

Thanks, here is the script:
Code: Select all
main {
    set_val(STICK_1_X, stick_response(STICK_1_X));
    set_val(STICK_1_Y, stick_response(STICK_1_Y));
}
 
fix32 stick_response(uint8 idx) {
    const uint8 base[] = {
        0x00, 0x05, 0x0A, 0x0F, 0x14, 0x19, 0x1E, 0x23, 0x28, 0x2D, 0x32, 0x37,
        0x3C, 0x41, 0x46, 0x4B, 0x50, 0x55, 0x5A, 0x5F, 0x64
    };
    const uint8 cc[] = {
        0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x24, 0x27, 0x2A,
        0x2D, 0x2F, 0x32, 0x35, 0x38, 0x40, 0x49, 0x52, 0x64
    };
 
    fix32 value = get_actual(idx);
    fix32 signal = (value >= 0.0 ? 1.0 : -1.0);
    value = abs(value);
 
    uint8 i = min((uint8)value / 5, 19);
    value = lerp((fix32)cc[i], (fix32)cc[i+1], (value - (fix32)base[i]) / 5.0);
 
    return(value * signal);
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby Colour Magician » Tue Apr 07, 2020 7:48 pm

I just tried it and it works PERFECTLY, Thank You. so much.
User avatar
Colour Magician
Sergeant
Sergeant
 
Posts: 7
Joined: Sat Nov 17, 2018 9:57 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby manx » Thu Apr 09, 2020 2:21 pm

So J2Kbr you told me to look at this post because it's very similar to what i wanted. I will give this one a try. But i would like to know how this works. Can you explain your skript?

How do I get from GIVMXYF:FF010001000000000000000100001A1B1C1D1E1F202124272A2D2F32353840495264 this to the uint8 base und uint8 cc ? I know i can copy the uint mxyc codes direktly out of the input translator. But how do i know what base is and what cc? Is base the normal linear curve ? So i can use yours all the time? And cc is the code out of my new curve? What do the number 5, 19 stand for in your code? Do I have to change them in my script?


Code: Select all
main {
    set_val(STICK_1_X, stick_response(STICK_1_X));
    set_val(STICK_1_Y, stick_response(STICK_1_Y));
}
 
fix32 stick_response(uint8 idx) {
    const uint8 base[] = {
        0x00, 0x05, 0x0A, 0x0F, 0x14, 0x19, 0x1E, 0x23, 0x28, 0x2D, 0x32, 0x37,
        0x3C, 0x41, 0x46, 0x4B, 0x50, 0x55, 0x5A, 0x5F, 0x64
    };
    const uint8 cc[] = {
        0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x24, 0x27, 0x2A,
        0x2D, 0x2F, 0x32, 0x35, 0x38, 0x40, 0x49, 0x52, 0x64
    };
 
    fix32 value = get_actual(idx);
    fix32 signal = (value >= 0.0 ? 1.0 : -1.0);
    value = abs(value);
 
    uint8 i = min((uint8)value / 5, 19);
    value = lerp((fix32)cc[i], (fix32)cc[i+1], (value - (fix32)base[i]) / 5.0);
 
    return(value * signal);
}



Here are my values for example:

Code: Select all
GIVMXY:0330013A004F18B519AE007D00101920262B31363B3F43474B4F53565A5D616364
 
 
const uint8 mxyc[] = { 0xFF, 0x03, 0x30, 0x01, 0x3A, 0x00, 0x4F, 0x18,
    0xB5, 0x19, 0xAE, 0x00, 0x7D, 0x00, 0x10, 0x19, 0x20, 0x26, 0x2B, 0x31, 0x36,
    0x3B, 0x3F, 0x43, 0x47, 0x4B, 0x4F, 0x53, 0x56, 0x5A, 0x5D, 0x61, 0x63, 0x64 };




Last question for now: The new sensitivity curve is applying all the time, i think. Is it possible to write the script that you can have 2 or 3 different sensitivit curves? depending on a counting number, let's say for different weapon slots. Like antirecoil often tracks your primary and secondary weapon. Because i would like to have a different curve for sniping and a different curve for auto rifles for example.

thanks a lot! :)
User avatar
manx
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Sun Sep 29, 2019 4:05 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby manx » Fri Apr 10, 2020 4:29 pm

@J2Kbr


I am able to run some curves, but not every curve i copy out of the translator works.

const uint8 mxyc[] = { 0xFF, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x13, 0xD6, 0x1A, 0x6E, 0x20, 0x2E, 0x25, 0x71, 0x2A, 0x5E, 0x2F, 0x0B, 0x33, 0x85, 0x37, 0xD5, 0x3C, 0x02, 0x40, 0x10, 0x44, 0x03, 0x47, 0xDF, 0x4B, 0xA6, 0x4F, 0x59, 0x52, 0xFB, 0x56, 0x8D, 0x5A, 0x10, 0x5D, 0x86, 0x60, 0xEE, 0x64, 0x00 };

This one for example doesn't work. i don't know what i have to delete to apply to the script. could you please give us an idea how we can configurate every curve into this script? And what is about the deadzone and the deadzone shape?
User avatar
manx
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Sun Sep 29, 2019 4:05 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby J2Kbr » Sun Apr 12, 2020 12:30 pm

manx wrote:This one for example doesn't work. i don't know what i have to delete to apply to the script. could you please give us an idea how we can configurate every curve into this script? And what is about the deadzone and the deadzone shape?

This is the part you need for the script:
Code: Select all
const uint8 mxyc[] = { 0x0A, 0x14, 0x1A, 0x20, 0x25, 0x2A, 0x2F, 0x34, 0x38, 0x3C, 0x40, 0x44, 0x48, 0x4C, 0x4F, 0x53, 0x57, 0x5A, 0x5E, 0x61, 0x64 };

However, The first point should always be 0 (you have it set to 10).
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby teddy18 » Tue Nov 10, 2020 12:17 am

Is this possible to use for Deadzone
To set Input Translater Deadzone and curve

And use it for analogue stick
User avatar
teddy18
Lieutenant
Lieutenant
 
Posts: 346
Joined: Sun Jul 19, 2015 4:18 pm

Re: Creating a sensitivity curve for an analogue stick?

Postby J2Kbr » Tue Nov 10, 2020 9:40 am

teddy18 wrote:Is this possible to use for Deadzone
To set Input Translater Deadzone and curve

And use it for analogue stick

Yes, this is possible. Do you want make the deadzone bigger or smaller?
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 123 guests