little-fort / booster-bot

A bot that could HYPOTHETICALLY be used to farm boosters for any deck in Marvel Snap.
GNU General Public License v3.0
86 stars 5 forks source link

SnapCN's font style has been changed. #79

Open Kusaki-Y opened 1 week ago

Kusaki-Y commented 1 week ago

Screenshot_漫威终极逆转_20241121_083306 Screenshot_漫威终极逆转_20241121_083216 Screenshot_漫威终极逆转_20241121_083211 Screenshot_漫威终极逆转_20241121_083209 Screenshot_漫威终极逆转_20241121_083200

sakura0423 commented 1 week ago

Help us plz

Kusaki-Y commented 1 week ago

Will this be solved if I replace the figure in the reference folder with the latest figure?

sakura0423 commented 1 week ago

Will this be solved if I replace the figure in the reference folder with the latest figure?

I think that's a good way to go. The problem I'm having is that I don't know what to do with the images, I see that the images under the ref path are transformed

Kusaki-Y commented 1 week ago

I discovered the connection between picture and gaming interfaces. The picture is a screenshot taken at 1920*1080 resolution. So, if you re-crop the image according to size, it should be able to be used normally, right?

ywj87132749 commented 1 week ago

After today's update, scripts can no longer be automatically executed

little-fort commented 1 week ago

Wow that is unfortunate, I have no idea why the devs would do that. I am almost wondering if it's a bug because it looks completely inconsistent with the game's overall design.

Will this be solved if I replace the figure in the reference folder with the latest figure?

Yes! The bot takes crops of the game screen at runtime and saves them to the screens folder. These are then matched with the images in the reference folder to infer the game state. If you update the base image in the reference folder to be the version with the CN font, then the bot will use that as the point of reference. For example, if you run the bot on the main screen, one of the first things it will look for is the 'Play' button. You could fix this by taking the btn-main-play-preproc.png image from the screens folder and pasting it into the reference folder.

If you (or any other CN players) can correctly map and update the reference images, it should restore functionality. Then if you share them here, I can add the CN versions to the source code to be included in future releases. I don't have access to the CN version of the game so I can't do it myself

snaptools2023 commented 1 week ago

It looks like it is not loading the font resource correctly. Can you uninstall and reinstall SNAP?

little-fort commented 1 week ago

It looks like it is not loading the font resource correctly. Can you uninstall and reinstall SNAP?

I would also recommend trying this. That font looks like it could be the default system font, which could indicate something broke with rendering text

Kusaki-Y commented 1 week ago

Everyone has this problem, it may be caused by the game update, I am trying to replace the pictures, but there are still some problems.

Kusaki-Y commented 1 week ago

It looks like it is not loading the font resource correctly. Can you uninstall and reinstall SNAP?

I would also recommend trying this. That font looks like it could be the default system font, which could indicate something broke with rendering text

I have another question, if I replace the previous file with a Chinese picture, will the program still run normally?

JohnZhao1208 commented 1 week ago

替换游戏文件字体素材可以解决, 但是可能存在风险

little-fort commented 1 week ago

I have another question, if I replace the previous file with a Chinese picture, will the program still run normally?

Yes, as long as the reference images were updated to match what the game is displaying, the program will function fine. It does not need to be in English

Kusaki-Y commented 1 week ago

I have another question, if I replace the previous file with a Chinese picture, will the program still run normally?

Yes, as long as the reference images were updated to match what the game is displaying, the program will function fine. It does not need to be in English

I replaced about half of the images but many of them are missing in the screen folders. Now the program works on some screens but not the battle screens. The program will not play cards or retreat on its turn, how can I fix this?

little-fort commented 6 days ago

I replaced about half of the images but many of them are missing in the screen folders. Now the program works on some screens but not the battle screens. The program will not play cards or retreat on its turn, how can I fix this?

You can't replace them all at once, you have to make sure to replace the original reference with a cropped image that is displaying the same UI element that the original reference image was displaying.

For example, if you wanted to update the lbl-conquest-pg-1-preproc.png image, you would have to run the bot in Conquest mode, wait until it reaches the Proving Grounds lobby screen, and then take the image that it captured from that view.

