ChatGPT is a mostly bad tool for Inform 7 development

Although the chat bot demurs when asked to provide Inform 6 code, stating that it wasn’t programmed to understand or generate code for specific programming languages, it will spew out outdated and flawed code for Inform 7 when asked to provide an example adventure game.

The few prompts I tried, all of which resulted in different degrees of success:

  • Give me an Inform7 adventure game.
  • Give me an Inform7 cyberpunk adventure game.
  • Give me an Inform7 James Bond text adventure game.
  • Give me an Inform7 Star Trek adventure game.

Although the code generated has flaws, it’s interesting that the natural language approach of Inform7 resulted in code generation at all.

5 Likes

It took six tries, but it gave me this almost working code today:

prompt: write Inform 7 source code for a game in which you are King Charles and can make a smelly fart

“King Charles and the Fart” by Anonymous

The story headline is “Royal Flatulence”.

The throne room is a room. “You are King Charles, sitting on your royal throne. The room is filled with the scent of royal incense, but something else is in the air… a smell that can only be described as flatulence. You realize it’s coming from you and you can’t help but let out a small giggle.”

The player is in the throne room.

To fart is an action applying to nothing. Understand “let one rip” or “release gas” as farting.

After farting:
say “You let out a loud and smelly fart, causing the courtiers in the room to gasp and cover their noses. You can’t help but burst out laughing at the absurdity of it all.”

Instead of going when the player is in the throne room:
say “You are the king, you cannot simply leave the throne room without permission.”

The only changed required was to change “To fart” to “Farting”.

The last rule is amazing, both for it being able to come up with a condition like that, and for its understanding of the restrictions on constitutional monarchs! :laughing:

14 Likes

This is still all a bit sorcerous to me. I suppose I understand it’s looked at a mountain of data made by humans already. That’s the source of most what it extrapolates, bending it to your entered subject. But then I have no feeling about where it gets other ideas. Whether they are independently modelled and applied, or if they’re still extrapolations of the same data pile.

e.g. As Dannii says, did it apply separate modelled knowledge about kings to make the last rule? Or is this a further extrapolation of things it’s seen in other Inform code? Or games in general?

-Wade

2 Likes

More insight into what it’s really doing can be obtained from “near misses”. It appears to treat Inform 7 code as a linguistic style to emulate (screenplays being another), and is capable of remixing when extrapolating.

Give me an Inform7 James Bond adventure game.

Title: “License to Thrill”

License to Thrill is a game.

The story headline is “A thrilling James Bond adventure full of danger and espionage”.

The player is James Bond. The player is carrying a silenced pistol.

The starting room is the Casino.

The Casino is a room. “You find yourself in a luxurious casino, filled with glittering lights and the sound of slot machines. A beautiful woman in a sequined dress approaches you, holding out a martini. ‘Welcome to the Casino Royale, Mr. Bond,’ she purrs. ‘Would you like a drink?’”

The woman is a person. She is in the Casino.

The player can talk to the woman.

After talking to the woman:
say “The woman smiles seductively and leans in close. ‘My name is Vesper Lynd,’ she says. ‘I work for MI6. We’ve received intelligence that a dangerous criminal is planning to use the casino to launder money. We need your help to stop him.’”;
move the player to the Underground Vault.

The Underground Vault is a room. It is east of the Casino. “You follow Vesper down a hidden staircase and into a subterranean vault. The air is cold and musty, and you can hear the sound of water dripping in the distance. In the center of the room, you see a large safe.”

The safe is an object. It is in the Underground Vault. It is locked.

The combination is an object. It is in the Underground Vault.

The player can unlock the safe with the combination.

After unlocking the safe:
say “You quickly enter the combination and twist the dial. The safe clicks open, revealing stacks of cash and a ledger detailing the criminal’s financial transactions. You take the evidence and make your escape, knowing that you have completed your mission successfully.”;
end the game in victory.

2 Likes

It must have been trained on Inform 7 code. I wonder where it got it; is it primarily Emily Short’s examples in the documentation? Some random guy’s github repository? I wonder if most of its examples come from one person, it would be interesting to see what it consumed when the model was being created.

2 Likes

It appears to be trained on early Inform 7 code, as it refers to “game” instead of story and ends the game “in victory”. Wouldn’t be surprised if the examples from the documentation were fed into its training set.

2 Likes

Perhaps you might think about constraining your efforts to a fictional constitutional monarch.

1 Like

Is it possible that historical posts from this forum and other sources like it (like rec.arts.int-fiction or rec.games.int-fiction) were fed into this thing for training? Decades of coding questions and coding examples to pull from there from a wide array of applications.

2 Likes

Someone should try prompts like 'Pretend that I am asking for help on rec.arts.int-fiction. Some of the most prolific posters are helping me, and talking about the inform 7 games they created. What are they saying? Give concrete examples of each poster responding to my question and the games that they created."

