[GCV/GPC] Apex Legends CV Anti-Recoil

GCV scripting for Gtuner IV and Titan Two. Configuration, examples, questions.

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby Gjin Yuko » Tue Apr 07, 2020 11:34 am

J2Kbr wrote:
ungabunga9 wrote:I ran the mouse passthough script above and rapidfire detection worked but antirecoil never came on. Do we need to use vibration or any special game settings? I can use Scachi's HID antirecoil script with this exact setup. I'm wondering if my terrible quality Xbox stream causes problems. I have to set to highest quality to accurately detect guns and it is still very inconsistent with some chop, grain, and frame drops.

I forgot to add an important part in the script for mouse passthough (map the mouse button 1 to BUTTON_5, so the GCV script can detect when the fire trigger is pressed and activate the anti-recoil. Here is it fixed:

Now its even better, dont know if it was placebo before but know i konw this is straight evil :joia: Gonna post some clips later :smile0203:
Ohh shi* this is crazy :innocent_smile_1:
YouTube /Gjin Yuko
Facebook /Gjin Yuko
Twitter /Gjin Yuko
Discord /Gjin Yuko
Xbox /Gjin Yuko
Playstation Dont have one, Xbox is the better Console :P
User avatar
Gjin Yuko
Sergeant Major
Sergeant Major
 
Posts: 95
Joined: Mon Aug 05, 2019 10:00 pm
Location: Germany

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby ungabunga9 » Tue Apr 07, 2020 1:29 pm

The new script still detects rapidfire but does not do antirecoil. I don't think that the video feed is the issue because I can run antirecoil with controller and T2. Introducing the XIM and DATA_SET = 2 is where I get the problem. I think...
Last edited by ungabunga9 on Tue Apr 07, 2020 1:55 pm, edited 1 time in total.
User avatar
ungabunga9
First Sergeant
First Sergeant
 
Posts: 61
Joined: Thu Jun 01, 2017 1:37 pm

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby Chaka » Tue Apr 07, 2020 1:36 pm

I can get this working without my xim, but i post this into it's own gpc and run it with the xim and don't get any anti recoil or rapid fire. should i be doing something else? I purchased a capture card and it's well worth it compared to streaming
User avatar
Chaka
Master Sergeant
Master Sergeant
 
Posts: 36
Joined: Tue Feb 05, 2019 4:18 am

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby ungabunga9 » Tue Apr 07, 2020 4:14 pm

I worked with Chaka over discord and we achieved the same result. We both experience weapon specific rapidfire but no antirecoil movement.

Our setup:
Mouse -> T2 -> XIM(has controller) -> Console

apex_antirecoil.py is set to:
GLOBAL_HSCALE = 1.00
GLOBAL_VSCALE = 1.00
DATA_SET = 2

GtunerIV 1.7.3.0
Titan Two 1.7.3.0
XIM Manager: 5.00.20190719
XIM Firmware: 5.00.20200307

The T2 is running the most recent script that J2Kbr posted in this thread.


Current ideas:
1. In J2Kbr's last post, he edited the script to "map the mouse button 1 to BUTTON_5, so the GCV script can detect when the fire trigger is pressed and activate the anti-recoil." In my setup, how would the PC/python script detect a BUTTON_5 press? The T2 is not connected to the PC. The PC gets feedback from video capture, but video will not indicate that BUTTON_5 has been pressed.

2.Now wondering if Gjin Yuko/J2kbr use a different physical configuration.

3. Is GtunerIV detecting all python resources correctly. (It does show all 3 green checks)

4. Chaka used a more accurate capture card and PS4 instead of xbox. He received the same results when running my setup. My poor image captures are likely not an issue.
User avatar
ungabunga9
First Sergeant
First Sergeant
 
Posts: 61
Joined: Thu Jun 01, 2017 1:37 pm

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby Gjin Yuko » Tue Apr 07, 2020 9:08 pm

ungabunga9 wrote:I worked with Chaka over discord and we achieved the same result. We both experience weapon specific rapidfire but no antirecoil movement.

Our setup:
Mouse -> T2 -> XIM(has controller) -> Console

apex_antirecoil.py is set to:
GLOBAL_HSCALE = 1.00
GLOBAL_VSCALE = 1.00
DATA_SET = 2

GtunerIV 1.7.3.0
Titan Two 1.7.3.0
XIM Manager: 5.00.20190719
XIM Firmware: 5.00.20200307

The T2 is running the most recent script that J2Kbr posted in this thread.


Current ideas:
1. In J2Kbr's last post, he edited the script to "map the mouse button 1 to BUTTON_5, so the GCV script can detect when the fire trigger is pressed and activate the anti-recoil." In my setup, how would the PC/python script detect a BUTTON_5 press? The T2 is not connected to the PC. The PC gets feedback from video capture, but video will not indicate that BUTTON_5 has been pressed.

2.Now wondering if Gjin Yuko/J2kbr use a different physical configuration.

3. Is GtunerIV detecting all python resources correctly. (It does show all 3 green checks)

4. Chaka used a more accurate capture card and PS4 instead of xbox. He received the same results when running my setup. My poor image captures are likely not an issue.

T2 needs to be connected to the Pc otherwise GCV would be useless
YouTube /Gjin Yuko
Facebook /Gjin Yuko
Twitter /Gjin Yuko
Discord /Gjin Yuko
Xbox /Gjin Yuko
Playstation Dont have one, Xbox is the better Console :P
User avatar
Gjin Yuko
Sergeant Major
Sergeant Major
 
Posts: 95
Joined: Mon Aug 05, 2019 10:00 pm
Location: Germany

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby ungabunga9 » Tue Apr 07, 2020 10:51 pm

Gjin Yuko wrote:T2 needs to be connected to the Pc otherwise GCV would be useless

Connected to PC via programming port right? I have PC -> T2 programming port and then as follows:
Mouse -> T2 -> XIM(has controller) -> Console
User avatar
ungabunga9
First Sergeant
First Sergeant
 
Posts: 61
Joined: Thu Jun 01, 2017 1:37 pm

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby residualflash » Tue Apr 07, 2020 11:33 pm

i can also confirm not getting anti-recoil when connecting T2 -> Xim -> Xbox using keypassthrough and mousepassthrough. Getting only rapidfire.

In the meantime, using this for anti-recoil with the xim connected to the T2

Code: Select all
 
#define float fix32
 
float stick_1_x, stick_1_y;
float MinARecoilPercentX = 20.0;
float MinARecoilPercentY = 30.0;
bool rapidfire;
 
init
{
    printf("GCMD:ComputerVision.Start:apex_antirecoil");
}
 
main {
    if(gcv_ready())
    {
        switch(gcv_read(0))
        {
            case 0:
            {
                rapidfire = gcv_read(1);
            } break;
            case 1:
            {
                gcv_read(1, &stick_1_x);
                gcv_read(5, &stick_1_y);
            } break;
            case 2:
            {
                int16 hoffset, voffset;
                gcv_read(1, &hoffset);
                gcv_read(3, &voffset);
                mxyconverter_hoffset(hoffset);
                mxyconverter_voffset(voffset);
            } break;
        }
    }
 
    if(get_actual(BUTTON_5))
    {
        float CurrentX = get_val(STICK_1_X);
        float CurrentY = get_val(STICK_1_Y);
        float MinARecoilFactorX = MinARecoilPercentX / 100.0;
        float MinARecoilFactorY = MinARecoilPercentY / 100.0;
        float MinARecoilToApplyX = MinARecoilFactorX * stick_1_x;
        float MinARecoilToApplyY = MinARecoilFactorY * stick_1_y;
        float MovementARecoilToApplyX = (1.0 - MinARecoilFactorX) * ((stick_1_x * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX*CurrentX*0.5)));
        float MovementARecoilToApplyY = (1.0 - MinARecoilFactorY) * ((stick_1_y * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentY*CurrentY*0.5)));
 
        if(stick_1_x || stick_1_y)
        {
            set_val(STICK_1_X, clamp(MinARecoilToApplyX + MovementARecoilToApplyX + get_val(STICK_1_X), -100.00, 100.00 - MinARecoilToApplyX));
            set_val(STICK_1_Y, clamp(MinARecoilToApplyY + MovementARecoilToApplyY + get_val(STICK_1_Y), -100.00, 100.00 - MinARecoilToApplyY));
        }
        if(rapidfire)
        {
            combo_run(rapid_fire);
        }
    }
    else if(event_release(BUTTON_5))
    {
        stick_1_x = stick_1_y = 0.0;
        combo_stop(rapid_fire);
    }
}
 
