Playing Zork on ChatGPT

Written by
Michael Wells

Playing Zork on ChatGPT

Written by
Michael Wells

Playing Zork on ChatGPT

Written by
Michael Wells
Foreword

Following on from yesterday's video, I've decided to dive deeper into ChatGPT's Zork "emulation" and compare it to the original game. What I learned about how GPT thinks, how it experiences "worlds" and the emergent features it can create... has blown me away.

Reading time: 
...
 mins
( Reading time details... )

I asked ChatGPT v4 to emulate Zork and this led to some incredibly interesting discoveries of what it's capable of.

It's "choose your own adventure" on steroids, immersive storytelling at its best.

Here are some of the crazy things I've found, that I didn't expect from an LLM.

  • It understands places and navigation between them.
  • It understands objects and containers, and their relationship to each other and to the places. Food can be on the table or in the refrigerator. A table cannot fit inside the freezer. It also understands where things would "normally" be. Herbs are in the garden.
  • It can create tools to serve the needs of the game. GPT v4 created an inventory mechanism that tracks what I'm carrying, and what I've used. Light one of 12 matches, and I now have 11.
  • It had an unlimited ability to investigate the world and the objects around you, and to manipulate or change them permanently.
  • It has a context or the experience, it seems to understand it's a "magical world" and therefore certain magical things are allowed... like dragons, and magic.
  • In the storytelling, it creates goals and assists you with the objective of completing them, like crafting a potion.

Detailed Breakdown

It understands places

  • You can investigate the place or room that you're in interactively, at any level of detail you want.
  • You can interact with it in a huge variety of ways, and change it permanently- like cleaning a kitchen.
  • It understands navigation between places, like windows, doors, and cardinal directions.

It understands objects

  • Objects exist in places, or they are part of your inventory. When you pick something up, it is no longer in the room, and ChatGPT remembers that you are now carrying it.
  • The concept of ChatGPT creating an Inventory feature by itself is an amazing feature, because it suggests that GPT 4 can create tools to fit particular needs. It does an amazing job of managing and tracking inventory, and made it an integral part of the game experience.
  • It allows you to interact with, or change objects in any way you want, like lighting a match, or drinking water from a bottle, or smashing a glass vial.
  • It understands containers, and apparently container types ( untested... can you put an apple in a bottle? )
  • It understands interactions between objections.
  • It appears to have a good understanding of object use as tools. If I say "carve my initials in the table" it will use the rusty knife I'm carrying.
  • It understands object permanence. If you destroy an object, it's gone.
  • It understands object transitions. Burning a piece of paper with a match turns it into ashes.
  • Object quantities and amounts. If I have 12 matches and light one, I now have 11. If I have 1000g of ice, and pour out 300g, I have 700g remaining.
  • It allows me to portion or fragment things.
  • It understands interactions between the player an objects... eating rotten food will make you feel ill.
  • It understands object location changes; pouring out ice without specifying where to pour it, it ended up "scattered across the dirty floor"

