steve1316 / granblue-automation-android

Educational application written in Kotlin aimed at automating user-defined workflows for the mobile game, "Granblue Fantasy", using MediaProjection, AccessibilityService, and OpenCV.
63 stars 11 forks source link

Jittering Inputs #25

Closed PortablePanda closed 2 years ago

PortablePanda commented 2 years ago

Hello! When using this on my mobile device, it seems as if the bot constantly performs meaningless taps near the center of the screen, which cause it to shift up and down and cause delays.

steve1316 commented 2 years ago

Without a video, I cant be sure but I assume you are talking about the up/down swipes near the top of the screen. They exist because the bot relies on ImageReader to get the contents of the screen. Unfortunately, it comes with the downside of ImageReader not refreshing with a brand new image unless something on the screen changes.

Since GBF is completely static most of the time except for animations and during Combat, the bot will "move" the screen up and down to force a change for ImageReader to generate a new image.

If it is not swipes that you are talking about, then a video showcasing the issue along with the associated log would help.

PortablePanda commented 2 years ago

Here you go! Sorry for the extreme and ugly redaction, I just thought it would be best to hide any potentially identifying information. Also, this was mirrored directly from my actual phone.

https://user-images.githubusercontent.com/82384904/182458808-0792d24c-8588-41b9-8dde-8157422bc445.mp4

log @ 2022-08-02 14:48:34.txt

steve1316 commented 2 years ago

Yeah, no worries about the redaction!

At 0:25, 0:46, and 2:08 of the video for example, they all match the behavior that I mentioned in the previous comment. Although it is fair to assume that the bot was peforming weirdly haha.

You can experiment with the Adjustments page with options like reducing General Image Searching from 5 to 3 for example to speed up the bot by a fair bit.

Also, in my personal experience, I would place the floating overlay button to the bottom far left corner or anywhere at the bottom of the SkyLeap UI to avoid the button obscuring something ingame.

PortablePanda commented 2 years ago

It seems like reducing the image searching sped things up a fair bit, thank you!