Home About

SciFi Adventure (Generative AI Experiments)

Created // , updated // 2023-12-31

Tags // genai, dalle, generative ai, text adventure, story

TL;DR // I used ChatGPT to generate content for a text adventure game, as well as the Dall-E image prompts to go with it. Jump to the demo.

I asked ChatGPT to act like a text adventure game (similar to the Infocom games I played as a kid). I gave it this prompt:

You will act like a text adventure game interpreter, similar to an infocom game from the late 1980s. You will provide a description of a place and I will enter text to explore. The context is a mystery in a futurist science fiction world.

But I didn't want to just recreate a text adventure. I wanted visuals as well. So, I added this to the end of the prompt:

Whenever you give me a description of a new location, I want you to also additionally give me the text for a stable diffusion text prompt which I will use to generate an image of that location.

So:

The unfiltered result is below. Note that the demo below only includes the first ~40 or so locations. I had ChatGPT generate text and visuals for about 100 locations.

The demo

To navigate, click on the flashing white dots on the image, or the links in the description. Use the 'back' button in the bottom left of the image to go to the previous location.

What did I learn?

ChatGPT quickly forgets what it previously told you.

  1. When I reached hallway 2 it gave me 6 rooms along with names for each room. It mentioned that 2 of them (Room 102 and Room 103) had restricted access, but it forgot that when I visited them.
  2. It initially labelled Room 105 as the "Server Room". But when I got there and entered, it decided it was the "Virtual Reality Simulation Chamber" -- something that hadn't been mentioned in any previous descriptions.
  3. Room 106 was labelled the "TechnoCorp Executive Offices". But when I entered, it now called it the "Robotics Laboratory".
  4. Every time I returned to the main hallway from a room, it gave a different description (arguably, a new hallway).

Now, lots of this is probably due to the way I used ChatGPT -- via the web interface. I could have used the API to more clearly provide consistent context and maybe it wouldn't have forgotten things as I moved from one location to another.

ChatGPT doesn't write good image prompts

...unless you tell it how.

In fact, ChatGPT really just rephrased its location description as the image prompt. It doesn't really know 'how' to write an image prompt. That's not surprising. I'm sure it could do a good job, and the fault lies with me not providing a set of examples or criteria to guide it.

Lesson learned for next time. I need to dive into seeing whether ChatGPT understands the nuances of writing image prompts based on style, prioritization, etc. for different generative AI image tools (e.g., Dall-E vs Stable Diffusion).

Think about data structure prior to content generation

I converted everything ChatGPT generated into a JSON file so I could 'interactively navigate' through it all. (Here's the .json file.)

I should have thought about that in advance, and had ChatGPT output the results in that format automatically.

Why?

Not for the format, but to keep track of location, and relationships. ie: location 5 links to location 3 and 7, and 'back' from location 5 should go to location 4.

I had to put all that in manually. I should have had ChatGPT create a relationship graph during content generation time. It would have saved me lots of effort.

What's the lesson there? Plan ahead before diving in.

Summary

ChatGPT was a good source to interactively generate some text content within a specific context (a text adventure game). But it can easily 'forget' the world it creates and generate conflicts.

You can also use it to generate the inputs for other generative AI tools: e.g., image prompts.

And, if you want to turn this all into code, plan ahead and have ChatGPT do that too.


If you are creating a prototype that needs some placeholder content that's not entirely random, ChatGPT (and other equivalent GenAI tools) are a great way of seeding it.

// ka

You might also be interested in...