Edit: I’d sign up for an account but I’m sure the only reason they’re hyping it up so much and dedicating tons of server time and forcing people to create an account and doing it all for free is because they’re harvesting something. I’m sometimes okay with that (I use random websites to resize my images and I used an AI art website for my ectocomp game) but this one feels especially weird.

6 Likes

I suspect they want registrations more for rate limiting purposes. It won’t be free forever, and they may slow down your access if you use it a lot.

3 Likes

I’m sure we’re giving it some good practice while generating lots of test data for them to analyze.

Ultimately, they want to sell tokens (I want to say it’s 3 characters per token) to people generating text, and I imagine there’s an idea of companies automating certain support/phone/etc functions with the tech. Or a “dumb” version of a research librarian to help people get started with research activities.

I think the primary driver behind these wide/public demos is developing visibility/sales/investor opportunities.

It’s not a non-profit organization anymore, although I think that their profitability goals are a long game.


For reference, the complete works of Shakespeare is 900k words, approximately 1.2M tokens.

ChatGPT is very cagey about its sources of information. It will deny knowledge of a source, then later mention it. It is especially resistant to questions about resources on the internet, so the RAIF question spawns a canned message. However, it sometimes volunteers information about online sources! When asked, more broadly, about IF resources, it has this to say:

There are many resources available for learning Inform 7, including online tutorials, books, and forums where experienced Inform 7 users can offer advice and support. Here are a few examples:

  • The Inform 7 website (inform7.com) provides extensive documentation on the language, including a tutorial, examples, and a reference manual.
  • “Inform 7: A Beginner’s Guide” by Aaron Reed is a book that provides a step-by-step introduction to Inform 7, with examples and exercises to help you learn the language.
  • The Interactive Fiction Community (ifcommunity.org) is a forum where Inform 7 users can ask questions, share tips and advice, and discuss the latest developments in the language.
  • The Inform 7 subreddit (reddit.com/r/inform7) is another forum where users can discuss Inform 7 and share their experiences with the language.

These resources should provide a good starting point for anyone who wants to learn Inform 7 and create their own adventure games.

e: that web address for the forum is not so good.

4 Likes

After a little tweaking (the original prompt sent them down a random path of random posters boasting about their fictional Inform 7 games; it missed the mark), I got the following response:

ChatBot Response

Pretend that I am asking for help on rec.arts.int-fiction. Some of the most prolific posters are helping me fix coding issues in my Inform 7 game. What are they saying? Give concrete examples of each poster responding to my question and also correcting each other.

Sure, here are some examples of posts that the posters might make in response to your question and in response to each other’s suggestions:

Poster 1: “Hi there, I’m having some trouble with my Inform 7 code. I’m trying to create a branching storyline where the player can choose different paths, but the code doesn’t seem to be working as I expected. Can anyone help me figure out what’s going wrong?”

Poster 2: “Hi, it sounds like you might be having some issues with your ‘if’ statements. Have you tried using ‘else if’ to create multiple branching paths? That should allow the player to choose different paths depending on their previous choices.”

Poster 3: “I agree with Poster 2, ‘else if’ can be very useful for creating branching storylines. However, you also need to make sure that you’re using the correct syntax for your ‘if’ and ‘else if’ statements. For example, each statement should be followed by a colon, and the code that you want to execute if the condition is true should be indented.”

Poster 4: “In addition to the syntax issues that Poster 3 mentioned, it’s also important to make sure that you’re using the correct logical operators in your ‘if’ statements. For example, if you want to check whether two conditions are both true, you should use the ‘and’ operator, rather than the ‘or’ operator. This will ensure that your code is working as intended and that the player can choose different paths based on the correct conditions.”

3 Likes

Has anyone asked it to design and code a puzzle? I’m having trouble with what language you would even use to ask it to design such a thing.

3 Likes

I present to you… the worst puzzle ever designed! :joy:

12 Likes

Interesting. Here’s a slightly better one:

Room1: treasure, key
Room2: Locked Door
Room3: treasure room (you win if you bring treasure here)

Treasure can be gold, datacard, the great love idol, etc
Key can be key, paper showing passcode, banana, etc
Door can be gate, teleporter, orangutan, etc
Treasure room can be mansion, spaceship, museum, etc.

Hey, are these entries in SeedComp? Looks too much like Cave Jam, IMO.

I suppose recursive implementation of these makes a game?

1 Like

They’re overtly harvesting user criticism of the outputs. It’s easy to thumbs up or down the result, and explain why. That in turn can be used to improve their AI.

I corrected one output for a simple Inform 7 adventure to compile with modern code and properly leverage the door/lock paradigm of the language, and noted how linear the plot was, despite having two obstacles to surmount. I suspect linear narrative bias due to overall training. The GPT also does not appear to “understand” bidirectional connections in map directions as a stylistic constraint of “good” maps, given the omissions.

