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
Former Digital Trends Contributor
I'm a UK-based tech writer covering Cool Tech at Digital Trends. I've also written for Fast Company, Wired, the Guardian…
Algorithmic architecture: Should we let A.I. design buildings for us?
Generated Venice cities

Designs iterate over time. Architecture designed and built in 1921 won’t look the same as a building from 1971 or from 2021. Trends change, materials evolve, and issues like sustainability gain importance, among other factors. But what if this evolution wasn’t just about the types of buildings architects design, but was, in fact, key to how they design? That’s the promise of evolutionary algorithms as a design tool.

While designers have long since used tools like Computer Aided Design (CAD) to help conceptualize projects, proponents of generative design want to go several steps further. They want to use algorithms that mimic evolutionary processes inside a computer to help design buildings from the ground up. And, at least when it comes to houses, the results are pretty darn interesting.
Generative design
Celestino Soddu has been working with evolutionary algorithms for longer than most people working today have been using computers. A contemporary Italian architect and designer now in his mid-70s, Soddu became interested in the technology’s potential impact on design back in the days of the Apple II. What interested him was the potential for endlessly riffing on a theme. Or as Soddu, who is also professor of generative design at the Polytechnic University of Milan in Italy, told Digital Trends, he liked the idea of “opening the door to endless variation.”

Read more
Emotion-sensing A.I. is here, and it could be in your next job interview
man speaking into phone

I vividly remember witnessing speech recognition technology in action for the first time. It was in the mid-1990s on a Macintosh computer in my grade school classroom. The science fiction writer Arthur C. Clarke once wrote that “any sufficiently advanced technology is indistinguishable from magic” -- and this was magical all right, seeing spoken words appearing on the screen without anyone having to physically hammer them out on a keyboard.

Jump forward another couple of decades, and now a large (and rapidly growing) number of our devices feature A.I. assistants like Apple’s Siri or Amazon’s Alexa. These tools, built using the latest artificial intelligence technology, aren’t simply able to transcribe words -- they are able to make sense of their contents to carry out actions.

Read more
World’s Fair 2.0: The mission to resurrect the greatest tech expo of all time
New York World's Fair — Unisphere & Flag Display

The Twitter header image belonging to Cameron Wiese is a black-and-white photograph of the Unisphere, an enormous, spherical, stainless steel representation of Earth created as a centerpiece for the 1964/1965 World’s Fair in Flushing Meadows-Corona Park in Queens, New York.

Over two six-month stints across a couple of years, the Unisphere was seen by more than 50 million people who visited the World’s Fair’s 650 acres of displays, pavilions, and public spaces, bringing together citizens, cities, nations, and corporations for a tantalizing glimpse at the future. The Unisphere served as a symbol of humanity’s shared home and, perhaps, of our ability to bend its resources to our will. At various times during the World’s Fair, a performer wearing a Bell Aviation's Rocket Pack jetted past the massive globe, highlighting humankind's ability to rise above any and all challenges.

Read more