ByPrinciple / GT7-Scripts

Autohotkey scripts for GT7 to farm creddits
35 stars 19 forks source link

Color issue with PixelSearch function (stuck on leaderboard screen) #3

Open iSteph77 opened 2 years ago

iSteph77 commented 2 years ago

I did some debug with the issue I had with the leaderboard screen (purple banner). Most of the time it worked but sometimes it didn't find the color.

No change on the laptop side so I thought about a very slight change of color as this banner is made with a gradient purple color. I used this to check the colors everytime it got stuck.

file := FileOpen("color.txt","a")

PixelGetColor, color, 216, 357
file.write(color)
PixelGetColor, color, 220, 361
file.write(":" color "`n")

file.close()

And the results were :

0x6D3A59:0x743E5E ko
0x6C3A59:0x733E5F ok
0x6C3959:0x763D60 ko
0x6C3A59:0x763D60 ok
0x6D3A59:0x773D60 ko
0x0B0609:0x0B0609 ko
0x0B0609:0x0C0609 ko
0x6D3A59:0x773D60 ko
0x6C3959:0x773D60 ko

As you can see, the color often changes slightly at the start/end of the PixelSearch zone. If you want to check I took screenshots when it happened.

I'm a bit surprised there are only a few users with this issue. I think it may be related to the dynamic resolution changes. Changing the resolution in the app won't change anything for PS4 Pro and PS5 as it clearly says that the resolution will be set to 1080p max depending on the quality of the network connection.

For a fix, I'll extend the zone like I did in my modified script when I showed you I extended a bit the height to get rid of the menu bar overlaid on the PS5 display. If I remember well, I didn't have this issue with the larger zone but I'm not sure.

iSteph77 commented 2 years ago

So far no issue with the code PixelSearch, x, y, 200, 340, 240, 360, %color_check1%, 20, Fast RGB

filipegarrett commented 2 years ago

In my case, I was having a lot of problem with the replay detection point. Changing the hex didn't solve it consistently and in the end giving it more time to the pixel detection find the right color helped a lot. But it isn't 100%, unfortunately.

My impression after various pixel perfect measurements is that the color isn't actually always the same. I guess the less resolution you run, the lower the video quality and the greater the risk of color distortion, I doesn't help that the detection point is fairly small.