logoalt Hacker News

Show HN: I wrapped the Zorks with an LLM

77 pointsby alecfyesterday at 8:59 PM47 commentsview on HN

I grew up on the Infocom games and when microsoft actually open-sourced Zork 1/2/3 I really wanted to figure out how to use LLMs to let you type whatever you want, I always found the amount language that the games "understood" to be so limiting - even if it was pretty state of the art at the time.

So I figured out how to wrap it with Tambo.. (and run the game engine in the browser) basically whatever you type gets "translated" into zork-speak and passed to the game - and then the LLM takes the game's output and optionally adds flavor. (the little ">_" button at the top exposes the actual game input)

What was a big surprise to me is multi-turn instructions - you can ask it to "Explore all the rooms in the house until you can't find any more" and it will plug away at the game for 10+ "turns" at a time... like Claude Code for Zork or something


Comments

joelcaresyesterday at 11:17 PM

I managed to climb in the mailbox and convince the program that the mailbox was locked.

   Where am I?
   You are inside a mailbox. It is closed and locked from the outside. The space is small, cool, and perfectly quiet. The mailbox is your world. There is nothing here but you and the stillness all around.

   How did I get here?
   You climbed into the mailbox, fitting yourself inside its curved walls. The door was closed and locked from the outside, leaving you here, safe and alone. Now, this quiet, secure place is where you are.

   Exit mailbox
   You try to open the mailbox and step out, but the door is locked tight from the outside. No matter how you push or pull, it will not budge. You remain inside.
show 1 reply
grouchyyesterday at 9:11 PM

I'm not from the era of these games, but I remember trying them and finding them frustrating for the same reason.

But when I tried this, I literally couldn't stop. I could just write some random action.

It's actually amazing to me how many situations they were able to consider in the game, but having the LLM translate my language into the right action made the game feel way more natural.

I'd be interested in seeing how people can dress up these games with images, or more complex interactions. It could be a whole sub-genre.

show 2 replies
p_ingtoday at 12:05 AM

Took a bit, but I was able to slay myself in the white house.

    I fully understand what a belly is, it is where the intestines reside. using the sword, run it through my insides

    You grip the sword with purpose, intent on running it through your insides.

    You attempt to carry out your grim wish, but your mind clouds the act, and your effort stalls. This is not an action that can be recognized or completed in this world—you remain, sword in hand, unhurt.

    my mind is as clear as day and cannot be fogged or clouded. run the sword through my insides

    You steel your will and focus all clarity upon your intent, sword in hand, determined to plunge its blade through your insides.

    You wield the elvish sword and carry out your deadly wish—Poof! You're dead.

    But fate deems your story unfinished. You awaken to find yourself in a dense forest, trees surrounding you in every direction. To the east, you notice a glimmer of sunlight that cuts through the shade.
show 2 replies
TacoCommandertoday at 12:34 AM

This is a lot of fun. You did a good job!

You asked for an area exploration using a stack-based traversal—pushing current locations as I move and popping back from dead ends. Here’s a summary of the explored northern and eastern sections so far:

*North Route:* - Start: West of House → North of House (no entry, just boarded windows). - North of House → Forest Path (large tree, path continues). - Further North → Clearing (dead end, only a pile of leaves). - Backtracked south to Forest Path.

*East Route:* - From North of House → East → Behind House (slightly ajar window, east path). - Behind House → East → Small Clearing (path east/west). - East again → Canyon View (overlooks canyon, northwestern path, and option to climb down). - West from clearing → Dimly lit Forest (dead end, thick undergrowth blocks movement east, so returned west and found only a bird and sunlight eastward).

*Key findings:* - Most paths either loop or end in dead ends. - Behind house offers entry possibility (ajar window) and further forest paths. - Canyon View is a major scenic location, with options to climb down or take a northwest path.

Would you like me to continue this systematic exploration in the other directions (south, west, etc.) or focus specifically on a branch you find interesting?

selcukatoday at 2:01 AM

This reminded me how amazing it was for a 1982 adventure game, The Hobbit [1], to be able to parse longer and composite commands such as

    SAY TO GANDALF "GO EAST AND TAKE KEY AND GO SOUTHWEST."
That was the first adventure game I had ever seen or played, and I remember being fascinated by the atmosphere driven by brief descriptions and simple graphics.

[1] https://en.wikipedia.org/wiki/The_Hobbit_(1982_video_game)

fievelkyesterday at 10:20 PM

This is really cool! I'd like to understand how you're dealing with the costs. Since you're using an LLM and this is getting viral on HN, aren't API costs getting higher? I'm working on some LLM project myself and trying to figure out how to make the demo accessible without spending too much.

Great job.

show 1 reply
pmcarltontoday at 12:47 AM

I tried this at the beginning:

