AutoBTD6 icon indicating copy to clipboard operation
AutoBTD6 copied to clipboard

Adding support for super ultrawide 32:9 3840x1080

Open shsishruken opened this issue 11 months ago • 5 comments

After adding the screenshots at 3840x1080, is there anything else to do?

shsishruken avatar Dec 31 '24 23:12 shsishruken

With such a different aspect ratio the general layout and area of unused screen to the sides will most definitely vary which would require adding appropritate coordinates to image_areas.json under the 3840x1080 tag and tweaking the current playthroughs or creating custom ones as the script only scales the coordinates in reference to the resolution they were recorded on.

ANRAR4 avatar Jan 01 '25 17:01 ANRAR4

With such a different aspect ratio the general layout and area of unused screen to the sides will most definitely vary which would require adding appropritate coordinates to image_areas.json under the 3840x1080 tag and tweaking the current playthroughs or creating custom ones as the script only scales the coordinates in reference to the resolution they were recorded on.

3840x1080 UI is almost identical in game.

While in a map, there's no difference at all, the extra space on each sides are filled with an arbitrary background. (While in a map, the playable/clickable area remains at 16:9). The only differences lie in navigating menus outside of a map, mainly the Back button, Change Hero button, Monkey Money, Skin choice(s), and all home screen menu buttons on Left and Right sides.

image image

What do I need to do to add support for the different ratio? I've added all 3840x1080 screenshots to /images/3840x1080 already.

Do I just need to specify a new resolution in image_areas.json with specific coords (like using ahk coord spy)? Or do i need to modify your replay.py as it specifically sets nativeResolution to 2560x1440?

shsishruken avatar Jan 03 '25 10:01 shsishruken

When I try to run a converted playthrough using your additional scripts, it gives me this error.

line 698, in main diff = cv2.matchTemplate(cutImage(screenshot, screenCfg[2]), cutImage(screenCfg[1], screenCfg[2]), cv2.TM_SQDIFF_NORMED)[0][0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:588: error: (-215:Assertion failed) corr.rows <= img.rows + templ.rows - 1 && corr.cols <= img.cols + templ.cols - 1 in function 'cv::crossCorr'

shsishruken avatar Jan 03 '25 11:01 shsishruken

Just a side note, it works when I switch to 1920x1080. Just need some config tweaks and mostly works okay, some runs can be a hit or miss without full MK (regardless of flag, i.e. -nomk). Trying to get 32:9 to work and I'll be happy to contribute for niche aspect ratios.

shsishruken avatar Jan 03 '25 11:01 shsishruken

Do I just need to specify a new resolution in image_areas.json with specific coords (like using ahk coord spy)? Or do i need to modify your replay.py as it specifically sets nativeResolution to 2560x1440?

Commit d5280057c48d0d864e52649bafd837aadeb3f8ea should make the changes possible

some runs can be a hit or miss without full MK (regardless of flag, i.e. -nomk)

I don't test every run for each update, so some (or many) might no longer work on any resolution

ANRAR4 avatar Feb 11 '25 18:02 ANRAR4