combo rapid_fire
{
    set_val(BUTTON_5, 100.0);
    wait(24);
    set_val(BUTTON_5, 0.0);
    wait(16);
}
 
User avatar
residualflash
Master Sergeant
Master Sergeant
 
Posts: 39
Joined: Fri Apr 05, 2019 8:37 pm

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby Gjin Yuko » Wed Apr 08, 2020 7:17 am

Why change the Deadzones? Wouldnt that screw up the STs that are based on that Deadzone?
YouTube /Gjin Yuko
Facebook /Gjin Yuko
Twitter /Gjin Yuko
Discord /Gjin Yuko
Xbox /Gjin Yuko
Playstation Dont have one, Xbox is the better Console :P
User avatar
Gjin Yuko
Sergeant Major
Sergeant Major
 
Posts: 95
Joined: Mon Aug 05, 2019 10:00 pm
Location: Germany

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby ungabunga9 » Wed Apr 08, 2020 4:47 pm

DontAtMe I tried your configuration. Setting the right stick to control the Z axis allowed me to use T2 HID output mouse with "Disable Joystick from Multi Interface output" unchecked. That was a surprise.

I believe that I followed your instructions exactly and still receive no antirecoil. Though I did receive rapidfire once again.
User avatar
ungabunga9
First Sergeant
First Sergeant
 
Posts: 61
Joined: Thu Jun 01, 2017 1:37 pm

Re: Gtuner IV 1.07 PUBLIC RELEASE: Computer Vision

Postby Chaka » Thu Apr 09, 2020 9:59 am

Has anyone else had freezing issues with this script? My PS4 keeps freezing in games for a second or so and dropping out of games. I was wondering if my pc isn’t powerful enough, if so how would I cap the frame rate or something similar to decrease the load? I’ve narrowed it down to definitely being because of Gtuner capturing the gameplay. It’s perfect without it and even with just the Elgato running by itself
User avatar
Chaka
Master Sergeant
Master Sergeant
 
Posts: 36
Joined: Tue Feb 05, 2019 4:18 am

PreviousNext

Return to Gtuner Computer Vision

Who is online

Users browsing this forum: No registered users and 30 guests