Skip to main content

The world’s most freakishly realistic text-generating A.I. just got gamified

What would an adventure game designed by the world’s most dangerous A.I. look like? A neuroscience grad student is here to help you find out.

Earlier this year, OpenAI, an A.I. startup once sponsored by Elon Musk, created a text-generating bot deemed too dangerous to ever release to the public. Called GPT-2, the algorithm was designed to generate text so humanlike that it could convincingly pass itself off as being written by a person. Feed it the start of a newspaper article, for instance, and it would dream up the rest, complete with imagined quotes. The results were a Turing Test tailor-made for the fake news-infused world of 2019.

Recommended Videos

Of course, like Hannibal Lecter, Heath Ledger’s Joker, or any other top-notch antagonist, it didn’t take GPT-2 too long to escape from its prison. Within months, a version of it had found its way online (you can try it out here.) Now it has formed the basis for a text adventure game created by Northwestern University neuroscience graduate student Nathan Whitmore. Building on the predictive neural network framework of GPT-2, GPT Adventure promises to rewrite itself every time it’s played. It’s a procedurally generated game experience in which players can do whatever they want within the confines of a world controlled by the fugitive A.I.

And you know what? Not since Sarah and John Connor teamed up with The Terminator to take on Skynet has the world’s most dangerous artificial intelligence been quite so much fun.

The game that rewrites itself

“GPT-2 is basically an extremely powerful predictive text algorithm,” Whitmore told Digital Trends. “You give it some text and it tries to predict what comes next. This is really well-suited to text adventure games. You can feed in the player’s current location and their action — [for example], ‘go east’ — and then you just ask GPT-2 to predict what text comes next, which is the consequence of that action. Then the player makes another action, and you have a game.”

Image used with permission by copyright holder

In GPT Adventure, the text world of the game is generated by the predictive GPT-2. That means that, instead of programming a collection of rooms and monsters in advance, the game starts your character in a location and then uses A.I. to figure out what happens next.

To turn GPT-2 into the world’s most dangerous Dungeon Master, Whitmore started out by collecting transcripts of users playing Zork and Colossal Cave Adventure. These text-based adventure games were created in the mid-1970s, originally for Digital Equipment Corporation’s PDP-10 mainframe, a computer about the size of a refrigerator, and considerably less powerful than the devices most of us carry around in our pockets. He was inspired by Mind Game, a fictitious game that’s generated in real-time by artificial intelligence in Orson Scott Card’s sci-fi novel Ender’s Game.

“[To create the game, I had to] train GPT-2 to produce text that looks like the game transcripts,” Whitmore continued. “This is done using algorithms that automatically adjust GPT-2’s internal parameters until the text it produces looks like the text from the text adventures. This lets GPT-2 learn the mechanics of text adventure games; things like ‘If the player says look east, describe an object to the east of them.’”

“You give it some text and it tries to predict what comes next.”

The resulting game looks and plays a lot like the decades-old text adventure games it is modeled on, with the same basic elements and gameplay mechanics. Whitmore acknowledges that he had to make a few tweaks along the way. “Even with this, GPT-2 sometimes makes mistakes like forgetting where the player is,” he said. “So there’s also some manually written code that tries to correct the more common kinds of mistakes and make the game more playable.”

On the face of it, the resulting game is simplistic. It’ll play in your browser (you can follow the simple instructions to get it started here) and, unlike Ender’s Game’s Mind Game, there are no graphics. Whitmore said, “I did play around with using this neural network to automatically generate images based on the place descriptions which yielded some weird results.” However, these are not a part of the finished product.

But is it creative?

GPT Adventure is good fun, albeit full of the strange flourishes that occur when people use A.I. to generate new scripts for, say, one of J.D.’s monologues from Scrubs or a chapter from a new Game of Thrones novel. If you’re familiar with the source games, you can begin to see where some of the ideas and concepts have been lifted from and mashed together in strange new ways.

Click to enlarge

Really, though, it hints at something amazing: Another piece of evidence that machines can, to some degree, display creativity. While logic doesn’t always apply, players can type any command into the game and, in many cases, it will oblige and try to come up with whatever step follows next.

