What Strategies Can Be Used to Keep an AI-Generated Game on Track?
Have you ever finished reading Wizard of Oz and felt like you could have done a better job than Dorothy and her team in dealing with the flying monkeys and the complex politics of the Munchkin guild? Hidden Door, an AI storytelling platform, is now offering players the opportunity to embark on TTRPG-like adventures set in their favorite literary worlds, giving them the freedom to navigate the Yellow Brick Road in their own unique way.
What’s behind (hidden) door number one
Hidden Door is both a business and a game. Hilary Mason, who is also the CEO, and Matt Brandwein founded Hidden Door in 2020 with the goal of “inspiring creativity through play with narrative AI.” The staff is split almost evenly between machine learning engineers and traditional game designers, Mason told ReturnByte.
Hidden Door, the game, is a social role-playing, narrative AI project currently in development by the company. “[We’re] trying to take all the joys of a tabletop game and let you play it without the friction [of having to physically do it], and AI is the technology that makes that possible,” Mason said.
Leveraging large language model and procedural generation systems, Hidden Door creates immersive RPG campaigns using the IP of the player’s choice – be it Wizard of Oz, as announced on Monday, or Star Trek, Old Man’s War, Dungeon Crawler Carl or Agatha. Christie’s Collected Murder Mystery Library. (As long as the IP owner agrees to license their own universe for use, which the latter four haven’t, the first of which has been dead long enough to no longer matter.)
“We’re solving a fundamentally different technical problem than what you’d see if you were just plugging content into an LLM like ChatGPT,” Mason said. “That’s where you make an unstructured text prompt and put it in a template that’s largely a black box.”
“GPT-3 came out a few months into our project, and it was clearly incredibly biased—out of control and … not useful for things like holding a story,” he explained. “The core of our design came from the original desire to build a safe, manageable system for telling great stories.
“We realized that if we could achieve our security goals,” he continued, “we could also create something manageable enough that writers would be comfortable letting people play in their worlds.”
Cursed village building blocks
Take, for example, The Wizard of Oz – a public domain series originally written by L. Frank Baum in 1904, spanning a total of 14 books. Hidden Door has adapted this text into an immersive in-game universe that the user and up to three teammates can explore. The system does that by taking unstructured input from players and mapping them into a Hidden Door game space, “which is basically a game engine that represents characters, places, objects, relationships and their conditions in a database,” Mason explained.
Each player begins by making a character sheet to determine their avatar’s stats and backstory. From there, the system incorporates this information, along with user responses to in-game prompts, to create a story. Instead of creating each scenario from scratch for each story every time, the story engine basically works with pre-calculated tropes, Mason explained: “We call them ‘story chain templates’ and they’re at the level of things like… a cursed village. Your goal in a scene is to figure out where the curse comes from, and solve it.”
Models serve as the basic building blocks of a story that form the narrative, provide a structure for players to explore and interact with the scene, and ultimately help determine when the story ends. The village curse, “you don’t know what it is,” Mason said. “You don’t know who has cursed the village or why, so it puts those things in order and then lets you loose to explore and interact and organize things.”
Each design is either handwritten or created and edited by a person. The team has already created thousands of such models. By combining three or four of these designs together, a game can create a compelling narrative arc that allows players to explore these universes in depth while maintaining strong content and safety barriers.
Safety (and inclusion) first
We’ve already seen far too many examples of what goes wrong when you let a chatbot off its leash. Whether it’s spouting Nazi propaganda or making false claims about space telescopes, today’s big language patterns are very prone to devolving into outright hate speech, “hallucinating” facts, and sometimes bullying people into suicide. These are all things that you don’t want to appear in games of all ages, so there are many things that you can’t say while playing.
“You can’t play anything you want,” Mason said. The system generates suggested actions based on the information typed by the player, but does not accept typed input directly. The system even gives feedback and comments on what the player suggests, “it can say: ‘Oh, no one has ever tried that before’ or ‘it’s going to be really difficult for you'”, he continued, but all the actions proposed by the user can be accepted by the system in advance.
“There’s never a word in any constructed sentence that’s not in our dictionary,” Mason said. “It gives us control both for security and to prevent inappropriate content—like if you typed ‘I joined the Nazis,’ it would respond with ‘you get a bowl of nachos.’ “
The company’s commitment to inclusiveness is also easily recognizable in the character creation process. “We made a very conscious decision to pull out things where we thought the model would introduce bias [like the character’s pronouns],” Mason said, “so they’re basically in a pre-computed distribution.”
That is, it does not involve machine learning, but they are coded into the game. “Eats, like roles, are in no way related to your avatar, skills or anything like that. You decide your pronouns and they are respected throughout the system,” he said. “There is no machine learning model that decides that the doctor should be he and the nurse should be she. It will be distributed randomly.”
Go ahead, sniff around
Aside from committing war atrocities, telling jokes to aristocrats, and other acts of mass violence, players can do whatever they want once the game starts. In Oz, each incident begins at the same point in the story, just as Dorothy splashes under the Wicked Witch of the East’s house. The players are not part of Dorothy’s direct story, but exist in the same time and space. “It’s a moment that most of us think about when we think about the world we chose it for,” Mason said.
But from there on, the player’s decisions and actions make the land of Oz their own. “We think of the world almost as its own character that collectively grows as people act out the story,” Mason said. “You find new locations that spawn as you play these stories and the world grows.”
And nothing says you have to follow the traditional “off to see the wizard” story. If the player arrives in Munchkin’s village, looks around and decides to declare himself the mayor, the game will definitely adapt the story to the new circumstances. Instead of fighting flying monkeys and pouring buckets of water, players are tasked with running political campaigns and gaining support from key members of the community. But then again, you wouldn’t be able to walk into town, declare yourself a warlord, and start summary purges of dissidents—because those words aren’t in Hidden Door’s dictionary.
“We have chain models that would be, ‘You persuade a bunch of people to support you in a political race,'” Mason said. “And when you’re mayor, you’d be able to tell stories that start in a different place.”
These decisions are also permanent in the game instance. The decision to help (or not) an NPC affects their opinion of the player and affects things like their future interactions. In addition, the NPCs created will reappear in subsequent playthroughs as recurring characters in your particular game instance.
“You can play as many stories in the same world as you want,” Mason said, “and everyone’s version of the Wizard of Oz is really different depending on how they play over time.” NPCs and other generated resources are not yet shareable between groups, but the team may consider implementing it in the future.
The Hidden Door team has developed a design philosophy that Mason calls “Chekhov’s Armory” to keep games from getting bogged down in side quests. Basically, the system keeps track of all the player’s in-game decisions and their effects on the rest of the story content. Whenever the system needs to advance the plot or add drama to keep players engaged, it can dip back into the armory to pull out a previous plot thread or previously wronged enemy. This also helps the system maintain the continuity of the entire story and prevent catch-22s from forming.
“The idea was to create this sense of a story where your choices matter, where you have complete agency, but the rails also move you forward,” Mason said. “That’s been one of our most common design challenges, adjusting how much freedom and how much we should motivate the story forward.”
16 secret herbs and language patterns
Hidden Door’s LLM differs significantly from the likes of ChatGPT in that it is not a monolithic model, but rather 16 individual ML algorithms, each specialized to handle a specific subtask within a larger generative task.
We use different models, some of which were based on open source models, some of which are proprietary,” explained Mason. “It’s not just one big LLM, it breaks it down into an interpretable system where we can use the best [AI] at the right moment.” It also allows the team to quickly plug in and compare newly released AI models with the existing system to see if it can improve gameplay. “Honestly, we design these engines so that game designers and story designers can come in and tune it, which means we have to give them those knobs.”
“One big question we worked on for a while was the plot prediction algorithm,” Mason continued. “So, ‘what should happen next based on the actions that just happened?’ Interestingly, the team quickly discovered that they could create incredibly boring stories simply by constantly choosing the system’s most popular recommendation – because this choice is invariably the “most obvious thing”, it can happen. On the other hand, if the system works on too many twists and turns and a surprise reveal, the story quickly changes into chaos.
This precision allows designers to modify the underlying game architecture to work in (for example) the light-hearted Pride and Prejudice RPG as well as the dark Pride and Prejudice and Zombies version. “We’re thinking a lot about how our creative colleagues can use this system to create story experiences,” Mason said.
Gore and smooching are A-OK (but only if it’s canon)
Although the game is designed to be family-friendly, Hidden Door’s target demographic is 18-35 year olds, so more mature themes are on the table for the designers as long as they make sense within the existing story. For Wizard of Oz, violence is both okay and an important plot point.
“We work directly with authors and creators and can use as little or as much written material as they have,” Mason said. “We take characters, plot types, vocabulary, elements, writing style and locations.”
The team also uses a “subgenre-based model” to help create a “pattern” for the story. “Wizard of Oz is largely fantasy with a few extra rules like animals can talk but no dragons or other fantastical creatures.” Essentially, the system takes the template of a more generic “fantasy story” and molds that story into a specific form “down to the specific rules of the Wizard of Oz universe,” Mason said. Creators who license their works for use in the game can dictate not only the original plot points of the story, but also the special behavior of NPCs and the inclusion of story arcs.
An adult story module is currently unavailable, but in-game physical affection is allowed. “You can make them kiss,” Mason said. “We have a very classy fade to black, and then you go to the next scene. An NPC can also reject you if they don’t like you or you don’t have that kind of relationship. It’s a very fine-tuning thing, but we try to keep it relationship-level in the core material.
The future of interactive fandom
“It raises the bar for creation dramatically,” Mason said of generative AI’s broader promise for the gaming industry, “but it doesn’t raise the ceiling.” We’re just starting to see a generation of AIs used to enhance NPC dialogue, Mason points out, and could be just a year or two away from a game with “fully realized” generative AI. “The brilliance of a person with a creative vision is not something we usually see from these systems, and that’s partly because of what they are: compressing a large amount of data and aiming for the median.”
“I think raising the floor is a lot of excitement. I think it makes creativity more accessible to a large number of people who can then choose to pursue it in their own way or use it as a tool in their process,” he continued. “I also think it allows more people to be fans of things and gain some independence in the way they want to interact with creativity that we don’t currently have.”
If you want to try Hidden Door yourself, you can sign up for the waiting list before the upcoming test runs.