Simon is a Computer Science BSc graduate who has been writing about technology since 2014, and using Windows machines since 3.1. After working for an indie game studio and acting as the family's go-to technician for all computer issues, he found his passion for writing and decided to use his skill set to write about all things tech.
Since beginning his writing career, he has written for many different publications such as WorldStart, Listverse, and MakeTechEasier. However, after finding his home at MakeUseOf in February 2019, he would eventually move on to its sister site, XDA, to bring the latest and greatest in Windows, Linux, and DIY electronics.
I've really been getting into interactive fiction lately. I think with all the D&D tabletop and video games I've been playing, plus excellent Steam titles like Sorcery! and Slay the Princess, I've been in the mood for a book you can play. And what better way to revisit this classic genre than to make a text-based adventure game?
Except, I didn't want to make it myself. I wanted Claude Code to give it a shot. On top of everything, I wanted Claude to have as much freedom as it wants, and only intervene when there's a bug or something just feels wrong. So, here's how Claude made The Dungeon of Aethermoor.
The first build: a solid start, but literally unwinnable
The hero forgot something back home, I guess
To get the ball rolling, I simply told Claude, "Please program a text-based adventure game people can play on the web." That's it. I didn't want to give it directions on genre or mechanics. I wanted to see what Claude would make. Claude went into a big thing that lasted 12 minutes and burned through around 10,000 tokens as it tried to work out how to make a text-based adventure game.
What it outputted was a surprisingly robust and playable game engine. It added nine rooms, combat versus five enemies, an equipment system, speaking to NPCs, and even common shorthand commands (such as "i" for inventory, "s" to go South). So I booted up the HTML file Claude spat out and played it for a bit.
The first try was shockingly good. It had a clean UI, all the commands worked, and I could go from the start to the end of the dungeon. Combat was pretty nicely implemented; when you enter a room with an enemy, you cannot leave the room until you defeat it. You can still loot items, equip stuff, and prepare for the battle, but you're basically stuck in there until you win.
Claude even added a nice little challenge to beat the game. Spread within the dungeon are three runes. To win, you need to collect them all, slot them into an amulet, then touch the crystal at the very end. The runes protect your mind from going insane from the sheer magical force of the crystal, allowing you to win the game.
However, the game was not perfect. Claude constantly peppered the world with interesting tidbits that did nothing. For instance, the library has an 'open tome' and something glittering on a shelf up above. To an adventurer, those sounded like interactables, but when I asked Claude what they were for, it admitted it was just flavor.
Plus, Claude had a habit of adding useful-sounding items that did nothing. A spider in an alcove drops a lockpick that's functionally useless. You can also get a Silver Mirror, which the description says is given to you by a Medusa (who doesn't exist in-game) and does nothing. There's also a silver dagger you can pick up, but it's strictly inferior to the sword, and you can acquire the sword on the second turn of the game without fighting anything (go into the Armory, grab the sword).
There were some balance issues, too. You can grab a shield and some chain mail in the dungeon, and if you put them both on, you only take 1-2 damage from all attacks, including the final boss. For context, you start with 20HP, and get two healing potions (that heal +15 HP each), some fish (+10 HP), and some herbs (+5 HP). Once you're geared up, you're essentially unkillable.
The biggest sin of all, however, was that there was no amulet! The three runes were in-world and acquirable, but the amulet is neither on your person nor is it a drop from the dungeon. So you literally cannot beat the game. Great.
If you'd like to give this first build a try, you can play it in your browser without a download via this link.
The second build: the Lich will straight up destroy you
And you can't do anything about it
Because I was talking to Claude about the issues I noticed above, it had already drafted up a shopping list of grievances I had with the game. So, for the second build, I simply said "fix them" and let Claude get to work. The to-do list Claude generated read like this:
- Amulet not placed in the world — game is unwinnable
- Chest in alcove is flavor-only
- Tome in library is flavor-only
- Dagger is strictly worse than the sword
- Early game too easy — sword trivializes the goblin
- Lockpick has no function
- Medusa referenced but doesn't exist
- Lich Lord is trivially easy when properly geared
It chewed over this for about 9 minutes and 30 seconds, and used around 18,000 tokens for the fixes. Part of this involved what it says was "one comprehensive rewrite of the JS" and that the issues were "tightly interconnected with the code," which is likely why the edits took almost double the tokens than making the engine.
The new changes were pretty great! The chest now contains the amulet, you can read the tome to learn about Medusa, and she's now guarding the aforementioned chest. If you fight her without the mirror, she one-shots you; with the mirror, it's an even fight. She drops a lockpick, which you then use to open the chest.
Also, you can't loot the room before fighting present monsters; you have to defeat them to pick stuff up. This gave the dagger a genuine use, as the goblin won't surrender the sword until you beat it. Claude also added some cool dual-wield functionality. You can either use the dagger and the sword to max your attack, or trade the dagger for a shield for some more defense. Now it felt like I was actually making a choice with my build instead of just maxing it all out.
Unfortunately, Claude made a huge error with the Lich. It coded the battle so that, if you enter the final room without the fully-charged amulet and the mirror (yes, the mirror is important for some reason), you're vastly underpowered, and he will easily defeat you. There was one problem: for the amulet to be fully charged, you needed all the runes. The final rune was in the Lich room. And the new "no looting until you win the fight" mechanic meant that you had to defeat the Lich to get the item you needed to defeat the Lich, meaning the game was unwinnable again.
I also pointed out to Claude that it added a rope and a gold coin tracker, but neither was being used. So, I told it to fix those two problems, alongside the rune fix. You can play for yourself using this link.
The third build: You can actually beat the game now
And it's pretty fun
The third build turns the fisherman NPC into a shop where you can purchase healing items. The rope is now useful as a makeshift fishing rod to get a fish that heals you when used. And now the rune that was under the Lich's control is given to the troll fight, so you can actually charge your amulet before fighting the final boss.
The first build of the game had a minor bug. To charge the amulet, you had to collect all three runes, then type "use amulet." However, the new 'charge amulet' code was placed after the code that equipped and unequipped the items on use, so you were forever just wearing and removing the amulet instead of charging it. Claude just swapped the order of actions around so it would use the runes if you had them, and toggle equip status if not.
With that fix, the game was finally beatable. You can collect the runes, charge your amulet, beat up the final boss, and use the crystal in the next room. Nice work, Claude! You can play this build via this link.
Claude's adventure was surprisingly functional
While I would ding Claude for gameplay that isn't particularly innovative or interesting, I never explicitly stated I wanted those things. I just told it, "make me a text-based adventure," and it did. However, it seems that Claude had a ton of ideas of what to do with the game—gold, a Medusa encounter, rope, a chest, an open tome—but didn't actually build upon them in any way. That might be a good takeaway if you're planning on using Claude Code to build your own game; it may add features simply because they're staples of the genre, but they may be either imbalanced or useless without a proper implementation.
