Lumine2 Client
Windows game interaction and real-time evaluation
English · 简体中文
Overview · Quick start · Installation · Configuration · Server
Capture the current game screen, request the next action from the model server, and execute the returned keyboard and mouse input. The game keeps running while inference and execution overlap; each step is logged with its result and timing.
**Requirements:** Windows · Python 3.10+ · An open game · A reachable model server.
## 1. Quick Start
### 1.1 Install Client
In **Windows PowerShell**, enter the checkout’s `client/` directory and run:
```powershell
powershell -ExecutionPolicy Bypass -File .\install.ps1
```
Installer steps: **prepare Python → install Client → check the entry point**, with bilingual step comments and progress messages.
Continue after `Client installation complete` appears.
### 1.2 Prepare Your Game
Choose a game with an existing system prompt in [prompts/games/](prompts/games/). For another game, first write its `prompts/games/.txt`; see [adding a game](docs/CONFIGURATION.md#prompts) for the format.
Start Server using the [root guide](../README.md#server-setup). Open your game and enter a playable scene. You can save the task and game process name in [config.json](config.json) beforehand.
### 1.3 Start Playing
Return to the same Windows PowerShell terminal and run from `client/`:
```powershell
$env:MODEL_API_URL="http://127.0.0.1:8000/v1/chat/completions"
.\.venv\Scripts\python.exe run.py `
--process-name "Cyberpunk2077.exe" `
--game "cyberpunk_2077_en" `
--instruction "Progress through the main storyline" `
--start-delay 5 `
--max-steps 0 `
--execution-data-path "execution_data/cyberpunk2077_run1.jsonl"
```
Match the API port to Server in step 2. `--start-delay 5` waits five seconds before control begins; `--max-steps 0` runs until you stop it manually. `--execution-data-path` selects the log file. Use a new filename for each test; reusing one appends records.
**Ready when:** the terminal shows the task and server configuration, and the game starts executing actions.
Client connects to the already-running service specified by `MODEL_API_URL` and loads the Cyberpunk 2077 prompt. Switch to the game window during the countdown; stop with **Ctrl+F12** or **Ctrl+C**. Set tasks and process names in [config.json](config.json), or use `--game`, `--instruction` and `--process-name`.
For a separate Linux server, replace `MODEL_API_URL` in the example with `http://:/v1/chat/completions`, matching the server port. See [installation](docs/INSTALL.md) for the full workflow and logs, and [connection settings](docs/CONFIGURATION.md#connection) for connection options.
## 2. Find the Details
| Your task | Documentation |
|---|---|
| Install, connect, start and stop | [Five-step installation guide](docs/INSTALL.md) |
| Set the server address, task and keys | [Connection](docs/CONFIGURATION.md#connection) · [Game settings](docs/CONFIGURATION.md#games) |
| Look up all startup options | [Command-line arguments](docs/CONFIGURATION.md#command-line) |
| Understand Reasoning / Instant or add a game | [Modes](docs/CONFIGURATION.md#modes) · [Prompts](docs/CONFIGURATION.md#prompts) |
| Inspect focus handling, retries and logs | [Runtime notes](docs/INSTALL.md#step-4) · [Logs](docs/INSTALL.md#step-5) |
The client reads the operating mode from the server; no extra mode flag is needed. Logs default to `execution_data/` when run from `client/`.
## 3. Source Map
Expand directories and module responsibilities
```text
client/
├── install.ps1 Environment and dependency setup
├── lumine2_client/
│ ├── run.py Real-time evaluation scheduler
│ ├── cli.py Arguments, prompt assembly, placeholder replacement and startup
│ ├── paths.py Configuration and resource paths
│ ├── config.py Read, validate and apply config.json
│ ├── step_log.py Asynchronous JSONL logging
│ ├── model/
│ │ ├── client.py HTTP, server validation, history cache and connection cleanup
│ │ ├── inference.py Frame encoding, single-step inference, results and interruptions
│ │ ├── interruptible.py Interruptible client wrapper; resets once at startup
│ │ └── action_protocol.py Action parsing, mouse splitting, key mapping and timing constants
│ └── env/
│ ├── game_env.py Gymnasium wrapper: capture, focus and timed action execution
│ ├── windows_input.py Keyboard, mouse buttons, relative movement and scrolling
│ └── stop_hotkey.py Ctrl+F12 and the shared stop event
├── prompts/ Game prompts and mode endings
├── config.json User configuration
├── docs/ Installation and configuration
├── tests/ Package and installer tests
└── run.py Python command-line entry
```
Dependencies flow from `run` → `cli` → `config` / `model` / `env`. `lumine2_client/model/action_protocol.py` is shared by `run`, `cli`, `config` and `model`, and defines the prompt-aligned `OBS_FPS`, `ACTION_FPS` and `NUM_CHUNK` timing constants. `env` does not depend on the other project modules. `game_env.py` includes the high-precision `ActionTimer`.
After restructuring the package or changing its command entry point, rerun `python -m pip install -e .`.
## 4. License
Original Lumine 2 code and documentation are licensed under the [Apache License 2.0](LICENSE). Third-party dependencies retain their respective licenses and copyright notices.