Skip to main content
Runtime engineering · Private game server · 2026

Game Agent Prototype

I built a self-hosted runtime that keeps a game character playing on its own: a headless client, deterministic control, and a supervisor that fixes the one broken piece without restarting the rest.

Python source modules
40
tables in the SQLite event and state schema
56
missing targets in a level-10 equipment provisioning run
0

The problem

A game client is a fragile thing to automate: it crashes, its server sessions go stale, and its telemetry is noisy. Restarting everything on every hiccup throws away healthy state.

What changed

The runtime turns the client's telemetry into dependable state, drives the character through deterministic rules, and recovers only the component that failed. Recorded operation showed map login and a level-10 provisioning run that converged with nothing missing.

How it's built

Role
Application architecture, implementation and server operations
Environment
Private Final Fantasy XI server and headless game client
Stack
Python, Lua, SQLite, Linux, Wine, Xvfb
Status
Implemented and run on a private server

Operate the client and server

LandSandBoat ran the private game server and Wine with Xvfb ran the headless client under Linux process supervision. A Windower Lua addon published heartbeat and game-state events through an append-only bridge. Python workers evaluated that state and wrote prioritized commands back, and the Lua layer deduplicated and scheduled them within the game's input-rate limit, recording failures as new events.

Keep game actions deterministic

Movement and party-follow behavior used explicit state and proximity rules. Healing and resource recovery ran through separate policies with action locks, cooldowns and retry backoff, and circuit breakers bounded repeated failures. Character provisioning reconciled client snapshots against authoritative server data, checked equipment and spells against the local catalog, and applied a level-aware policy. Direct commands were isolated from chat so generated language could never trigger a game action.

Recover the failed component

The supervisor checked process health, heartbeat freshness, event-stream progress and server-session evidence, and told a dead client apart from a server failure. Grace periods and cooldowns prevented restart storms. When needed, relog automation cleared only the stale server session and restarted the client path while healthy server processes kept running.

Persist evidence and bound model access

The recorder filtered noisy telemetry, tagged important events and kept its place in the stream. SQLite stored sessions and events, with summaries linked back to their sources. Model context came from bounded transcripts and source-backed records through small read-only searches, and output that broke the response contract was quarantined.

A provider-neutral router handled structured OpenAI and Anthropic requests with budget auditing, per-domain cooldowns and missing-key refusal. Model availability never decided whether the deterministic workers could control the client.