So while it is possible, I do think this would be a difficult task for someone who doesn't really understand the bot's operation. I have an idea on how I could build in a self-configuration tool so everyone can fix it on their own, but it will take me some time to put that together.

Kusaki-Y commented 6 days ago

I replaced about half of the images but many of them are missing in the screen folders. Now the program works on some screens but not the battle screens. The program will not play cards or retreat on its turn, how can I fix this?

You can't replace them all at once, you have to make sure to replace the original reference with a cropped image that is displaying the same UI element that the original reference image was displaying.

For example, if you wanted to update the image, you would have to run the bot in Conquest mode, wait until it reaches the Proving Grounds lobby screen, and then take the image that it captured from that view.lbl-conquest-pg-1-preproc.png

So while it is possible, I do think this would be a difficult task for someone who doesn't really understand the bot's operation. I have an idea on how I could build in a self-configuration tool so everyone can fix it on their own, but it will take me some time to put that together.

The program is now working, although in a way I don't understand. I will continue to replace the image in the next two days. Thank you for your answer.

Kusaki-Y commented 6 days ago

I replaced about half of the images but many of them are missing in the screen folders. Now the program works on some screens but not the battle screens. The program will not play cards or retreat on its turn, how can I fix this?

You can't replace them all at once, you have to make sure to replace the original reference with a cropped image that is displaying the same UI element that the original reference image was displaying.

For example, if you wanted to update the lbl-conquest-pg-1-preproc.png image, you would have to run the bot in Conquest mode, wait until it reaches the Proving Grounds lobby screen, and then take the image that it captured from that view.

So while it is possible, I do think this would be a difficult task for someone who doesn't really understand the bot's operation. I have an idea on how I could build in a self-configuration tool so everyone can fix it on their own, but it will take me some time to put that together.

I have made the Chinese stickers and the program can run normally, but how can I submit the file to you?

Kusaki-Y commented 5 days ago

I replaced about half of the images but many of them are missing in the screen folders. Now the program works on some screens but not the battle screens. The program will not play cards or retreat on its turn, how can I fix this?

You can't replace them all at once, you have to make sure to replace the original reference with a cropped image that is displaying the same UI element that the original reference image was displaying.

For example, if you wanted to update the lbl-conquest-pg-1-preproc.png image, you would have to run the bot in Conquest mode, wait until it reaches the Proving Grounds lobby screen, and then take the image that it captured from that view.

So while it is possible, I do think this would be a difficult task for someone who doesn't really understand the bot's operation. I have an idea on how I could build in a self-configuration tool so everyone can fix it on their own, but it will take me some time to put that together.

https://github.com/Kusaki-Y/booster-bot/tree/main/src/BoosterBot/Reference

little-fort commented 5 days ago

https://github.com/Kusaki-Y/booster-bot/tree/main/src/BoosterBot/Reference

Impressive! For any other CN players having issues, try downloading the images linked here and placing them in the program's Reference directory to see if it restores functionality. Looks like the game's language should also be set to Chinese instead of English

holletian commented 5 days ago

https://github.com/Kusaki-Y/booster-bot/tree/main/src/BoosterBot/Reference

令人印象深刻!对于遇到问题的其他 CN 玩家,请尝试下载此处链接的图像并将其放在程序的Reference目录中,看看它是否能恢复功能。看起来游戏的语言也应该设置为中文而不是英语

It's running normally. Thanks.

Kusaki-Y commented 5 days ago

https://github.com/Kusaki-Y/booster-bot/tree/main/src/BoosterBot/Reference

Impressive! For any other CN players having issues, try downloading the images linked here and placing them in the program's Reference directory to see if it restores functionality. Looks like the game's language should also be set to Chinese instead of English

In fact, there are problems with several images. I am not sure if I have replaced the two files btn-conquest-continue-preproc.png and btn-conquest-concede-preproc.png correctly. Please explain how these two files appear in the game.

little-fort commented 5 days ago

btn-conquest-continue-preproc.png is no longer used—that post-match screen was removed in a recent patch. btn-conquest-concede-preproc.png is for the 'Concede' button that is shown in-between Conquest rounds:

image

Kusaki-Y commented 5 days ago

btn-conquest-continue-preproc.png is no longer used—that post-match screen was removed in a recent patch. btn-conquest-concede-preproc.png is for the 'Concede' button that is shown in-between Conquest rounds:

