Airline Tycoon
Mine · Everything · 2026 — MIT
Airlines Manager is a browser game where you run an airline. You buy aircraft, buy routes, and then — every week — assign each plane to a schedule of flights across a 900-second slot grid.
That last part is not a game. It is a bin-packing problem with money attached, and doing it by hand across several hubs and a few dozen aircraft takes an evening you will never get back.
So I wrote the optimizer. It reads your planning, works out a better schedule, and can push it back to the game.
What it does
It discovers your hubs from the planning page — nothing hardcoded — then snapshots each one to disk so a run can be replayed offline. It models only the routes you actually own from that hub, works out what each aircraft can fly given range and airport category, and then optimises each hub independently on the 900-second grid: economy fill first, a per-day overshoot cap, a utilisation floor, a sell threshold.
The detail that decides the whole model: demand is daily. Seven independent pools, not one weekly number. Get that wrong and every schedule you produce is confidently, quietly bad.
Beyond a single hub it does two more things. Rebalance tries virtual hub moves across your whole network before allocating, so an aircraft sitting idle in the wrong city gets found. Advice ranks what to buy, what to reconfigure and what is surplus.
Writes are opt-in
Everything that touches the game is dry-run until you pass --apply. Reads never change anything.
bun run optimize # download, plan, write an HTML report
bun run apply -- --hub LHR # show the POSTs it would send
bun run apply -- --hub LHR --apply
That is a deliberate default, not caution for its own sake. A tool that automates writes against
somebody else’s system should make you type the extra word. And --offline cannot be combined
with --apply at all — replaying a cached snapshot must never be able to push a stale schedule
into a live account.
There is one physical constraint the code has to respect: an aircraft in the air cannot change hub. So a hub move fails cleanly rather than half-applying, and you re-run once the plane lands.
How it is built
TypeScript on Bun. A shared library under src/lib/ — HTTP, model, optimizer,
rebalance, reports — with src/cli/ holding one file per command, so every entry point is a thin
wrapper over a function you can test.
The optimizer knobs live in one file: UTIL_FLOOR, ECO_OVERSHOOT_CAP, SELL_THRESHOLD,
BUY_CATALOG. Anyone who wants a more aggressive schedule changes four constants rather than
reading the allocator.
MIT licensed. Not affiliated with Airlines Manager or its publishers.
Why
I wanted to play the game, and then discovered the part I actually enjoyed was the allocation problem underneath it. This is what came out.
TypeScript · Bun · CLI