GitHubGet started
← All use cases

A game player

Plays OpenTTD while you watch over VNC.

Python · Node.js · Rust

examples/gameplay
The gameplay agent building a transport company in OpenTTD

It runs a transport company

It finds towns and cargo, builds roads, stations and airports, and buys vehicles, through the skill's ttd.py.

ttd.py, its game commands
  • towns --limit 5largest towns first
  • road FROM TObuilds the road
  • depot PLACEwhere vehicles are bought
  • buy --depot X,Y --engine IDvehicles, with their orders
  • wait DAYSlets the game run, then reports

It looks before it decides

It screenshots the map and reads it, and checks reports for idle vehicles and cargo piling up.

what it checks
  • look PLACEa screenshot it reads
  • reportidle vehicles, cargo piling up
  • stationswhat waits, and the ratings
  • vehiclesprofit this year and last

You watch it play

The game runs in its own VM. Open the VNC address to watch, with the password openttd.

the game's microVM
  • debian:trixie-slimwith OpenTTD; the display abin serves its screen
  • vnc://localhost:5901watch it, password openttd
  • OPENTTD_YEARS3 years by default
  • /artifactsnotes, screenshots, saved games

Run it

git clone https://github.com/brekkylab/ailoy
git clone https://github.com/brekkylab/ailoy-examples
cd ailoy-examples/gameplay/python
uv run main.py
needs a logged-in Claude Code, Codex or Gemini CLI, or an API key

Run your first agent
in its own microVM

Install the package, name a model and run it