Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Build a Recoverable Android Game Automation Loop with State, Pause, and Resume

Описание и применение

Создайте устойчивый цикл автоматизации Android‑игры, разделив навигацию, наблюдение и обработку, используя явные состояния, паузы и подтверждение действий, а также фиксируйте доказательства при ошибках.

Задача

Linear game automation macros fail when screen timing or target positions change, causing drift or missed actions.

Результат

Automation becomes resilient to timing and target changes, reduces drift, and provides reproducible evidence for failures.

Рабочий процесс

  • 1. Define a Navigation Map service with state, progress, and position data.
  • 2. Implement a small state machine (idle, moving, paused, completed, stuck, lost, error).
  • 3. In the orchestration loop, query router.status() to decide actions based on state and observations.
  • 4. When a target is detected, pause navigation, re-observe if needed, handle the target, verify a concrete postcondition, then resume navigation.
  • 5. Keep retries bounded at the narrowest layer with a maximum attempt count and exit state.
  • 6. Separate stuck time from handling time so pauses and waits do not count as failures.
  • 7. On lost or error states, capture evidence (screenshot, map ID, progress, position, confidence, etc.).
  • 8. Test all edge cases: target during movement, invalid target after pause, pause without active route, duplicate continue, map switch, stop when idle, completion, confidence collapse, forbidden target, recovery success.
  • 9. Use UI Automator’s performActionAndWait or similar condition-based synchronization instead of arbitrary sleeps.

Доказательства

The fragile version of Android game automation is a long linear macro: move -> wait -> detect -> tap -> wait -> move -> repeat

Источник

Use explicit state transitions

Источник

Pause before acting on a moving screen

Источник

  • Дата записи: 2026-09-21T15:30:43.600Z