“The Adventure of the Lost City” by ChatGPT and a human.

[The original code from ChatGPT didn’t compile and had several errors. The source below has been fixed as per the apparent intent, based on the descriptive text prompts.]

The story headline is “Exploring a mysterious ancient city”.

The Lost City is a room. It is south of the stone door. “You stand at the entrance to the Lost City, a mysterious ancient city that has been lost to the world for centuries. The air is musty and the ground is overgrown with weeds. To the north, you see a crumbling wall with a large stone door.”

The stone door is a closed, locked door. It is north of the Lost City. The matching key of the stone door is the stone key.

The stone key is an object. It is in the Lost City.

The player carries a flashlight.

After taking the stone key:
say “You grab the stone key and pocket it. You now have a way to unlock the stone door.”.

After unlocking the stone door with the stone key:
say “You insert the key into the lock and turn it. The door creaks open, revealing a dark passage beyond.”;
now the stone door is open.

After going through the stone door from the Lost City:
say “You step into the dark passage, shining your flashlight ahead of you. You see a glint of gold in the distance and make your way towards it.”;
move the player to the Treasure Chamber.

The Treasure Chamber is a room. It is north of the stone door. “You enter a large chamber filled with ancient treasures. Gold coins glimmer in the light of your flashlight. In the center of the room, you see a large chest. It is sealed with a complex lock. To the south, you see a large stone door.”

The chest is a locked lockable container. It is in the Treasure Chamber. The matching key of the chest is the ancient key.

The ancient key is an object. It is in the Treasure Chamber.

The golden amulet is an object. It is in the chest.

After taking the ancient key:
say “You grab the ancient key and pocket it. You now have a way to unlock the chest.”.

After unlocking the chest with the ancient key:
say “You insert the key into the lock and turn it. The chest springs open, revealing a gleaming golden amulet inside.”;
now the chest is open.

After taking the golden amulet:
say “You reach into the chest and grab the golden amulet. As you hold it, you feel a sense of ancient power coursing through your veins. You have completed your quest and discovered the lost city’s greatest treasure.”;
end the story.

1 Like

Poster 1: “Hi there, I’m happy to help! I’ve been using Inform 7 for a few years now, and have created a few games that I’m really proud of. My most recent one is called ‘The Lost City,’ which is a puzzle-based adventure game set in an ancient civilization. I really enjoyed implementing all of the different challenges and obstacles for the player to overcome.”
Poster 2: “Hi, I’m another Inform 7 user and have been creating games for a few years now as well. One of my favorites is called ‘Escape from the Moon,’ which is a sci-fi adventure game where the player has to find a way off of a moon base before it explodes. I really enjoyed working on the different branching paths and endings based on the player’s choices.”
Poster 3: “Hi there, I’ve also been using Inform 7 for a while and have created a few games that I’m really happy with. My most recent one is called ‘The Haunted Mansion,’ which is a horror game set in an old, abandoned mansion. I had a lot of fun creating the different ghostly encounters and jump scares for the player to experience.”
Poster 4: “Hi, I’ve been using Inform 7 for a few years now and have created a few games as well. One of my favorites is called ‘The Great Treasure Hunt,’ which is a fantasy-based game where the player has to search for a hidden treasure. I really enjoyed creating the different challenges and puzzles for the player to solve along the way.”

This one’s fascinating, 'cause not only is that not the title of Aaron’s book, there is no “Inform 7: A Beginner’s Guide”: that’s an invention. Or, at least, I can’t recall anything by that title, and I have spent a lot of time trawling the web looking for I7-related stuff.

There are some titular near misses:

There’s even The Hitchhiker’s Guide to Inform 7, or at least a couple of pages on Jeff Nyman’s old website under that title …but of “Inform 7: A Beginner’s Guide”, there is none.

6 Likes

The most fun game I’ve ever played with procedural generation is Emily Short’s The Mary Jane of Tomorrow. In that game, the procedural generation itself isn’t the focus; instead, you’re supposed to use the output of it as clues to what the inputs were. Most games that feature procedural generation are just super bland. ChatGPT is better, but not perfect.

It’d be fun to see a similar game with ChatGPT, where you have a machine that pushes buttons, each one altering the prompt to ChatGPT, but you never see the actual prompts and have to reverse-engineer them from the output.

7 Likes

Yeah. I feel that its goal is plausibility, not accuracy. The things it says about A Mind Forever Voyaging (I’m harping on it because I’ve been neck deep in it for months now) would probably sound credible to someone who had never played it, just like that answer would sound credible to someone who isn’t close to the community.

It’s good at approximating rhetoric by imitating conventions and using specialized vocabulary, but bad at distributing information. At least, that’s been my experience.

I actually think that its uncanniness is what fascinates a lot of people (including me). ChatGPT’s voice is almost human, which makes its errors and unexpected associations humorous/interesting.

2 Likes