“From a gameplay perspective, the cool thing is it can be totally open-ended and you can do basically anything you want,” Whitmore said. “I tried a version of it where you’re exploring a space station instead of a cave. I can say ‘>eat rock’ or ‘>ride sheep’ and the game will just go with it and try to figure out what should happen next. You can do all this weird stuff that no-one would ever bother to program because the GPT-2 model has enough ‘common sense’ knowledge to roll with it in a believable way.”

“You can do all this weird stuff that no-one would ever bother to program because the GPT-2 model has enough ‘common sense’ knowledge to roll with it in a believable way.”

Would he say that it’s creative? “I think it’s creative in a very basic way, like how a person playing ‘Apples to Apples’ is creative,” Whitmore continued. “It’s taking things from old adventure games and rearranging them into something that’s new and interesting and different every time. But it’s not actually generating an overall plot or overarching idea. There are a lot of different kinds of creativity and I think it’s doing one: Generating novel environments, but not the other kinds: Figuring out an intriguing plot for a game.”

A step in the right direction

Ultimately, just as text adventure games were just one step in the process that led to today’s cutting-edge 3D games (and will continue on from there), so GPT Adventure is just another data point in the advance of A.I. But it’s a pretty darn exciting data point — and, as Whitmore notes, the fact that such tools are now publicly available makes things all the more fun.

“One of the really cool things about this is that there are public tools like GPT-2-simple and Google Colaboratory (read: Google’s Jupyter notebook environment which runs programs in the cloud and stores its notebooks on Google Drive) that make it really easy to do these kinds of creative things with A.I.”

Anyone want to guess where things go from here? Heck, if the Simulation Hypothesis is true, maybe we’re all in a big A.I.-generated adventure game already…

Luke Dormehl
I'm a UK-based tech writer covering Cool Tech at Digital Trends. I've also written for Fast Company, Wired, the Guardian…
Voyage is an A.I. gaming paradise where bots write the rules
An AI draws a cowboy pizza in Pixel This.

If you play a lot of video games, you’re no stranger to competing against a machine. Play a game like Halo Infinite long enough and you’ll probably bump into a few bots that aren’t the smartest Spartans on the battlefield. But what if you could play games with a genius A.I. that actually feels like it's listening and responding to you like a human?

Voyage is a new A.I. gaming platform featuring unique games built around machines. The experimental project is spearheaded by Latitude, the studio behind A.I. Dungeon. In that text-based adventure game, a machine fluidly crafts a story by responding to everything a user types, just like an RPG dungeon master. It was an impressive trick in 2019, but it’s only the beginning of what Voyage has in store for players.

Read more
The funny formula: Why machine-generated humor is the holy grail of A.I.
microphone in a bar

In "The Outrageous Okona," the fourth episode of the second season of Star Trek: The Next Generation, the Enterprise's resident android Data attempts to learn the one skill it has previously been unable to master: Humor. Visiting the ship’s Holodeck, Data takes lessons from a holographic comedian to try and understand the business of making funny.

While the worlds of Star Trek and the real world can be far apart at times, this plotline rings true for machine intelligence here on Earth. Put simply, getting an A.I. to understand humor and then to generate its own jokes turns out to be extraordinarily tough.

Read more
Read the eerily beautiful ‘synthetic scripture’ of an A.I. that thinks it’s God
ai religion bot gpt 2 art 4

Travis DeShazo is, to paraphrase Cake’s 2001 song “Comfort Eagle,” building a religion. He is building it bigger. He is increasing the parameters. And adding more data.

The results are fairly convincing, too, at least as far as synthetic scripture (his words) goes. “Not a god of the void or of chaos, but a god of wisdom,” reads one message, posted on the @gods_txt Twitter feed for GPT-2 Religion A.I. “This is the knowledge of divinity that I, the Supreme Being, impart to you. When a man learns this, he attains what the rest of mankind has not, and becomes a true god. Obedience to Me! Obey!”

Read more