For video game fans, the concept of artificial intelligence (AI) is just as familiar as extra lives, respawns, and end bosses. Gamers have spent decades going up against computer-controlled opponents, whether a Pong paddle trying to prevent them from scoring a point or Bowser trying to stop Mario from rescuing Princess Peach. But recent developments in AI are pushing the gaming field even further, as researchers develop algorithms that can help fans make exciting new titles on their own.
The history of AI and that of gaming are inexorably intertwined. Early AI researchers saw games like chess as markers of intelligence, and thus perfect testing grounds for their work. “One of the very earliest things that people tried to do with this sort of burgeoning field was get it to play chess and get to play chess well, and, obviously, that eventually happened with Deep Blue,” says Matthew Guzdial, an AI researcher and assistant professor at the University of Alberta. Contemporary AI researchers have focused on more complex games, particularly the ancient Chinese game of Go.
As AI research moved into the subfield of machine learning — in which algorithms are “taught” how to learn on their own — video games emerged as a similarly suitable testbed. “A game is fully observable in a way that much of the real world isn’t,” says Guzdial. “Most importantly, it has rewards. It has a notion of ‘you are doing well’ or ‘you are doing badly.’ Building up those kinds of functions in life is extremely complicated.” In Super Mario Brothers, for instance, a player knows they’re doing poorly when they take damage or lose a life. They know they’re doing well when they finish a level, defeat enemies, or earn coins. That kind of feedback is key for training machine learning algorithms.
Of course, simply playing a game is one thing. What about creating them, the way some musicians are using AI to generate entirely new forms of their art? Guzdial and his team are working on exactly that. They’re developing software that, working alongside human partners, creates new video games out of whole cloth.
To train an AI to build its own Super Mario Bros.-style platforming games, for instance, Guzdial and his team had the software “watch” hours of videos showing people playing that game, as well as similar titles, like Mega Man and Kirby’s Adventure. After binge-watching gaming videos on YouTube and elsewhere, their software guesses at the rules of the games, then it checks its guesses by watching the videos once more. With the rules of a game sorted out, Guzdial’s algorithms follow a similar procedure to create new levels in which the rules are put to work.
“Once we’ve learned both of these bits, we put them into this common representation — basically squash these two sets of knowledge together into this big representation — we call it a game graph,” Guzdial says. “And you can think of this as this dense tangled web of information about a game. But importantly, it has all the information you need to basically reproduce the game.”
Finally, to generate its own games, the team’s software looks at all the information in this “game graph.” Then it begins to design, combine, and reproduce what it saw. In one example, Guzdial says the AI took the platforming styles of Mega Man and Super Mario Bros. and combined them to create something new. “Now imagine that happening over and over and over again for every piece of level design for every piece of game rule logic,” he says. That could result in entirely new AI-generated games — experiences similar to what gamers know and love, but novel enough to be notably different. Because Guzdial’s work is academic in nature, it’s protected under fair use, and thus isn’t likely to run afoul of copyright laws.
Guzdial says his goal isn’t to replace game creators. Instead, he’s hopeful his work can reduce the barrier of entry around game creation. “The plan was always to use this to help people make games,” he says. Using a tool like his, he says, a gamer could start building their own levels without learning how to write code. Other level-building tools, like Nintendo’s Super Mario Maker, are already big hits with fans. “It allows the user to basically define the set of rules that the AI has learned without having to explicitly know anything about coding,” he says.
Up next for Guzdial is a tool that could let gamers bored of their current selection to instantly build an entirely new game simply by deciding how they want their game to look and feel. The AI could then take that input and design a game, complete with rules and levels. All the software would need, he says, are two frames worth of data, defined by the player. “And as soon as we have more than one frame, the AI system learns rules that would explain the difference between the two frames,” he says. The AI makes predictions, the creator gives feedback, and the AI makes adjustments. At the end of this back and forth, Guzdial says, a gamer would have something brand new to enjoy. “We’re putting some finishing touches on the interface and then we’re going to run a human subject study to find out if we’re on the right track,” he says.
A practical consumer version of that technology is still likely years away. The industry may be slow to adopt it, too, nervous about software outmoding human game designers. Guzdial thinks that independent developers will likely be the trailblazers who make the first compelling games using tools like his. He pointed to Lab Assistant, a machine learning-based game in which a player has to teach language to a mysterious ooze in order to solve puzzles. “I can totally imagine that what we get are some passionate indie [developers] messing around with these technologies and making weird, cool, interesting little experiences,” he says. “But I don’t think they’re going to impact triple-A game development anytime soon.”