-
Notifications
You must be signed in to change notification settings - Fork 1k
Feat: High resolution support #5433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
AzureG03
wants to merge
19
commits into
LmeSzinc:dev
Choose a base branch
from
AzureG03:1080p
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
包含前置科技 #5388
实现原理
目前UI识别是直接通过模板匹配实现的,对于文字按钮,比如宿舍计划界面的”选择宿舍“、”宿舍商店“,大世界的”深渊海域“、”塞壬要塞“等识别,在1080p或更高分辨率的情况下效果不佳
利用OCR替换模板匹配,再小幅降低Button的匹配阈值,可以在尽可能复用已有的Assets的情况下,允许Alas在高分辨率下运行
button_extract.py看到有OCR的相关实现,但是似乎没有实际使用?在修改尽可能小的前提下,目前的实现是为Button添加text属性
在Alas设置处开启高分辨率支持时,拥有text属性的Button在调用match方法时会优先使用OCR方法,若OCR结果在text属性中,则判断match成功。Button作为Resource没有config属性,为了使用Config.when注解,目前是在 alas.py:loop 方法内为Button注入config
单纯的textbutton实现在 AzureG03:textbutton
测试效果
挂了半个月,1080p情况下基本满足日常收菜,大概包括:委托、大世界、每日、演习、后宅、宿舍计划、商店、活动(自律)、主线(自律)、学院、舰队、科研、小游戏
其他功能如指挥猫、作战档案、开发船坞等,功能没开,不知道能不能用
更高分辨率如1440p简单试了下也能跑,不过超过1080p带来的提升太小,只是知道能跑,
需要小白鼠服务器适配
目前仅适配了CN服,理论上PPOCR支持多语言识别,国际服、日服、台服只需要为button对应的图片增加text属性即可,文件命名为
${ButtonName}.TEXT.txt,可放在任意服务器目录下,最后会合并到一起,也可以像PRIVATE_QUARTERS_CHECK.TEXT.txt一样放在一起使用注意事项
不过现在好像没看到这个设置,记得以前有