Skip to content

About

A local vision game agent for Apple Silicon. Screenshot perception, Laya/Core ML decisions, Qwen/MLX planning, camera control, loot clicks, and evidence-based review.

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

ScreenQuest — pixels in, actions out

Code license: MIT Apple Silicon Experimental Checks

A local vision agent that observes a game, presses keys, moves the camera, and clicks loot — then reviews what actually happened.

ScreenQuest explores responsive game control on a Mac using Hordes.io as a visual test environment. It combines screenshot perception, a small typed decision model, a slower vision-language planner, and explicit control rules. All model inference runs locally after the model downloads.

The long-term motivation is more complex games such as World of Warcraft. The current implementation is calibrated for Hordes.io, with a warrior using Slash in slot 1. It is an experimental harness, with demonstrated components and substantial navigation limitations.

Recorded ScreenQuest combat replay — click for the full video

Watch / download the 39-second gameplay demo · Architecture · Operator guide · Evidence & video provenance

The video replays genuine saved screenshots at their recorded timing, with cuts between combat, camera control, and a separate pickup test. It is sampled evidence rather than a continuous 30 fps capture. Chat is masked; captions explain the actions. See media provenance.

Combat replay with Slash and target health visible
Act and observe — verify the result of an ability.
Pickup replay with a confirmed 25-coin collection
Click and confirm — count a new pickup message.

What works today

Capability Observed result Boundary
Visual combat loop Enemy selection, approach and Slash inputs; repeated target HP decreases Reaching moving targets is inconsistent; HP changes do not prove exclusive damage attribution
Camera control Bounded right-drag yaw and pitch gestures Camera motion and attacks cannot overlap
Coin pickup One left click followed by the game's “You have picked up 25” message Verified in a separate pickup-only trial
Equipment recognition Ground-item tooltips recognized in captured frames Equipment collection has not been verified live
Post-run review Independent OCR of saved numeric HP and pickup messages Reports observations; does not infer kills from a missing target
Improvement loop One policy parameter changed, re-tested, then confirmed or rejected Parameter search, not model training; no claim of reliable improvement

Measured on an M3 Max with 48 GB memory

One completed 60-second run, with the game and models running together:

Measurement Result
Observed decision rate 8.96 / second
Screenshot → posted key event, median 77.21 ms
Screenshot → posted key event, p95 92.45 ms
Laya decision call, median 8.17 ms
Independently observed HP-drop windows 10
Camera gestures 12

These are measurements from one run, not a general benchmark or a guarantee. Latency stops at event posting, before the game responds. The slower Qwen planner runs asynchronously. Another 60-second run produced zero verified HP-drop windows. Selected measurements, including the unsuccessful run →

Architecture

flowchart TD
    Game[Visible Hordes.io window] --> Capture[ScreenCaptureKit: latest frame]
    Capture --> Vision[Apple Vision OCR + HUD / icon checks]
    Capture --> Planner[Qwen3.5 4B / MLX: slow visual proposals]
    Vision --> Policy[Combat, camera and loot rules]
    Planner --> Policy
    Policy --> Laya[Laya / Core ML ANE: typed allowed action]
    Laya --> Guard[Fresh-frame, focus and input-overlap checks]
    Guard --> Input[Short key pulses / mouse gestures / clicks]
    Input --> Game
    Vision --> Evidence[Timestamped screenshots + events]
    Input --> Evidence
    Evidence --> Judge[Independent post-run screenshot review]
    Judge --> Coach[One parameter candidate + confirmation trial]
    Coach -. bounded policy settings .-> Policy
Loading

The key design choice is separating perception from decisions. Laya consumes compact text state and allowed choices; it does not see images. Apple Vision and visual checks produce the fast state, while Qwen supplies slower image-based proposals. Explicit rules often narrow a decision to a single action, so a low Laya latency alone is not evidence of learned gameplay skill.

The fast path never waits for a new Qwen response. Capture and workers keep the latest result, and the dispatcher revalidates the screen immediately before posting input. A separate judge reads the recorded evidence after all inputs have been released. Detailed architecture →

Quick start

Requirements: Apple Silicon Mac, macOS 15+, Python 3.11–3.13, uv, regular Google Chrome, and a Hordes.io character. The tested machine has 48 GB unified memory; smaller machines have not been characterized.

