Show HN: I wrapped the Zorks with an LLM
52 points
3 hours ago
| 16 comments
| infocom.tambo.co
| 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

p_ing
5 minutes ago
[-]
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.
reply
grouchy
2 minutes ago
[-]
This had me laugh out loud.
reply
grouchy
2 hours ago
[-]
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.

reply
nielsbot
2 hours ago
[-]
Or even make new games with the LLM translating what you write into a restricted set of in-game commands.

One thing I noticed about the linked page: I said something like "what's in the mailbox?" and the answer was "That mailbox is closed." I think the next level would be able to string together multiple commands like "open mailbox" + "look in mailbox"

reply
jmcmichael
2 hours ago
[-]
You can, my first prompt in Zork 3 was “pick up the latern, light it, and walk down the dark path”, and it did all that.
reply
anthk
55 minutes ago
[-]
I think if these were ported to IF6 and compiled into Z8 machine game the parser would be improved nearly for free but they woudn't run fast enough under an 8 bit machine. But for DOS, Amiga, Classic Macintosh and even the ESP32 it would be more than enough to run these.
reply
direwolf20
5 minutes ago
[-]
The parser in Z-machine games comes from the game, not from the runtime, so the Z-machine version is completely irrelevant and the only reason porting to Inform 6 would make a difference is that you'd be linking it with a different parser.
reply
DonHopkins
2 hours ago
[-]
In MOOLLM Adventures, you can have NPC characters with entire game mechanics, rules, and playing piece prototypes embedded in them, that can run cooperatively in parallel in the same game!

The Grue — The Darkness That IS The Game:

https://github.com/SimHacker/moollm/tree/main/examples/adven...

Hint: GET LAMP

https://github.com/SimHacker/moollm/blob/main/examples/adven...

MC Frontalot - It Is Pitch Dark:

https://www.youtube.com/watch?v=4nigRT2KmCE

Snorax the Patient — The Wumpus Who IS The Game

https://github.com/SimHacker/moollm/tree/main/examples/adven...

Bottomless Pit:

https://github.com/SimHacker/moollm/blob/main/examples/adven...

Superbats:

https://github.com/SimHacker/moollm/blob/main/examples/adven...

Hunt the Wumpus BASIC source code from 1973 to resolve any rule ambiguities:

https://github.com/SimHacker/moollm/blob/main/examples/adven...

With a classic Zork mailbox integrated with the postal system, including junk mail, stamp collecting, chain mail, and offers you can't refuse:

https://github.com/SimHacker/moollm/blob/main/examples/adven...

Postal System:

https://github.com/SimHacker/moollm/tree/main/skills/postal

Not to be confused with the Postel System:

https://github.com/SimHacker/moollm/tree/main/skills/postel

reply
realo
1 hour ago
[-]
Also cool: make your own RPG!

https://www.rpgprompts.com/

reply
falcor84
1 hour ago
[-]
This is something else. I want an LLM to continuously interact with a persistent authored world, not just have it make things up as it goes.
reply
joelcares
53 minutes ago
[-]
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.
reply
joelcares
45 minutes ago
[-]
Ok, I refreshed and tried again.

   Climb in mailbox

   You approach the small mailbox and try to climb inside, determined to fit yourself within its confines.

   You attempt to climb into the small mailbox, but end up bumping your head against its narrow opening. It's simply too small for anyone to fit inside; only letters and parcels can enter here.

   Become a letter

   You focus deeply, willing your body to transform. You feel yourself grow flat and light, edges crisp, your form now that of a letter—thin enough to slip through any mail slot and fit inside the mailbox with ease.

   Enter mailbox

   Now shaped like a letter, you slip smoothly into the mailbox. The inside is dark, cool, and the metal walls surround you on all sides. You rest quietly, perfectly at home in this new form.
reply
fievelk
1 hour ago
[-]
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.

reply
alecf
1 hour ago
[-]
At least for the sake of this demo, the costs are actually pretty small, especially given that many of the ... even at $1.75/1M tokens you'd have to have 2 megabytes of text across all users before this even broke $1...
reply
storystarling
50 minutes ago
[-]
The unit price looks low but the cost driver in these apps is usually the context window. You have to re-send the full history every turn to maintain state, so you end up paying for the same tokens dozens of times. By the end of a long session the cost per interaction is significantly higher than at the start since you're re-processing the entire game log for every new command.
reply
direwolf20
7 minutes ago
[-]
Were you around for AI Dungeon?
reply
jes5199
1 hour ago
[-]
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!
reply
regus
34 minutes ago
[-]
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".
reply
dbdoug
1 minute ago
[-]
Houses have 4 sides....
reply
cjauvin
2 hours ago
[-]
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

reply
grouchy
2 hours ago
[-]
This is cool. I wonder what it would like today with LLMs?
reply
the_arun
1 hour ago
[-]
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?
reply
falcor84
1 hour ago
[-]
This is awesome!

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

reply
czbond
2 hours ago
[-]
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.
reply
grouchy
1 hour ago
[-]
I'd love to see a version of this that adds voice. Both input and telling the story.
reply
DonHopkins
2 hours ago
[-]
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"!

reply
einpoklum
1 hour ago
[-]
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.

reply
CamperBob2
2 hours ago
[-]
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.
reply
alecf
2 hours ago
[-]
Yeah made me wonder if you could speedrun the game by giving it a lot of complex instructions and then just let it run...
reply
cloudfudge
1 hour ago
[-]
It ran for a while when I gave it instructions to do a depth-first search of the known map, while observing any atypical features of every new location and also picking up anything of note. A few times, it asked me if I wanted to continue the search, but I finally told it not to interrupt the search until it had exhausted all new options, which made it run until it said it had reached the maximum number of tool calls (15).
reply
anthk
59 minutes ago
[-]
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.

reply