The Tin Road's title screen in chunky pixel art: THE TIN ROAD in bronze letters over a sunset, and the crew of four walking a dirt road toward the mountains, TAP TO START underneath.
games8 min read

The Tin Road: a pixel RPG built one pull request at a time

The Tin Road is a SNES-style expedition RPG for your phone: a crew of four, a flooded tin mine, a pack you arrange by hand, and twelve Seals. Here is a minute of it, filmed a frame at a time, and how it was built: 26 pull requests in three days, rules that never touch the screen, art and music drawn in code, and balance you can diff.

The Tin Road is a pixel-art RPG that runs in a phone browser. Bronze is copper and tin, nothing has come down the Tin Road since spring, and the three people who went up to the mine never came back. The Elder of the Waystation sends four more: Tarku the guard, Nidda the sapper, Ebbu the scribe and Zuwa the diviner. You take them down four floors of an old tin mine, one room at a time, with a pack you arrange by hand and only as much light as you brought. The minute below is the whole game, top to bottom.

1:02, vertical. Gameplay is the real game, played by a script and filmed a frame at a time. No sound: the game makes its own in your browser. Play it, or watch it on the Films channel.

The Tin Road in a minute, vertical, captions on. Every shot is the real game on a phone-sized screen, played by the game's own end-to-end playthrough and filmed one frame at a time. It is silent because the game makes its music live in your browser and nothing here records it.

A mine you pay for in light

The first plan was a combat game with an inventory. The first decision I made was to turn it around: exploration and the pack lead, and fights support them. Magic points went away, and the cost of going deeper moved onto things you can see. Every step through the dark costs light. Food and water become health at a camp. Tools open the way: a rope crosses a gap, a pick breaks a weak wall, a wedge holds a door, and most of them are used up.

The pack is six cells by five, and you place things in it yourself. Only the top row can be reached in a fight, and the same reach holds for tools, so the way you pack is the way you play: the rope has to be moved up into that row before the flooded stair, and it then takes a cell a bandage could have had. The design file names three pillars, and the game holds to them: every room is a decision, the pack is the build, and the world fills the screen.

What shipped is four floors and thirty rooms (the Upper Workings, the Flooded Level, the Deep Seam and the Sump), a one-room town, eleven items, six enemy types with the boss among them, and twelve Seals. A Seal rewrites one skill. You set them on the crew from the CREW tab, and the film shows the first one going onto the Guard's strike.

Rules that never touch the screen

All of the game's rules live in one folder, src/sim, and that folder is not allowed to know there is a screen. It never imports Phaser and never touches the page; a lint rule fails the build if it tries. Its functions take a state and give back a new one, and when a move is not allowed they say why by name instead of throwing.

There is one random number generator, seeded from the trip, and the rules use it only for which attack an enemy picks. Everything else, walking, light, the pack, the town, is plain arithmetic. So any expedition or fight replays exactly from its seed, and the tests can play long games without a browser.

The content is not in the code at all. Rooms, items, enemies, songs, hints and dialogue are JSON files, each checked against a schema when the game builds, and cross-checked too: every room has to be reachable and the starting pack has to fit. A bad file does not make a strange game; it makes no game.

js
// Every scene publishes what it is doing on the page, so a test reads state, never pixels.
await tap(page, 'stairs');                      // a real touch, at the spot the game reports
await expect(body).toHaveAttribute('data-ring', 'ENTER THE MINE');
await tap(page, 'ring:0');
await expect(body).toHaveAttribute('data-floor', 'mine-1');

// In a fight, the game will say what a careful player would do next.
const advice = await page.evaluate(() => window.__tinRoad.advise(['torch', 'lamp']));

Everything is drawn and played by code

There are no image files made by hand and no audio files at all. Every sprite, all five tilesets and the floor maps are drawn by scripts in the repository; the rule is to change the script and run it again, never to edit a picture. Everything uses one palette of 64 colors, eight ramps of eight (ink, bronze, earth, fire, lapis, cedar, clay and tin), and the lint step fails on a single pixel outside it. The text is a 5 by 7 bitmap font drawn in code, and the big headings are that same font enlarged by pixel-art corner rules rather than a second font.

