Skip to content
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

Fix: campaign_ensure_chapter incorrect due to slow animation #3676

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Air111
Copy link
Contributor

@Air111 Air111 commented Apr 24, 2024

修复选择3-4但由于将13-4识别为3-4而出击13-4的问题

Comment on lines 47 to 55
if diff == 0:
break
# index=4, current=4, actual=14
error_confirm_2.start()
if not error_confirm_2.reached():
continue
else:
break
else:
error_confirm_2.clear()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在正常流程中不应有多余的截图或等待
正常流程指,预期切换到3图 实际也是3图,不需要切换章节的情况

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

预期(index)切换到3图 实际(actual)也是3图,这样和“不正常”的流程一样index=3, current=3,除了多截一次图没有其他办法可以确定current==actual

@Air111 Air111 force-pushed the campaign_ensure_chapter branch from 5baad52 to 9c37bf4 Compare April 24, 2024 13:22
@Air111
Copy link
Contributor Author

Air111 commented Apr 24, 2024

减少一个timer,这样测着没啥问题。我们永远无法得知实际(actual)值,只能通过多截图/等待来增大current=actual的概率

while True:
    self.device.click_record_clear()
    self.ui_goto_main()
    self.campaign.campaign_set_chapter_main('13')
    self.ui_goto_main()
    self.campaign.campaign_set_chapter_main('13')
    self.ui_goto_main()
    self.campaign.campaign_set_chapter_main('3')

@LmeSzinc
Copy link
Owner

LmeSzinc commented May 1, 2024

在正常流程中不应有多余的截图或等待

需要解决这个问题,否则PR不会被接受

@LmeSzinc LmeSzinc added the bug / 缺陷 Something isn't working label May 1, 2024
@Air111
Copy link
Contributor Author

Air111 commented May 1, 2024

在正常流程中不应有多余的截图或等待

需要解决这个问题,否则PR不会被接受

不理解什么是“正常流程”。无论是从主界面还是点击上一章/下一章进入某一章都会有动画加载过程,此时第一次识别chapter_index为3根本无法得知真的是3,还是其实是13没加载完全。除非引入其他识别方式(cross-check或者完全替代),例如这个位置的“第3章”没有加载动画,但是这与活动图不兼容(比如这次sp和isp都是E.X.),也因此没法解决可能存在的将isp识别为sp的问题。

我知道这个识别错误是小概率事件,但提这个pr前一天晚上出现了选错章节作战失败重启后又选错一次(还好没有第三次),有点没绷住

@ec7529a2
Copy link

ec7529a2 commented May 1, 2024

想要没有多余的截图或等待,就要有“多余”的ocr和多服务器适配,或者“多余”的错误和重启。
对于主线第3章来说,识别“决战中途岛”就行了,对于这次活动(μ兵装三期)的sp,isp,μsp,ex来说,分别识别“共鸣的Passion”,“共鸣的Passion・进阶”,“共鸣的Passion・SP”,“共鸣的Passion・EX”就行了,其它章节和服务器以此类推。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / 缺陷 Something isn't working 需要修改 / Request changes Changes required in PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants