Speeding up CV on PC with emulator?

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

Speeding up CV on PC with emulator?

Postby savour » Sun Jan 02, 2022 6:15 pm

I have been working on a Vagrant story auto chain script, and have noticed sometimes the delay between CV recognizing the chain ! and GPCinputting the button is too long leading to it not working.

For those who don't know, Vagrant story has a chain system that works similar to rhythm games where an ! comes up, and then you must press some button (square, triangle or circle) immediately after that. If done correctly it will continue the combo until the user misses a prompt, or the enemy dies. Here is a youtube video of someone getting a 30 chain to show how it works.

At first my script was too slow 100% of the time since I was checking the entire frame the ! but after cropping the frame to a zone that the ! pops into most the time it now works about 70% of the time. I'd like to make it perfect, so if there are any other things I can do to make this quicker or strategies people have used to make rhythm type mechanics work correctly that would be greatly appreciated!

Here is an image of the cropped image that is currently being checked. The blue square is the same size as the image being checked for the !

checking_zone.jpg
checking_zone.jpg (142.23 KiB) Viewed 606 times


And what is being looked for is

attack_combo_small.jpg
attack_combo_small.jpg (1007 Bytes) Viewed 606 times


Any help or feedback greatly appreciated! Thanks!

GCV code
Code: Select all
 
    def process(self, frame):
        self.gcvdata[0] = False
        frame = cv2.rectangle(frame, (700,100), (1400,500), (255, 0, 0), 2)
        picture = frame[100:700, 500:1400]
 
        # Passing bools to GPC script to take action on.
        self.gcvdata[0] = self.imageMatch(picture, self.attack_combo, 0.97)
 


GPC code
Code: Select all
 
if (enabled) {
        if(gcv_ready()) {
            attack_combo = gcv_read(0);
        }
 
        if(attack_combo) {
            // left hold to trigger square combo
            if(get_actual(BUTTON_12)) {
                combo_run(square);
            }
            // up
            else if(get_actual(BUTTON_10)) {
                combo_run(triangle);
            }
            // right
            else if(get_actual(BUTTON_13)) {
                combo_run(circle);
            }
            else {
                combo_run(circle);
            }
        }
 


My setup is:
Running epsxe emulator capped at 60fps on windows PC with gtuner on the same PC.

PC
Windows 10 PC
Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz 3.60 GHz
32 GB ram
RTX 2080
User avatar
savour
Sergeant
Sergeant
 
Posts: 9
Joined: Mon Dec 11, 2017 3:54 pm

Return to Gtuner Computer Vision

Who is online

Users browsing this forum: No registered users and 87 guests