git clone https://github.com/DanielTea/screenquest.git
cd screenquest
uv sync --extra desktop --extra fast --group dev
cp configs/fast_config.example.json configs/fast_config.json

# Download the pinned Laya bundle and warm Core ML.
uv run --extra desktop --extra fast python -m screenquest.fast prepare
  1. Open Hordes.io in regular Chrome and sign in manually. Enter the world with a warrior and Slash in slot 1. Keep one game window visible; close chat, menus and inventory.
  2. Give the application launching Python Screen Recording and Accessibility access in macOS System Settings, then restart that application if requested. Use the existing signed-in Chrome session.
  3. Calibrate the visible game, then observe without input:
uv run --extra desktop --extra fast python -m screenquest.fast calibrate
./scripts/start-fast.command --seconds 15
  1. Start a bounded interactive trial, then click inside the game when prompted:
./scripts/start-fast.command --execute --seconds 30

Stop: press Ctrl-C in the launching terminal, switch away from the game, or create a STOP file in the repository. Remove that file before another run. Inputs are released on exit. Recalibrate after changing the window size or browser toolbars.

The calibration seed is a known warrior HUD, not a universal game detector. Other classes, abilities, UI layouts or games require new templates and policy work. The first Qwen use downloads its model; initial Core ML compilation can take tens of seconds.

Play → judge → tune → re-test

./scripts/start-coach.command --execute --rounds 3 --seconds 30

The coach compares a baseline with a single timing change, then requires a successful confirmation round before retaining it. It cannot tune away focus, frame-age, health or target-identity checks. Three rounds without verified combat progress stop the session.

# Inspect an existing run; no game input.
uv run --extra desktop --extra fast python -m screenquest.coach review runs/RUN-DIRECTORY

# Targeted pickup test: focus the game with nearby loot visible.
uv run --extra desktop --extra fast python -m screenquest.loot_probe --execute --seconds 25

# Unit and visual regression tests; no gameplay input.
uv run --extra desktop --extra fast pytest -q

Every live run writes events.jsonl, screenshots, timing summaries, and browsable reviews under runs/. Local calibration, model caches, browser profiles and session evidence are excluded from Git. Operating details and troubleshooting →

Inside the repository

screenquest/
├── screenquest/       # Python package: controllers, perception, policy and judge
├── configs/           # Portable configuration example; local calibration is ignored
├── scripts/           # macOS launchers and demo rendering
├── assets/            # Calibration templates
├── tests/             # Unit tests, visual fixtures and shared helpers
├── docs/              # Architecture, operations, evidence and demo media
└── .github/workflows/ # Automated quality checks

The root contains only the README, contribution guide, license and project metadata. See the package map for individual modules.

For linting, formatting and tests without loading models, see CONTRIBUTING.md.

Limits and next experiments

  • Navigation still fails on some encounters. Better visual tracking and action-conditioned movement estimates are the next priority.
  • Only populated, calibrated abilities should be used. This character's slots 2–4 were empty; the agent does not invent abilities.
  • Coin collection is demonstrated once. Equipment pickup, health-based retreat and recovery need broader controlled trials.
  • A newly visible pickup message is evidence of collection. A posted click alone earns no pickup credit.
  • No verified WoW play, quest completion, inventory management, equipping, trading or purchasing is implemented.
  • Gameplay perception uses screenshots rather than DOM, memory or network state. OS accessibility is used only for input-focus checks, and the optional original browser harness uses Playwright for browser control.
  • Use environments where automation is permitted. ScreenQuest is not affiliated with or endorsed by Hordes.io or Blizzard.

Credits and licensing

Inspired by the Jev harness discussion. The implementation uses Laya, Laya CoreML, the multilingual ANE bundle, and Qwen3.5 4B for MLX through MLX-VLM.

Original ScreenQuest code is MIT licensed. Models and dependencies keep their own licenses and are downloaded separately. Hordes.io visuals, UI excerpts and gameplay footage belong to their respective rights holders; the code license does not relicense those assets. See third-party notices.

About

A local vision game agent for Apple Silicon. Screenshot perception, Laya/Core ML decisions, Qwen/MLX planning, camera control, loot clicks, and evidence-based review.

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages