Antirecoil erratic with higher values?

Forum to discuss the scripts, configs and connection of XIM with the Titan devices.

Moderator: antithesis

Re: Antirecoil erratic with higher values?

Postby norcal3737 » Sat May 26, 2018 5:20 pm

antithesis wrote:That's not my code, I don't have an Interactive Config connected to it. My antirecoil code was never intended to be standalone, but included in a bigger script. I think Scachi banged together an IC over the top of my script and it may not contain the latest code, and / or have bugs.

Regardless, use the StickNoise value of 5.xx + 0.01. It doesn't matter if the biggest value was negative, use the absolute value (+ve). What you've done there is correct. The stick noise gets filtered out within the game's deadzone (it's typically around 20), so nothing negative will happen in-game when it's exceeded. Once the stick noise is filtered out, you should see exact matches for your antirecoil values in output.

70 is still really high, that should be darting to the ground pretty quickly. The highest I use is 60 on an Antiope in Destiny 2 and it keeps the reticle rock-solid front and centre (I hate the Antiope without it). Note also that if you move the mouse / stick beyond 60 (in this case), antirecoil automatically disengages to allow normal movement.

Vertical antirecoil can't affect horizontal recoil because all it does is push the stick along the Y-axis. You can see that in Device Manager. Horizontal recoil kicking in above 70 may be a game mechanic, what game are you playing? Otherwise, that'll probably be a bug in the IC.

Long story short, my guess is the IC may be messing things up, do you have a link to the script you've used?

I recommend downloading my script from the Online Resources section of Gtuner to ensure you're using the correct code and editing the values manually. I'll be uploading some new full scripts with Interactive Configs in the near future.



In regards to the vertical recoil values, thats addressed in the previous post. Removing the interactive configuration, I now only use 32-35 values and it holds steady. Sometimes it has a random horizontal kick to the side, and when it does, its always towards the end of the magazine clip.

I play solely PUBG. As for random horizontal recoil kick, i can test this via having no gun equipped and holding ADS and Fire and watching the screen push down, and as my view is rotating down, you can see the cursor/view drag slightly to the side at times. Is this maybe a stick noise issue, and need to increase the stick noise value? I'm not sure if it'd be a game mechanic since no gun is equipped/being shot.



This was the exact script I was using. I combined Scachi's IC code to your ADS AR script. I removed the interactive configuration portion, which ends up being your ADS recoil script straightfrom the online resources page

Code: Select all
#pragma METAINFO("antithesis Antirecoil", 1, 01, "antithesis")
 
/*** interactive configuration ***
 
<cfgdesc>
 
[Sticknoise]
shortdesc    = <<<MULTILINE
The default value 4.32 should be a good start.
If you want to tweak this, set it to the max value of your sticks resting position values.
Use the "Device Monitor" to examine them.
MULTILINE
byteoffset    = 0
bitsize        = 32
control        = spinboxf
default        = 432
minimum        = 0
maximum        = 2000
step            = 1
decimals    = 2
 
[Anti Recoil Vertical]
shortdesc    = Vertical recoil compensation
byteoffset= 4
bitsize        = 32
control        = spinboxf
default        = 300
minimum        = -1000
maximum        = 1000
step            = 1
decimals    = 1
 
[Anti Recoil Horizontal]
shortdesc    = Horizontal recoil compensation
byteoffset= 8
bitsize        = 32
control        = spinboxf
default        = 0
minimum        = -1000
maximum        = 1000
step            = 1
decimals    = 1
 
 
</cfgdesc>
 
*/

 
fix32 RECOIL_V = 35.0; // Change this value to adjust the strength of Vertical antirecoil
fix32 RECOIL_H = 0.0; // Change this value to adjust the strength of Horizontal antirecoil
fix32 RY;
fix32 RX;
 
fix32 StickNoise = 4.32// Change this value to adjust the size of the Deadzone to ignore when using a Xim Apex.
// Go to Device Monitor in Gtuner IV, flick the right stick and take note of the largest value.
 
main {
 
 
if (get_val (BUTTON_5)) // only active when firing to allow for microaim adjustments without the input being filtered
{   
// DEADZONE REMOVER
    if(abs(get_actual(STICK_1_X)) < StickNoise) { set_val(STICK_1_X, 0.0); }
    if(abs(get_actual(STICK_1_Y)) < StickNoise) { set_val(STICK_1_Y, 0.0); }
    if(abs(get_actual(STICK_2_X)) < StickNoise) { set_val(STICK_2_X, 0.0); }
    if(abs(get_actual(STICK_2_Y)) < StickNoise) { set_val(STICK_2_Y, 0.0); }
 
}   
 
// ANTI-RECOIL
if (get_val (BUTTON_8)) // while holding ADS
    {
        if (get_val (BUTTON_5)) // while holding SHOOT
        {   
            AntiRecoil(STICK_1_Y,RECOIL_V); // apply Vertical antirecoil
            AntiRecoil(STICK_1_X,RECOIL_H); // apply Horizontal antirecoil
        }
 
    }
}
 
void AntiRecoil (uint8 axis, fix32 recoil)
{
 
     RY = get_actual(STICK_1_Y);
     RX = get_actual(STICK_1_X);
 
    if (get_val(BUTTON_5) && (sqrt(RX*RX + RY*RY)) <= abs(recoil))
    {
        if(abs(RY) <= abs(recoil))
        {
            set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_val(axis));
        }
    }
}
 
 
Last edited by norcal3737 on Sat May 26, 2018 5:27 pm, edited 1 time in total.
User avatar
norcal3737
Master Sergeant
Master Sergeant
 
