jilderthoekstra / granturismo

Simple example how to automate tasks using remote play and playstation.
8 stars 5 forks source link

No steering? #4

Open azbelj opened 2 years ago

azbelj commented 2 years ago

Have it set up with exact key binds, all the pip installed same version or newer. but when i run the script the car only accelerates and does not steer so it bounces around the track for a lap and then noses into a wall and gets stuck.

DMGxx commented 2 years ago

I can also attest to this, however it did manage to finish, pretty far back. Then got stuck on the page that shows the points breakdown.

Zandros420 commented 2 years ago

i have this running just fine on a Ryzen 7 5700g except for a few wipe outs every other race or so. tried running it off an old i5 pc and it wouldn't work properly. might just need a better setup. running on ps4 pro with ssd.

azbelj commented 2 years ago

i have this running just fine on a Ryzen 7 5700g except for a few wipe outs every other race or so. tried running it off an old i5 pc and it wouldn't work properly. might just need a better setup. running on ps4 pro with ssd.

really doubt its a hardware issue. 5600x, 3070ti, ps5 980 pro m.2. list goes on. Just something isnt cooperating for me. Tried on my i7 laptop and same thing happens so i dont understand

jilderthoekstra commented 2 years ago

For the steering issues. It's because of the similarity check. Which works good on my configuration but things like brightness and stuff could probably effect it. In the gran-turismo.py there is an if statement which checks the similarity value. Currently you'll see the value 0.05 twice. Change that value to a lower one. Try -1.0 down to -10.0 change both values.

Hardware should have no impact. It should work on older systems just fine.

MikkoHageman commented 2 years ago

Hey, did you also change the camera? On my first run I had it with cockpit view and it also bounced all over the place, until I read the instructions again more carefully and changed the camera to behind the car. With the behind the car camera it usually touches the band most of the time. Sometimes it loses it for a few seconds, but usually finds it back soon after.

RonSpawnson commented 2 years ago

Steering also appears to be no longer working for me as of today.

RonSpawnson commented 2 years ago

Confirming that changing similarity check from 0.05 to -1 in both places fixed my steering issue. Thanks for the suggestion!

azbelj commented 2 years ago

Thank you so much. -1.0 up to -3.5 didnt work. went straight to -10 and works fine. God bless you! <3

azbelj commented 2 years ago

Curiosuly I think i sort of found the main issue? With the new debug you added I noticed the detection rectangle isn't actually covering the icon? its about 60% the area above it and only 40% the icon. I see the location settings in your code but I dont want to blindly mess with it?

Also on my laptop it only does 1 race and doesnt detect the race finish. So I suspect it's the same issue.

Could you give us any insight on either increasing the detection rectangles or fixing their position?

jilderthoekstra commented 2 years ago

It be aligned something like this. steering

Are you on windows 10 or 11 and are you running any custom theme or have it set on classic? Also you didn't resize or maximize the window right? And what is your laptop resolution? The way it works internally is that I grab the window. But I have to cut of the titlebar and border of both sides and bottom. These are values are since "Major Refactor" commit in the window_info.py. border_size = 8 titlebar_size = 31 After I've cut off those things it should leave a 1280x720 image. But if you're running a different theme or something. These border sizes could be different and some of the locations may not be correct anymore. I probably can change it to auto-calculate these if I'm certain the left, right and bottom borders are always the same size. for the steering icon you can edit steering_rect, you can adjust the left and top values. The width and height should remain the same. The other rectangles you can change all values. Keep in mind how bigger the rectangle the more performance it'll take.

If you have updated to the latest sourcecode. You can add this line. logging.info('Window content size width: {} height: {}'.format(window.content_width, window.content_height)) put it above the steering_rect = { line. That should print out 1280x720 but in your case it's probably something else code

jilderthoekstra commented 2 years ago

I also added a new flag to the config.py in the latest push. You'll get a window where you can see the rectangle position during the bot run.

azbelj commented 2 years ago

powershell_WH9HJwvKPi I'm on windows 10 on my desktop. With the latest revision with your default similarity values this is what I encounter. The steering box is off. Window is default size it launches at. If I lower the similarity value I can get it to run but I have to lower it to like -12

I still have a suspicion it has to do with monitor resolution? I'm on a 2560x1440 monitor.

Also occasionally this new script misses a beat and I end up at the USA races selection map.

But regardless your work is amazing

jilderthoekstra commented 2 years ago

What does the content size say in PowerShell when you start the script? I have a feeling that your Chiaki titlebar is larger then 31 pixels.

Been running the newest version here for 5 hours already :-)

azbelj commented 2 years ago

1282x725

jilderthoekstra commented 2 years ago

Ah okay it should be 1280x720. Guess your titlebars in windows are larger then mine. Are you running default windows theme or? Anyway try the following fix: open window_info.py change border_size to 9 and titlebar_size to 35. I'm guessing I should just calculate it automatically.

azbelj commented 2 years ago

I actually just fixed the sizing manually. Shrinking the window a few pixels. Now debug recognizes exactly 720p. But the steering box is still a hair off. Does what it needs to. The similarity debug jumps from -5 to -16 during the race.

And far as I’m aware my theme is default but I have adjusted text size and such in the past so that can affect it I suppose.

But I just let it run through a cycle and seems to be working pretty well.

jilderthoekstra commented 2 years ago

yeah similarity should jump up and down. When it is red it should be -14 or lower. And white should be anywhere between -10 and +1 as long as you are using a higher value then the value when it's red and a lower value when it's white then you should be okay.