image

little-fort, I have an idea. Can you add a Chinese reference folder to the program and choose Chinese or English to select different reference folders before running? Is it feasible?

Kusaki-Y commented 5 days ago

btn-conquest-continue-preproc.png is no longer used—that post-match screen was removed in a recent patch. btn-conquest-concede-preproc.png is for the 'Concede' button that is shown in-between Conquest rounds: image

little-fort, I have an idea. Can you add a Chinese reference folder to the program and choose Chinese or English to select different reference folders before running? Is it feasible?

And, boss, thank you for your answers all the time.hhh

little-fort commented 5 days ago

little-fort, I have an idea. Can you add a Chinese reference folder to the program and choose Chinese or English to select different reference folders before running? Is it feasible?

Yes, that is my plan and part of what I'm currently working on 🙂

I have already finished work on a new repair function so that anyone will be able to easily fix the reference images on their own system in case another update breaks the references again. I am also adding a permanent configuration file to the app folder so that users can modify settings that will be remembered between runs rather than relying on command line arguments only.

One of the settings I am adding is for alternate languages... I'm relying on Google Translate so I know it won't be perfect, but I hope it will make using the bot (and the game) a little easier for all of you

image

little-fort commented 3 days ago

Hello all, I have published a new release: https://github.com/little-fort/booster-bot/releases/tag/v1.6.0

This update contains my first attempt at localizing the program's text for Chinese users—you will be prompted to configure language selections on the first program start. The translations were made using Google Translate so I'm sure there will be many inaccuracies, but I will be happy to add any suggested improvements that can make the text easier to understand.

I have also bundled the images from @Kusaki-Y in this release for those who have the game set to Chinese text. For anyone else (or if you are encountering issues), this release also contains a new "Repair Mode" that can be activated by starting the program with the --repair parameter. This will walk you through the steps needed to manually capture the relevant components of the game interface as they appear on your specific system.

Please try the latest version and let me know if you encounter further issues. These are substantial changes to the codebase, so I expect there will be issues as more people use it, but I hope you are able to find the core functionality restored with this update

Kusaki-Y commented 3 days ago

Hello all, I have published a new release: https://github.com/little-fort/booster-bot/releases/tag/v1.6.0

This update contains my first attempt at localizing the program's text for Chinese users—you will be prompted to configure language selections on the first program start. The translations were made using Google Translate so I'm sure there will be many inaccuracies, but I will be happy to add any suggested improvements that can make the text easier to understand.

I have also bundled the images from @Kusaki-Y in this release for those who have the game set to Chinese text. For anyone else (or if you are encountering issues), this release also contains a new "Repair Mode" that can be activated by starting the program with the --repair parameter. This will walk you through the steps needed to manually capture the relevant components of the game interface as they appear on your specific system.

Please try the latest version and let me know if you encounter further issues. These are substantial changes to the codebase, so I expect there will be issues as more people use it, but I hope you are able to find the core functionality restored with this update

I updated the Chinese pictures a few days ago, but forgot to put them into GitHub. It happened that I was on a business trip these two days and couldn’t upload them. I will test the program later and contact you in time if there are any problems. Thank you for your help!

Kusaki-Y commented 3 days ago

Hello all, I have published a new release: https://github.com/little-fort/booster-bot/releases/tag/v1.6.0

This update contains my first attempt at localizing the program's text for Chinese users—you will be prompted to configure language selections on the first program start. The translations were made using Google Translate so I'm sure there will be many inaccuracies, but I will be happy to add any suggested improvements that can make the text easier to understand.

I have also bundled the images from @Kusaki-Y in this release for those who have the game set to Chinese text. For anyone else (or if you are encountering issues), this release also contains a new "Repair Mode" that can be activated by starting the program with the --repair parameter. This will walk you through the steps needed to manually capture the relevant components of the game interface as they appear on your specific system.

Please try the latest version and let me know if you encounter further issues. These are substantial changes to the codebase, so I expect there will be issues as more people use it, but I hope you are able to find the core functionality restored with this update

I’m looking forward to using this new feature, it looks like it will be really useful!As for the Chinese translation, I think there is no problem. Thank you for your effort to check the Chinese. Chinese should be quite difficult for non-native speakers.