The music is seven songs and eighteen sound effects written as note patterns in a few kilobytes of JSON: up to four voices each, square, triangle, sawtooth and noise, played by a small synthesizer in the browser. That is also why the film is silent. The sound only exists while the game is running.

The screen rule is strict. Every game pixel is a whole number of device pixels, the view is at least 256 by 224 and grows to fill the phone, and a wide window gets an upright column in the middle instead of a stretched picture. On a 390 by 844 phone at 3x that comes out to a 293 by 633 view.

A hint that has to be dismissed teaches people to dismiss hints.

Balance you can diff

Balance is a report, not a feeling. A command writes three of them into the repository: one floor, the mine floor after floor, and the boss. Each one plays a careful planner (a beam search over the same rules the game uses) against a random player, across hundreds of seeded crews, and says whether the targets were met. The reports carry no dates, so the diff of a report is the diff of the balance, and the build fails if a committed report is stale.

The current numbers: on the first floor, across 500 loadouts, careful play gets out 91 percent of the time and random play 2 percent. Across three floors, careful play clears 85 percent and random play none. Against the boss, careful crews win 64 percent and random ones 11, and a crew with four Seals equipped wins 80 percent against 47 with none.

The reports also caught the game's mistakes. A crab with 7 health died before it could ever be broken, which made breaking decorative, so it got 12. A metric that would not move turned out to be free healing, and the rule became that a skill mends what the current fight has cost and no more. And the balance run itself went from 196 seconds to 15, with identical results, once the pack grid was built once per search.

What a person decided

The calls that were mine were mostly about what the game is for. Exploration over combat. A pack that makes you choose. Hints that never block play, because of the line quoted above. And the story, which came last: on the third day the opening and the ending were written to explain pieces that were already in the mine, a foreman who dug past a mark cut in the rock, spoil that choked the way out, water that rose. The decisions file says it plainly: nothing was added to the mine to make it fit. The boss, the Sump Keeper, is not a monster. It is keeping a promise no one else kept.

What has not happened yet matters as much. Every playtest so far has been a script or an agent, including four simulated players run on the second day, and the decisions file says so: they were agents, not people. The gates for fun and feel are still waiting for a human. That is part of why it is here now.

How the film was made

The game already had a test that plays the whole thing, start to end, with real touches: the town, four floors, two fights that cannot be walked round, the boss and home. The film is that test with a camera on it. Playwright's clock is installed and paused before the page loads, so the game only moves when the script says so: advance one thirtieth of a second, take a screenshot, write it into a lossless master. Between shots the camera stops rolling while the game plays on, so the long walks are played but not kept.

The result is a steady 30 frames a second however slowly the filming machine draws, and the same script makes the same film. It took a few runs to get through. One stalled on floor three, because the fight had burned the light down and the crew could not reach the lever in the dark; another found that a tap landing during the wipe after a fight is lost. Both fixes are what a player does: light a torch, tap again.

Why it runs in a frame here

The Tin Road lives in its own repository, with its own engine, its own sound and its own look, and this site does not try to absorb it. A static build is copied into the site, a hash for every file is recorded with the commit it came from, and a test fails if anything in that folder changes by hand. The game's page frames the build full screen under a thin strip with the way back. A portfolio census of my repositories noticed that this game and Swarmfront each rebuild an engine, a synthesizer and a style of their own. Whether they should share one is still open. Showing up in the games library and on your Console was not.

What is next

The list of later ideas is long, and the top of it is short: a service worker so the game plays offline, enemy attacks drawn as animations, fights on the main way of the first two floors, crafting or a pack animal with a second grid, and a second dungeon that runs on a different resource, heat or air, instead of light. First, though, it needs people. If you play it, the Films channel has the minute above, and the FLAPPY-ISH build log tells how the same fake clock filmed a very different game.

Experience it yourselfPlay The Tin Road
ShareXLinkedInHacker NewsEmail

Get the next one

An occasional note when something genuinely new ships here — essays, free tools, projects. No schedule, no filler, easy out.

Hiring for an AI implementation role?

I make software work inside real organizations, and now that means AI systems a team can check: the buying, the guardrails, the training and the build. If you are filling a role like that, twenty minutes is the quickest way to see whether we fit.