Posts: 35
Joined: Sun Apr 22, 2018 5:21 am

Re: Antirecoil erratic with higher values?

Postby norcal3737 » Sat May 26, 2018 5:25 pm

Scachi wrote:Did you use the exact script I linked above in my post or a different one ?
I just can't reproduce it, when I use the org script and my edited interactive configuration script with the same values (the org edited directly. mine just changing the value via the IC), it does exactly the same thing. I can see it via the device monitor, it sets the exactly same value for stick_1_y.

I can't see how this should be able to act differently as the code is the exact same. It only loads the values from the IC on startup, that's the only difference of my edited script.



See my previous post for my exact script used. It's basically exactly the script you posted in the other thread, except it's got additional script lines that tell it to only initiate antirecoil when the ADS-button is engaged in conjunction with trigger fire.

I originally thought that the IC box would just override the base script value, but I could go up to 80 before I'd begin to have issues. With the IC coding entirely removed, If I went over 40, the script would drag my gun down to the ground after 3-4 shots. I am now currently using just the ADS AR script w/o the IC.

It's entirely possible I was doing something wrong, and maybe you or Anti will spot if I made an error, in the script I posted.
User avatar
norcal3737
Master Sergeant
Master Sergeant
 
Posts: 35
Joined: Sun Apr 22, 2018 5:21 am

Re: Antirecoil erratic with higher values?

Postby Scachi » Sat May 26, 2018 5:34 pm

That can't be the script used which had "the erratic behavior", as there is no init part applying the ic value to the script.
Changing the value via IC wouldn't have any effect here.

Another possibility (with a working script) is that you may not have pressed the button "Save and Run" after you have adjusted the values each time.
If you just press "Ok" the new value won't be active until you reload that slot (by using a different slot before or switch slot back&forth one time, or something like that)
Last edited by Scachi on Sat May 26, 2018 5:52 pm, edited 1 time in total.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Antirecoil erratic with higher values?

Postby norcal3737 » Sat May 26, 2018 5:51 pm

Scachi wrote:That can't be the script used which had "the erratic behavior", as there is no init part applying the ic value to the script.
Changing the value via IC wouldn't have any effect here.



I assure you, what I posted is the exact script I loaded in the Titan, which would then allow me to click Interactive Configuration and be able to adjust the 3 values, Sticknoise, Vertical, and Horizontal in a separate box.

Maybe the issue is/was inherent to PUBG. Not sure otherwise. I do appreciate the insight though.
User avatar
norcal3737
Master Sergeant
Master Sergeant
 
Posts: 35
Joined: Sun Apr 22, 2018 5:21 am

Re: Antirecoil erratic with higher values?

Postby Scachi » Sat May 26, 2018 5:53 pm

Yes, the Interactive menu will show up.
NO - the value won't be active without some peace of code like this:

Code: Select all
init {
  pmem_load();
  pmem_read(0,&StickNoise);
  pmem_read(4,&RECOIL_V);
  pmem_read(8,&RECOIL_H);
}
 


Without that piece of code the script has no idea where to grab the values of the Interactive Configuration from and where to apply them to. So it would just stick to use the value directly set within the script itself.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Antirecoil erratic with higher values?

Postby norcal3737 » Sat May 26, 2018 6:16 pm

It's odd though as I was definitely seeing repeatable results changing the IC values, especially going from default 30 to something drastic like 100, which is what prompted me to create this thread when I played with increasing values. I'm not doubting you in any way as you're infinitely more experienced than I am. I'm just sharing my experience(s). I really don't know.

I'm going to add those lines in, and see if the script behaves like w/o the IC portion added. Thank you for your help/insight.
User avatar
norcal3737
Master Sergeant
Master Sergeant
 
Posts: 35
Joined: Sun Apr 22, 2018 5:21 am

Re: Antirecoil erratic with higher values?

Postby antithesis » Sun May 27, 2018 12:25 am

norcal3737 wrote:I play solely PUBG. As for random horizontal recoil kick, i can test this via having no gun equipped and holding ADS and Fire and watching the screen push down, and as my view is rotating down, you can see the cursor/view drag slightly to the side at times. Is this maybe a stick noise issue, and need to increase the stick noise value? I'm not sure if it'd be a game mechanic since no gun is equipped/being shot.

Given there's no horizontal output from the script, it's either an issue with the game engine, or it could be stick noise.

Try giving the game some input from the left stick or WASD. Move forward or backwards while shooting and see if the horizontal drift still occurs. What we're testing for here is the Apex outputting random resting stick values and stacking it with the antirecoil. That will only occur if both sticks (or WASD & mouse) are completely stationary, which doesn't happen often in gameplay.

If your output values in Device Manager match your script's antirecoil values, then it's not likely to be Apex stick noise, nor is it the script because it's feeding a value of 0.00 to the game.

My only advice is to increase StickNoise and test the outcome. I know that my stick noise varies depending on the controller connected to my Apex - one DS4 is 4.31, another DS4 is 5.85. Again, these are really small movements within the deadzone and shouldn't affect gameplay.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Previous

Return to XIM Apex, XIM4, XIM Edge with Titan devices

Who is online

Users browsing this forum: No registered users and 46 guests