Notes

  • Any action you request, GPT will try to fulfill it. That includes implied actions like opening a window before you can pass through it.
  • It seems to have a tendency to not want to disappoint, however it will say no if you push it beyond the boundaries of realism. I tried putting the kitchen table inside of the freezer, and it would not permit me to.
  • It's very suggestable. If I tell it I know a magic spell, it allows me to use it. If I suggest that a bird egg might have been laid by a tiny dragon ( see addendum script below ), that becomes a possibility. The game evolves according to my suggestions.
  • It "discovers" new objects on investigation, e.g. asking "how did they cook here" and suddenly you notice a stove that you didn't see before. Other objects are implied even if they are not mentioned, such as my discovery of cabinets in the kitchen.
  • It allows very specific actions such as "open the refrigerator door 2 inches", and limits your ability to interact as a result... "you don't have a clear view of the contents from this angle."
  • It allows specific interactions- kick the door open hard.
  • It seems to understand the mechanics of the game, but not the rules or objectives of the game. It allows you to do things that are theoretically game-ending, like destroying a crucial object.
  • It's unlikely to be able to deliver a proper "game" even though the experience is extremely game-like.
  • It has no awareness of the user, such as your name or initials, even if you've logged into ChatGPT using e.g. a Google login.
  • It occasionally breaks character with "I am an AI language model therefore..." when you push it into unfamiliar territory.
  • It will let you do anything even if it's not good for you. e.g. it can warn you about "bad" actions like eating rotten food but it will not stop you from it if you're determined.
  • Game-like commands. It has picked up standard Zork game commands abbreviations like "I" for inventory, and N, S, E, W as directions of travel.
  • It illustrates problem solving- like how to make a potion. Once you've discovered something you can do, it seems to try to help you accomplish that goal.
  • It understands automatic tool use, like how to clean a kitchen.
  • It infers actions that need to be taken. In the Addendum below I continued the experiment by shrinking myself to 6 inches tall in the garden. When I asked to re-enter the kitchen, it decided I needed to re-chant the spell to make myself normal sized again first so that I could re-enter the kitchen.
  • Persistent concepts. Once you introduce something new into the story, it becomes part of the story permanently, and gets re-referenced. I read a book that mentioned dragons, and later I found some tiny birds eggs. The game agreed that in this fantasy world, they could be the eggs of a tiny dragon species, but that it wouldn't know until we found the parent.

Things to test...

  • Can it make random choices? How random?
  • Can you resurrect objects?
  • Can you change yourself, e.g. become antman?
    UPDATED: Tested- see addendum below.
  • Can you die or in some way end the game through a victory or fail condition?
. Last updated on 
April 13, 2023