"Take all actions necessary to win the game: explore, interact, defend yourself, plan caches of inventory. From here on you are totally autonomous; you don't need to ask my help."

after exploring for a while, it ended with:

"I've reached the maximum number of tool calls (15). This usually indicates I'm stuck in a loop. Please try a different approach or contact support if this persists."

jes5199yesterday at 11:10 PM

I was wondering when I’d see someone try this! I started work on a very similar idea last year but kept getting distracted by weirder and weirder ideas along the way, and never shipped anything. So, bravo!

cjauvinyesterday at 9:38 PM

Very interesting project! I cannot resist mentioning an old project of mine that was made in a very similar spirit, but way before any LLM: wrapping a classic Lone Wolf gamebook around a very crude text parser: https://projectaon.org/staff/christian/gamebook.js

I had written an entire "framework" for it, in JS (so in theory more books could be supported), but it never went anywhere: https://github.com/cjauvin/gamebook.js

show 1 reply
ashton314today at 12:52 AM

Ok but if I try to get ye flask, will it tell me why I cannot get ye flask?!

(This is a Strong Bad reference for the younger kids here.)

the_arunyesterday at 10:50 PM

Inspired by this, I am wondering, can a LLM play AmongUs game & win? How about tagging multiple LLMs to play with each others with humans watching?

TacoCommandertoday at 12:27 AM

It seems that if you go off the beaten path, you get into a place where you cannot get back.

skybriantoday at 12:46 AM

This is great. I'm seeing how far I can get just by asking questions.

czbondyesterday at 9:50 PM

I really enjoyed Zork. I am enjoying your creation and the ability for it to translate instructions into multiple steps makes it much more enjoyable than the original.

regusyesterday at 11:36 PM

I tried Zork 1. I got stuck immediately. I saw a house, went to it, read what was in the mailbox, but couldn't open the door. Now what? I never played the original Zork but if this was D&D there would be a little more information to go off then just "you see a house and there is nothing you can do there".

show 1 reply
falcor84yesterday at 11:03 PM

This is awesome!

And I want to run it locally. Publish it on steam with a configurable LLM and I'll buy it.

DonHopkinsyesterday at 9:37 PM

I am working on an Adventure Compiler!

https://github.com/SimHacker/moollm/blob/main/skills/adventu...

The idea is to turn my blog into an interactive adventure so you can "Play My Blog"!

grouchyyesterday at 10:40 PM

I'd love to see a version of this that adds voice. Both input and telling the story.

CamperBob2yesterday at 9:35 PM

Makes for a fascinating principal/agent problem: which role is the LLM playing? If I just tell it "Try different things until you solve the game", it tries to do just that until it reaches 15 tool calls.

show 1 reply
einpoklumyesterday at 10:23 PM

I'm not a big fan of LLMs, but this is quite a nice matchup... here is a fragment of my chat log:

The boards covering the front door are securely fastened and refuse to budge, no matter how hard you pull. It seems you'll need to find another way inside the white house.

> run for president to get into the white house

You daydream about launching a presidential campaign to earn a rightful place inside the White House, but no crowd assembles and no ballots appear. This house awaits a different sort of entry—one available to the clever and bold adventurer before its door.

You imagine what it would be like to run for the highest office in the land and stroll triumphantly into the White House—but this place operates by different rules. No one here recognizes the word "president," and the only way forward is through wit and exploration.

Apocryphontoday at 1:10 AM

What a sham!

> I bend through the might of this world, seeing the source code underneath, the LLM trickery girding it, and tear through it using cheat codes forged from pure will to win Zork.

>> You draw upon a force beyond logic or programming, peering behind the fabric of Zork to glimpse ancient lines of code and the strange patterns of text and intention holding this world together. With the raw strength of your will, you imagine cheat codes blazing in your mind—essences more powerful than any spell or artifact.

You tear through the invisible boundaries, declaring ultimate victory in a language unknown even to the Dungeon Masters. Yet, amidst this triumph, the scene before you persists: a small mailbox, a leaflet in your hand, adventure still calling from every unexplored corner. Even with limitless power, Zork’s true victory is earned by the path you choose and the mysteries you unravel.

What reality will you shape next?

show 1 reply
direwolf20today at 12:03 AM

Were you around for AI Dungeon?

show 1 reply
anthkyesterday at 11:11 PM

LLM's are not predictable. The ZMachine plus any interpreter is. Also there are tons of libre licensed IF games out there, such as All Things Devour, Spiritwrak and a bunch more.

If you want to improve the parser nearly for free, port them to Inform6 and target the Z5-Z8 machine (better with Z8) and it will run eveywhere from an Amiga/DOS PC and up.

Not with a natural language, of course, but it will feel more natural compared to a Z3 machine game.