# Astra plays GTA Vice City Let GPT-6 Astra try the helicopter mission on your Mac. It plays through screenshots and keyboard/mouse input, pausing between moves to think. [Watch the attempt](https://x.com/yuntiandeng/status/2096346317479870830): one bomb planted, helicopter destroyed. Includes the setup, a copy-paste prompt, a control helper, and a mission-ready save. **Playing the classic PC version on Windows or through Whisky?** Download my [manual save and loading instructions](checkpoint/windows.md). The control helper and setup below are for the iPad version on macOS. ## Requirements - An Apple Silicon Mac running macOS 15 or later. I used a MacBook Air. - The **original iPad version of [GTA Vice City](https://apps.apple.com/us/app/grand-theft-auto-vice-city/id578448682)**, installed on the Mac. - **GPT-6 Astra** in a desktop agent with local terminal and image access. I used the Codex desktop app. The game and helper run on your Mac; Astra runs through your agent service. ## 1. Enable keyboard controls In the macOS menu bar, choose **GTA Vice City → Settings → Game Control** and enable controller emulation. Check the keyboard mapping; the prompt includes the controls from my setup. ## 2. Build the helper Run these commands in your agent's terminal: ```sh git clone https://github.com/da03/astra-plays-gta.git cd astra-plays-gta xcrun swiftc -parse-as-library -O -target arm64-apple-macos15.0 -module-cache-path .build/module-cache game.swift -o game ./game doctor --request ``` If `xcrun` asks for developer tools, run `xcode-select --install`, then retry the build. In **System Settings → Privacy & Security**, allow **Accessibility** and **Screen Recording** for your desktop agent. Restart it if macOS asks, then run `./game doctor` again. If you also run the helper from Terminal, grant those permissions to Terminal too. ## 3. Start at the helicopter mission Already have **Demolition Man** available? Load your own save. Otherwise, launch the game once, **quit it**, then install the included checkpoint: ```sh python3 install_checkpoint.py ``` The installer requires Python 3. It finds the game's save folder, backs up existing saves, and adds the checkpoint to an **empty local slot**, preserving occupied slots and the autosave. Reopen the game, choose **Load Game**, and select **Four Iron** in the slot the installer prints. The autosave appears above the numbered slots. Demolition Man starts automatically; after the cutscene, head to the marked Top Fun van. [Checkpoint details](checkpoint/README.md). ## 4. Let Astra play Open this folder in your desktop agent, select GPT-6 Astra, and paste **[PROMPT.md](PROMPT.md)**. You can enter the van yourself or let Astra navigate there.
Controls, how pausing works, and troubleshooting ### Keyboard controls My setup uses WASD on foot, E to enter/exit a vehicle, A/D to steer a car, and Space to accelerate. In the RC helicopter, Space raises it, Q lowers it, and Tab drops a bomb. Check pitch and turning with short inputs before picking up a bomb. ### Think while paused The loop is **pause, think, move, repeat**. Pausing keeps the mission timer stopped while Astra decides its next move. The agent first takes a screenshot and identifies two buttons: the minimap that opens the pause/map screen, and the button that resumes gameplay. It stores their positions with `./game configure`. Coordinates are fractions of the **game window**, so moving the window is fine; recalibrate after resizing it. For each move, Astra runs: ```sh ./game step '[{"keys":["space"],"seconds":0.25}]' frame.png ``` Starting with the game paused, this **unpauses, holds Space briefly, releases it, captures the gameplay, and pauses again**. It writes `frame.png` for the decision and `frame.paused.png` to check that the pause worked. Astra inspects them while the game is paused, then chooses the next move. The move-and-pause sequence happens in one local call. ### Helper commands Run `./game help` for all commands. Useful ones: ```sh ./game snapshot frame.png ./game keys w 0.3 ./game click 0.5,0.5 ./game drag 0.7,0.5 0.5,0.5 0.3 ./game check '[{"keys":["space","a"],"seconds":0.2}]' ``` `snapshot` and `check` send no input. `keys`, `click`, and `drag` are for calibration/navigation and **do not pause automatically**. Only use `step` once the pause/resume buttons are verified and the game is already paused. Keep calls sequential. Switching away from the game stops an in-progress input; check the pause state before resuming. The helper targets the Vice City app by default, limits each key step to 3 seconds and each move to 10 seconds, and releases held keys on normal completion or errors. Its source is [game.swift](game.swift). ### Tests and checkpoint options To test the helper's command validation without opening the game: ```sh python3 -m unittest discover -s tests -v ``` To preview checkpoint installation without writing anything, run `python3 install_checkpoint.py --dry-run`. If auto-detection finds multiple installations, use `--directory "/path/to/the/game/Data/Documents"`. An optional `--slot 1` selects a specific empty local slot; slots 7–8 are cloud slots and are never used. Backups are stored in the game's Documents folder with names beginning `astra-backup-`.