Thirty years ago I lost a lot of evenings to a game called Empire. Last week I lost a lot more. This time I didn't have to find a DOS box. I just asked Claude to build it.
This is the story of how that went. Short version: one prompt, about 20 minutes, under 600 lines of HTML, and a game I have now played for hours. Longer version below.
A quick history lesson
Empire was written by Walter Bright in 1977. Yes, the same Walter Bright who later created the D programming language. It is one of the original turn-based strategy wargames and a direct ancestor of Civilization and the whole 4X genre.
The rules are simple. You start with one city on a randomly generated map you can't see. Your cities build units. Armies capture cities. Ships carry armies across oceans. Fighters scout and strike but run out of fuel. The computer is doing the same thing somewhere out in the fog. Whoever holds every city wins.
The version I remembered was Empire Deluxe from 1993. A while back I went looking for it. You can run it in DOSBox, which is great, until the game asks you for copy-protection codes from a printed manual I last saw during the first Clinton administration. I turned the sound off and moved on. Then I had a better idea.
The prompt
Here is the entire prompt. I am not leaving anything out.
Please read this link for description of the game I used to play called Empire. Can you make a version of this, please?
https://en.wikipedia.org/wiki/Empire(1977_video_game)_
That's it. No spec. No list of units. No architecture. No "you are an expert game developer." I pointed at a Wikipedia article and said please. My mother would be proud.
I have spent a lot of my career writing careful prompts for production agent systems. This was the opposite. I wanted to see what happened when the model had to fill in the gaps itself.
What Claude did with it
Claude read the article, pulled out the rules, and then made a lot of decisions I never asked it to make. Most of them were the decisions I would have made. A few were better.
It picked a format. One self-contained HTML file. All the CSS and JavaScript inline. Open it in any browser and play, even offline. The only external dependency is a pair of Google Fonts, and it falls back gracefully without them.
It picked an aesthetic. The game looks like a beige video terminal from the era, with the map as the glowing screen inside a dark bezel. The title and map use VT323, a pixel terminal font. There is an orange "return" key. I did not ask for any of this. It is exactly right.
It got the units right. Armies, fighters, destroyers, submarines, transports, cruisers, carriers, and battleships, each with its own speed, hit points, and build time. A battleship takes 40 turns to build and absorbs 10 hits. Fighters carry 32 fuel and crash when it runs out. Transports hold 6 armies. Carriers hold 8 fighters. Ships repair one hit per turn in port.
It got the rules right. Each attempt by an army to take a city succeeds half the time, and the army is used up either way. Combat runs in rounds, and each round one side, chosen at random, deals its damage. There is real fog of war. Terrain you have seen but can't currently see is drawn faded, so you remember the coastline but not what's sitting on it.
It kept the original keys. Q W E / A D / Z X C move your unit in eight directions, just like 1977. S is sentry, Space skips, G is go-to, B boards a transport, Enter ends the turn. My fingers remembered them before my brain did.
It built an opponent. This is the part I expected to be weak. It isn't. The computer expands across its own island first, then builds transports and comes looking for you. It sends fighters and warships too. In Claude's own test games where the human side did nothing at all, the AI held almost every city on the map by turn 180 to 200. So don't sit around admiring the font.
It handled the little things. The game saves itself every turn in the browser, so you can close the tab and come back. Tapping a distant square sends a unit there over several turns. Tapping a stack cycles through it, which is how you unload armies from a transport. There is a help screen with the full unit table.
Under 600 lines
The whole thing is less than 600 lines of HTML. That number keeps surprising me.
The code is easy to find your way around. The unit stats live in a single table called UT at the top. Map generation is in genMap(), where you can change the map size, the share of land, and the number of cities. The computer opponent is a family of functions starting with ai, mainly aiProd, aiArmy, and aiTransport. Combat is fight().
When I asked for the source, Claude handed me the file and a short map of exactly that. If you want a bigger world or meaner battleships, you know where to look.
Here's the part that really gets me. Back in the day I wanted to write my own version of Empire. I had a specific question I wanted answered. Are expensive, specialized combat units actually worth it? Take a stealth fighter that costs three times as much as a regular fighter but can't be seen until it strikes. Does it win wars? Or does it just tie up your cities while the other side cranks out cheap armies by the dozen? I never got around to building it. Life happened. Jobs, kids, a few decades.
Now the experiment is one new line in the UT table. Give the unit a name, a speed, hit points, a build time, and a note. Reload the page. Go find out. The stealth part might take a few more lines, but I know exactly who to ask. Forty years of curiosity, settled over a weekend.
One honest caveat
The computer opponent can see the whole map. You have fog of war. It doesn't. That is a classic way to make a simple AI competitive, and plenty of commercial games did the same thing. Claude told me about it up front rather than letting me discover it the hard way, which I appreciated. I am choosing to think of it as historical accuracy.
Is it realistic?
I have been playing for hours. It feels like Empire. The pacing is right. The early land grab is right. The moment you realize the enemy has transports and your coast is undefended is exactly as unpleasant as I remember.
That is the real test for a remake. Not whether it matches a spec, but whether it gives you the same feeling. This one does.
What I took away from this
Context beats instructions. I gave Claude almost no instructions and one good piece of context. The Wikipedia article did the work a spec would normally do. For a well-documented domain, pointing at the source can be better than paraphrasing it.
Small is a feature. A single 600-line file is something I can read in an evening, modify, and keep forever. No build step. No framework. No node_modules folder the size of a small moon.
The interesting part is the judgment. Writing code that moves a unit across a grid isn't impressive anymore. Deciding that a 1977 wargame should look like a 1977 terminal, keep the 1977 keyboard layout, and warn the player that the AI cheats is judgment. That's what made it feel like a collaborator and not an autocomplete.
I used to spend evenings with Empire on a PC that weighed more than my dog. Now I spend them with Empire in a browser tab, built in less time than it takes to reconfigure DOSBox.
Some progress is just better.
Want to try it? https://github.com/btarbox/retrogames. If you build your own version, or beat the AI faster than I did, let me know in the comments.
Another Game: AI Invaders
The classic Space Invaders but updated for our agentic world. Invaders get faster and stronger and you're protected by PTO!

Top comments (0)