Kusaki-Y commented 1 day ago

Hello all, I have published a new release: https://github.com/little-fort/booster-bot/releases/tag/v1.6.0

This update contains my first attempt at localizing the program's text for Chinese users—you will be prompted to configure language selections on the first program start. The translations were made using Google Translate so I'm sure there will be many inaccuracies, but I will be happy to add any suggested improvements that can make the text easier to understand.

I have also bundled the images from @Kusaki-Y in this release for those who have the game set to Chinese text. For anyone else (or if you are encountering issues), this release also contains a new "Repair Mode" that can be activated by starting the program with the --repair parameter. This will walk you through the steps needed to manually capture the relevant components of the game interface as they appear on your specific system.

Please try the latest version and let me know if you encounter further issues. These are substantial changes to the codebase, so I expect there will be issues as more people use it, but I hope you are able to find the core functionality restored with this update

mmexport1732720949761 Fixed the problem that the function recognition position is different from the position recognized when the program is run independently

Kusaki-Y commented 23 hours ago

Hello all, I have published a new release: https://github.com/little-fort/booster-bot/releases/tag/v1.6.0

This update contains my first attempt at localizing the program's text for Chinese users—you will be prompted to configure language selections on the first program start. The translations were made using Google Translate so I'm sure there will be many inaccuracies, but I will be happy to add any suggested improvements that can make the text easier to understand.

I have also bundled the images from @Kusaki-Y in this release for those who have the game set to Chinese text. For anyone else (or if you are encountering issues), this release also contains a new "Repair Mode" that can be activated by starting the program with the --repair parameter. This will walk you through the steps needed to manually capture the relevant components of the game interface as they appear on your specific system.

Please try the latest version and let me know if you encounter further issues. These are substantial changes to the codebase, so I expect there will be issues as more people use it, but I hope you are able to find the core functionality restored with this update

Another issue is that the second battle of the silver game in conquest mode is often not recognized. This may be a problem with silver-3.png.

Kusaki-Y commented 23 hours ago

Hello all, I have published a new release: https://github.com/little-fort/booster-bot/releases/tag/v1.6.0

This update contains my first attempt at localizing the program's text for Chinese users—you will be prompted to configure language selections on the first program start. The translations were made using Google Translate so I'm sure there will be many inaccuracies, but I will be happy to add any suggested improvements that can make the text easier to understand.

I have also bundled the images from @Kusaki-Y in this release for those who have the game set to Chinese text. For anyone else (or if you are encountering issues), this release also contains a new "Repair Mode" that can be activated by starting the program with the --repair parameter. This will walk you through the steps needed to manually capture the relevant components of the game interface as they appear on your specific system.

Please try the latest version and let me know if you encounter further issues. These are substantial changes to the codebase, so I expect there will be issues as more people use it, but I hope you are able to find the core functionality restored with this update

Perhaps the range of lbl-conquest-xxxx-3-preproc.png for the Chinese version needs to be reduced a bit, because there are dynamic special effects around the text, which causes the black pixels in the background of the screens image to keep changing and is different from the images in the reference folder.

Kusaki-Y commented 23 hours ago

Hello all, I have published a new release: https://github.com/little-fort/booster-bot/releases/tag/v1.6.0

This update contains my first attempt at localizing the program's text for Chinese users—you will be prompted to configure language selections on the first program start. The translations were made using Google Translate so I'm sure there will be many inaccuracies, but I will be happy to add any suggested improvements that can make the text easier to understand.

I have also bundled the images from @Kusaki-Y in this release for those who have the game set to Chinese text. For anyone else (or if you are encountering issues), this release also contains a new "Repair Mode" that can be activated by starting the program with the --repair parameter. This will walk you through the steps needed to manually capture the relevant components of the game interface as they appear on your specific system.

Please try the latest version and let me know if you encounter further issues. These are substantial changes to the codebase, so I expect there will be issues as more people use it, but I hope you are able to find the core functionality restored with this update

Maybe we can design a function that allows players to choose the image size themselves。Or set a function that can adjust the accuracy of program recognition.

Kusaki-Y commented 23 hours ago

Image_57140377175493 The pictures in the reference have been updated.