mchung94 / solitaire-player

Automatically play Pyramid and TriPeaks Solitaire in Microsoft Solitaire Collection for Windows 10
MIT License
39 stars 15 forks source link

new version - Microsoft Solitaire #33

Open cou94114 opened 1 year ago

cou94114 commented 1 year ago

I received a new version of solitaire (4.16.3140.0).

MS-Solitaire-version-info

This new version changes many of the graphics for the game and breaks the solitaire-player code for both pyramid and tripeaks.

Normally, your code would click through the stock pile to identify the cards, then click the Undo All button. That mouse move and click are not executed with the new version of the Microsoft game. I have been able to move the mouse and click Undo All and your code will proceed normally. I have to watch the action because I have to move the mouse and click Undo All when the program has either solved the deck or needs to recycle the stock pile to continue to identify the cards on the tableau.

I'm not sure if this will help, but I have attached the output of an execution of tripeaks.

tripeaks-test-01.txt

Java information c:>java -version openjdk version "11.0.18" 2023-01-17 OpenJDK Runtime Environment Temurin-11.0.18+10 (build 11.0.18+10) OpenJDK 64-Bit Server VM Temurin-11.0.18+10 (build 11.0.18+10, mixed mode)

cou94114 commented 1 year ago

I'm not sure if you want to treat this as a separate issue.

System Report: Window Size (after adjustment) = 1440x900 Expected Window Size = 1440x900 DPI = 96 Expected DPI = 96 Scaling Factor = 100.0% Primary Screen Size (Adjusted for Scaling Factor) = 1920x1080 Expected Primary Screen Size = 1920x1080 If the scaling factor isn't 100% or the values don't match the expected, then this program may not work properly. Can't detect if we're playing a game of FreeCell Solitaire.

RobotManager commented 1 year ago

I'm having the same problem, the new version of Microsoft Solitaire has broken functionality with solitaire-player. I have nothing to add to this excellent bug report, I just wanted to say "me too".

mchung94 commented 1 year ago

Thanks for the bug report. I currently don't have access to a computer running Windows, so it'll be a few weeks before I can fix the program.

Whenever there is a change to the graphics or layout of the screen and cards, my program will get confused and not do the right thing.

What it tries to do is look for something on the screen to indicate which game is playing, like for TriPeaks it will look for https://github.com/mchung94/solitaire-player/blob/master/src/main/resources/TriPeaks/Game.png - maybe something like this is why it can't figure out why it's playing FreeCell in the second example you sent.

Then it'll look at files like https://github.com/mchung94/solitaire-player/blob/master/src/main/resources/TriPeaks/regions.json to understand where the cards are on the window when the game has been resized to 1440x900. This can become obsolete if an update changes where the cards are at.

If it's having problems looking for the Undo All button, most likely the graphics have changed so this image no longer can be found on the game window: https://github.com/mchung94/solitaire-player/blob/master/src/main/resources/Common/UndoBoard.png

I'll try to get a fix out as soon as I can but, it'll be a few weeks.

rodan123 commented 1 year ago

It is the greyed out 'undo all' button that changed. PR #34 Compiled and published a new version in my fork repo, if anyone would like to try it before @mchung94's return.

cou94114 commented 1 year ago

It is the greyed out 'undo all' button that changed. PR #34 Compiled and published a new version in my fork repo, if anyone would like to try it before @mchung94's return.

I tested your change and both pyramid and tripeaks work well. Thank you

mchung94 commented 1 year ago

Thanks for the fix @rodan123!

RobotManager commented 1 year ago

I've been using the fix for a day now, and it's been working great. Thank you @rodan123! Also thank you @mchung94 for responding and of course all your work on this as well!

mchung94 commented 1 year ago

I've merged @rodan123's PR and added an updated FreeCell image and published a new release, https://github.com/mchung94/solitaire-player/releases/download/v2.6.9/solitaire-player-v2.6.9.zip

mchung94 commented 1 year ago

Thanks for everyone's help with reporting the issue and the fix as well!