[Bug] 隐秘海域剧情二选一后舰队已离开海域,map_exit 一直等待 MAP_EXIT 导致 GameStuckError

Open
#6,192 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
game-dev

Research direction

Read module/os/tasks/obscure.py at clear_obscure() and module/os/map_operation.py at map_exit(). Trace how the post-story choice and auto-search flow determine whether the fleet is still in a special zone before calling map_exit(). Reproduce the reported flow and verify that an already-exited fleet continues without a GameStuckError, while normal map exit still works.

Written by the indexing model from the issue text.

Description

在提问之前...
  • 我已经搜索了现有的 issues
  • 我在提问题之前至少花费了 5 分钟来思考和准备
  • 我已经阅读了 Wiki 中的 常见问题(FAQ)
  • 我正在使用最新版的 Alas
描述你的问题

日服,OpsiObscure。隐秘海域的最后一战结束后出现剧情二选一,Alas 按 STORY_OPTION=0 选择第一项,舰队随后通过传送门离开隐秘海域,直接回到相邻的普通海域。

clear_obscure() 在 run_auto_search() 之后无条件调用 map_exit()。此时已经不在隐秘海域,画面上没有 MAP_EXIT(撤退)按钮,map_exit() 的循环里没有任何可以点击的东西,也不会满足 changed and is_in_map(),60 秒后 GameStuckError: Wait too long,游戏被重启。

这个流程在 2026-10-17 和 2026-11-21 各出现了一次,不是偶发的识别问题。相关代码在 master 46c82db58 中没有变化(module/os/tasks/obscure.py clear_obscure(),module/os/map_operation.py map_exit())。

如何复现
  1. 运行 OpsiObscure
  2. 隐秘海域最后一战后出现剧情二选一(选项后舰队经传送门离开海域)
  3. Alas 进入 map_exit(),一直等待 MAP_EXIT
  4. 60 秒后 GameStuckError
预期行为

已经不在隐秘海域时,跳过 map_exit() 继续执行。

相关 Logs
2026-10-17 15:32:17.167 | INFO | Combat end.
2026-10-17 15:32:18.180 | INFO | [Story_options] 2
2026-10-17 15:32:18.585 | INFO | Click ( 803,  306) @ STORY_OPTION_1_OF_2
2026-10-17 15:32:20.593 | INFO | Click ( 660,  681) @ MAP_WORLD
2026-10-17 15:32:24.402 | INFO | Click (1235,  539) @ AUTO_SEARCH_OS_MAP_OPTION_OFF
2026-10-17 15:32:25.400 | INFO | Click ( 645,  609) @ AUTO_SEARCH_REWARD
2026-10-17 15:32:30.234 | INFO | OS auto search finished
2026-10-17 15:32:30.314 | INFO | MAP RESCAN CURRENT
2026-10-17 15:32:32.111 | INFO | Map rescan once end, result=False
2026-10-17 15:32:32.123 | INFO | <<< MAP EXIT >>>
2026-10-17 15:33:29.041 | INFO | Function calls:
      obscure.py  L39 clear_obscure()
map_operation.py L244 map_exit()
2026-10-17 15:33:29.050 | WARNING | Waiting for {'AUTO_SEARCH_REWARD', 'FLEET_1', 'GET_MISSION', 'MAP_EXIT', 'GLOBE_GOTO_MAP', 'MAP_WORLD', 'POPUP_CANCEL', 'MAP_ARCHIVES', 'STORY_CLOSE', 'STORY_SKIP_3', 'POPUP_CONFIRM', 'POPUP_CONFIRM_WHITE', 'OS_GAME_TIPS', 'AUTO_SEARCH_OS_MAP_OPTION_OFF', 'STORAGE_CHECK', 'GUILD_POPUP_CONFIRM'}
2026-10-17 15:33:29.148 | ERROR | GameStuckError: Wait too long

2026-11-21 同样的流程(这次带着下面的本地修改,所以没有卡住):

2026-11-21 00:19:34.656 | INFO | [Zone] [54|Southeast Ocean Ridge D]
2026-11-21 00:20:22.081 | INFO | Click ( 554,  308) @ STORY_OPTION_1_OF_2
2026-11-21 00:21:09.575 | INFO | Click ( 663,  298) @ STORY_OPTION_1_OF_2
2026-11-21 00:21:16.197 | INFO | Click ( 680,  627) @ AUTO_SEARCH_REWARD
2026-11-21 00:21:21.025 | INFO | OS auto search finished
2026-11-21 00:21:22.859 | INFO | <<< MAP EXIT >>>
2026-11-21 00:21:25.896 | WARNING | No MAP_EXIT in map, assume already exited
2026-11-21 00:21:25.979 | INFO | [Zone] [7|Dakar]
截图

卡住时的画面(已经在普通海域「南西海嶺C」,没有撤退按钮):(截图见下方评论)

还有别的吗?

本地使用的修改:如果从进入 map_exit() 开始一直没有见过 MAP_EXIT,并且连续 3 秒(至少 6 张截图)都在大世界地图中,就认为已经离开,直接结束循环。见过一次 MAP_EXIT 之后的行为不变。

--- a/module/os/map_operation.py
+++ b/module/os/map_operation.py
@@ def map_exit(self):
         logger.hr('Map exit')
         confirm_timer = Timer(1, count=2)
         changed = False
+        exit_seen = False
+        already_out_timer = Timer(3, count=6).start()
         for _ in self.loop():
@@
             if self.appear(MAP_EXIT, offset=(20, 20)):
                 confirm_timer.reset()
+                exit_seen = True
@@
                 changed = True
                 continue
+            if not exit_seen and self.is_in_map():
+                if already_out_timer.reached():
+                    logger.warning('No MAP_EXIT in map, assume already exited')
+                    break
+            else:
+                already_out_timer.reset()
 
         self.zone_init()

这个修改只看「没有 MAP_EXIT」,如果在特殊海域里 MAP_EXIT 因为某种原因没有识别到,也会误判为已经离开。更稳妥的做法可能是确认已经在普通海域(例如重新识别海域名或海域类型)后再跳过,或者在调用方 clear_obscure() 里,等画面稳定后只在 is_in_special_zone() 时才调用 map_exit()。

Dominant language
Python
Stars
9.8k
Forks
1.2k
Avg merge
18h 42m
Merged PRs (30d)
33

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LmeSzinc/AzurLaneAutoScript

All issues in LmeSzinc/AzurLaneAutoScript

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.