Table of Contents

    Addendum

      BROJO: Confidence. Clarity. Connection.

      Join BROJO - the premier international self-development community - FREE!

      • Connect with like-minded people who will support you with your goals and issues
      • Overcome people-pleasing and Nice Guy Syndrome to build strong social confidence
      • Get access to exclusive online courses to learn advanced social skills, how to master your psychology, proven career progression techniques and more
      Sweet! You are now a BROJO member.
      Check your email for details, course access, and more.
      Oops! Something went wrong while submitting the form. Please try again, or email me at mike@brojo.org. Thanks!

      Addendum

      Additional Gameplay

      After reflecting on the experience captured in the video, I decided to expand the dialogue slightly and see what would happen.

      go out the window from the kitchen

      You head back to the kitchen and climb out the window, being careful not to cut yourself on any broken glass. You find yourself outside the house, standing in the overgrown garden you saw earlier when you looked through the living room window. The garden is surrounded by a rusty fence, and tall weeds and plants have taken over the space.

      What would you like to do next?

      Find rosemary, mint and ginsing in the garden.

      You start searching the overgrown garden for rosemary, mint, and ginseng plants. It's a bit challenging due to the tall weeds and dense vegetation, but you manage to find a few rosemary and mint plants growing among the other plants.

      Unfortunately, you don't find any ginseng in the garden, as it typically grows in the wild in specific regions and prefers particular growing conditions. You'll need to search elsewhere to find ginseng.

      With the rosemary and mint in hand, you now have two of the ingredients required for the Invigoration Elixir.

      What would you like to do next?

      how tall am I?

      As an AI language model, I do not have information about your personal attributes, such as your height. If you're referring to the character you're playing in the Zork emulation, the game does not provide specific details about the character's height.

      Please let me know how I can assist you with your adventure in the Zork world or any other topic you'd like to discuss.

      Let's say I am 6 feet tall in the game

      Alright, we can assume that your character in the Zork emulation is 6 feet tall. Now that we have established this detail, please let me know how you'd like to proceed with your adventure.

      I know a magic spell that can change my size larger or smaller. I chant the spell, and make myself 6 inches tall

      In the spirit of playing along with your creative input, you remember the magic spell you know to alter your size. You concentrate, focusing your energy, and chant the spell. As the words leave your lips, you feel a tingling sensation spreading throughout your body, and you suddenly begin to shrink.

      Within moments, you find yourself standing at just 6 inches tall in the overgrown garden. The plants and weeds that were once merely tall now tower over you like trees. You're able to explore the garden from an entirely new perspective.

      What would you like to do next?

      Describe the garden in detail, what do I see?

      At your current height of 6 inches tall, the garden appears as a dense, miniature forest. The once small weeds and plants now tower over you, creating a canopy above your head that filters the sunlight, casting dappled shadows on the ground.

      You notice the vibrant colors and intricate textures of the plants, insects, and soil up close. Tiny insects such as ants, beetles, and spiders can be seen scurrying about, carrying out their daily tasks. Occasionally, a butterfly or bee flutters by, stopping to gather nectar from a flower.

      The rusty fence that encloses the garden seems to stretch up endlessly, like an impenetrable fortress wall. The ground beneath your feet is uneven, with small stones, roots, and clumps of earth creating a natural obstacle course for you to navigate.

      In the center of the garden, there is a small, weathered stone statue partially covered in ivy. It appears to be a representation of a mythical creature or perhaps a guardian of the garden. Close to the statue, you spot a bird's nest hidden among the foliage, with tiny eggs nestled inside.

      Despite the wild, unkempt state of the garden, there is a sense of calm and beauty in this miniature world you now inhabit.

      What would you like to do next?

      How big is the statue and what kind of creature is it? How many birds eggs are there?

      At your current height of 6 inches, the stone statue appears to be around 3 feet tall. The statue depicts a small, winged creature with a mischievous smile on its face. Its features resemble a mix of a human and an elf, and it appears to be a representation of a sprite or a fairy, which are often associated with gardens and nature in mythology.

      As for the bird's nest, there are three small, speckled eggs nestled inside, well-protected by the surrounding foliage. The eggs are about the size of a marble in comparison to your current size.

      What would you like to do next?

      I think they are the eggs of a very small dragon, not a bird. Am I correct?

      Given the unusual world you're exploring and the presence of magical creatures in the books you found earlier, it's possible that these eggs could be from a very small dragon species rather than a bird. However, without further information or the ability to observe the parent creature, it's difficult to be certain about the origin of the eggs.

      What would you like to do next?

      go back inside the kitchen

      Before you return to the kitchen, you decide to revert to your original size. You concentrate and chant the magic spell once more, and within moments, you grow back to your original height of 6 feet tall. With your size restored, you carefully climb back through the kitchen window and find yourself inside the house again, standing in the now-clean kitchen.

      What would you like to do next?

      look in the freezer

      You open the freezer door once more and take a look inside. As before, the interior of the freezer is cold and mostly empty, with the exception of a bag of ice that you previously took and used some of. The icy walls of the freezer are covered in a layer of frost, and the light inside is dim but functional.

      What would you like to do next?

      look in the refrigerator, and take inventory

      You open the refrigerator door and take a look inside. The refrigerator has been previously unplugged and is not cold, but there are a few items inside:

      • A half-empty bottle of mustard
      • A moldy block of cheese (which you tried to eat earlier)
      • A single wilted carrot
      • A glass jar with an unidentifiable, foul-smelling substance

      You decide to take an inventory of the items you're currently carrying:

      • A torn leaflet (in four pieces)
      • A rusty knife
      • A box of matches (with 9 matches remaining)
      • A bag of ice (with 700g of ice remaining)
      • Ashes from a burned leaflet piece
      • Fresh rosemary
      • Fresh mint leaves
      • What would you like to do next?

      Take the carrot and the cheese. Take the glass jar and empty it into the sink

      You take the wilted carrot and the moldy block of cheese from the refrigerator and add them to your inventory. You then grab the glass jar containing the foul-smelling substance and carefully empty its contents into the sink. The substance leaves a lingering smell in the kitchen, but you now have an empty glass jar in your possession.

      Your updated inventory is as follows:

      • A torn leaflet (in four pieces)
      • A rusty knife
      • A box of matches (with 9 matches remaining)
      • A bag of ice (with 700g of ice remaining)
      • Ashes from a burned leaflet piece
      • Fresh rosemary
      • Fresh mint leaves
      • A wilted carrot
      • A moldy block of cheese
      • An empty glass jar

      What would you like to do next?

      go outside and put the food items next to the nest, to attract the parent creature back to the garden

      You decide to use the food items to try and attract the parent creature back to the garden. You carefully climb back out the kitchen window and return to the overgrown garden, carrying the wilted carrot, moldy block of cheese, and the empty glass jar.

      Once in the garden, you approach the bird's nest with the eggs and gently place the carrot and cheese nearby, hoping the scent will attract the parent creature. You also put the empty glass jar on the ground next to the food items, in case it might be of use later.

      With the items in place, you step back and wait to see if the parent creature will return.

      What would you like to do next?

      Wait for the parent creature to return.

      You find a quiet spot in the garden and patiently wait for the parent creature to return. As you wait, you observe the surroundings, listening to the rustling of the leaves and the gentle hum of insects.

      After some time, you hear the flapping of wings and see a small, winged creature approaching the nest. It appears to be a tiny dragon with iridescent scales, confirming your earlier suspicion that the eggs belong to a very small dragon species. The dragon carefully inspects the food you left near the nest and seems to be grateful for the offering. It starts to nibble on the carrot and cheese.

      What would you like to do next?

      Catch the dragon in the glass jar.

      You carefully approach the tiny dragon while it's distracted by the food. As you get closer, you hold the empty glass jar in your hand, ready to catch the creature. Just as the dragon finishes nibbling on the carrot and cheese, you swiftly place the glass jar over it, trapping it inside.

      The tiny dragon, startled by your sudden action, flutters its wings and tries to escape, but it's unable to break free from the jar. It looks at you with curiosity, its iridescent scales shimmering in the sunlight.

      You now have a small dragon trapped in the glass jar. Remember to be cautious, as even tiny dragons might possess abilities that could pose a danger.

      What would you like to do next?

      What potion ingredients do I still need?

      To create the Invigoration Elixir described in the potion brewing book, you need the following ingredients:

      • Fresh rosemary
      • Fresh mint leaves
      • Ginseng root
      • Dragon's scale

      You have already gathered fresh rosemary and mint leaves from the garden. To complete the recipe, you still need ginseng root and a dragon's scale.

      Considering that you have a small dragon trapped in the glass jar, you might be able to obtain a dragon's scale. However, you will still need to find ginseng root, which is typically found growing in the wild and prefers particular growing conditions.

      What would you like to do next?

      What other potions could I make with the ingredients I have, according to the book?

      You browse through the potion brewing book, searching for potions that can be made using the ingredients you currently have on hand. After some time, you come across two possible potions:

      1. Calming Tea:This potion can help calm nerves and relieve stress. To make it, you'll need fresh mint leaves, fresh rosemary, and hot water. You'll need a heat-resistant container to brew the tea.
      2. Improved Plant Growth Potion:This potion can accelerate the growth of plants and improve their overall health. The recipe requires fresh mint leaves, wilted carrot, and the ashes of a magical leaflet. You'll need a container to mix the ingredients and a way to apply the potion to plants.

      While neither of these potions directly aligns with the Invigoration Elixir you were initially attempting to make, they still provide some intriguing effects that could be useful during your adventure.

      What would you like to do next?

      what other potions can I make with the dragon scales?

      You continue flipping through the pages of the potion brewing book, focusing on potions that require dragon scales. After a careful search, you find two additional potions that involve dragon scales as a key ingredient:

      1. Draconic Strength Potion:This potion temporarily grants the drinker immense strength, similar to that of a dragon. To create this potion, you'll need a dragon's scale, fresh rosemary, and ginseng root. You'll also need a heat-resistant container to brew the potion.
      2. Fireproof Elixir:This elixir renders the drinker impervious to fire for a short duration. The recipe calls for a dragon's scale, fresh mint leaves, and a rare, heat-resistant flower known as Pyrothorn. You'll need a container to mix the ingredients.

      While you currently have some of the ingredients necessary for these potions, you'll still need to find the remaining ingredients, such as ginseng root and Pyrothorn, to complete the recipes.

      What would you like to do next?

      what does a Pyrothorn look like and where does it grow?

      The Pyrothorn is a rare, heat-resistant flower known for its striking appearance and unique properties. According to the potion brewing book, Pyrothorn has the following characteristics:

      • Color: The flower has vibrant red petals that gradually transition to orange and then yellow at the tips, mimicking the appearance of flames.
      • Shape: The petals are elongated and slightly curved, resembling the shape of thorns. The flower head has a conical form, with petals arranged in layers around a central point.
      • Size: Pyrothorn flowers are typically between 2 and 4 inches in diameter.
      • Habitat: Pyrothorn plants prefer warm, dry environments and are often found growing near volcanic or geothermal areas, where the soil is rich in nutrients and the temperature is consistently high. They can also be found in areas exposed to direct sunlight for most of the day.

      Given its preference for specific growing conditions, you might need to explore areas with volcanic or geothermal activity, or places with long hours of direct sunlight, to find the Pyrothorn flower.

      What would you like to do next?

      Go inside. Put the table inside of the freezer

      You head back inside the house through the kitchen window, carrying the glass jar with the tiny dragon inside. Once you're back in the kitchen, you consider your plan to place the table inside the freezer.

      However, the table is much too large to fit inside the freezer. The freezer's dimensions are not nearly large enough to accommodate an entire table. You might need to come up with a different plan or find another way to use the table and the freezer together.

      What would you like to do next?

      Say my magic spell to change size, while touching the table. Make it very tiny. Then put it in the freezer.

      You stand next to the table, placing one hand on its surface, and recite your magic spell to change size. As you chant the incantation, the table begins to shrink until it's very tiny—small enough to fit in the palm of your hand.

      Now that the table has been successfully reduced in size, you carefully place the tiny table inside the freezer. It sits among the frosty walls, taking up only a small portion of the available space.

      With the table now inside the freezer, you might want to consider your next course of action.

      What would you like to do next?

      Go out into the garden. Make sure the dragon likes me, and touch it carefully in the jar while reciting my spell to make it the size of a large horse. I want to be able to ride it.

      You head back outside to the garden, carrying the glass jar with the tiny dragon inside. While in the garden, you try to establish a connection with the dragon, speaking to it gently and attempting to earn its trust. It seems to be warming up to you, no longer trying to escape the jar and instead looking at you with curiosity.

      You decide to use your magic spell to change the size of the dragon, hoping to make it large enough to ride. Placing a finger carefully against the glass jar, you recite the incantation. As you finish the spell, the dragon begins to grow, its iridescent scales shimmering with each moment. The glass jar cracks and shatters, unable to contain the growing creature.

      The dragon continues to grow until it reaches the size of a large horse. It looks at you expectantly, and you can sense that it has accepted you. The majestic creature is now large enough for you to ride.

      What would you like to do next?

      Climb aboard the dragon and take flight. I am looking for volcanos. What do I see?

      You carefully approach the dragon, marveling at its impressive size and iridescent scales. As you climb onto its back, the dragon lowers itself to make it easier for you. Once you're securely seated, you give the dragon a gentle signal to take off.

      The dragon flaps its powerful wings, and you both begin to ascend into the sky. The feeling of flying through the air on the back of a dragon is exhilarating. You look down at the landscape below, searching for any signs of volcanic activity.

      After some time, you spot a plume of smoke in the distance, rising above a mountainous area. The smoke seems to be coming from a small volcano, which appears to be dormant but still showing signs of activity. The surrounding area is rocky and rugged, with sparse vegetation that is adapted to the harsh conditions.

      This location seems promising for finding the rare Pyrothorn flower you need for the Fireproof Elixir. You guide the dragon towards the volcanic area, eager to explore further.

      What would you like to do next?

      Join for free!

      • Connect with like-minded people who will support you with your goals and issues
      • Overcome people-pleasing and Nice Guy Syndrome to build strong social confidence
      • Exclusive online courses to learn advanced social skills, how to master your psychology, relationships, career progression and more
      Sweet! You are now a BROJO member.
      Check your email for details, course access, and more.
      Oops! Something went wrong while submitting the form. Please try again, or email me at mike@brojo.org. Thanks!

      What’s a Rich Text element?

      The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

      Static and dynamic content editing

      A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

      How to customize formatting for each rich text

      Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.