Take a few minutes and do some research on the evolution of video gaming. While classic games like Pac-Man, the original Super Mario Bros., and the early Final Fantasy games certainly have a retro appeal to them, they pale in comparison to the leading games of the last few years – such as Grand Theft Auto V, The Witcher 3, Dota 2 etc.
It’s not just that these newer games have better graphics and smoother interfaces, but they’re also far more advanced. The scenarios are more complex, the experiences are unique from session to session, and the possibilities are virtually unlimited. In this sense, today’s leading games do a better job of mimicking real life. And at the heart of it all is machine learning.
What is Machine Learning?
Machine learning is basically the capability of advanced software to identify and recognize patterns, which it then learns from and uses to perform specific actions. This means the developer behind the software (or game) doesn’t have to manually program every event or outcome into the algorithm. Instead, the software can be told what to look for and appropriate responses will be initiated when triggers are encountered.
“With machine learning, the software is able to look at all kinds of data and compare existing conditions to past conditions—the software learns how to recognize patterns and learns that certain patterns mean certain things. It learns when things are normal, verses when they are abnormal,” PinnacleART explains. “These capabilities mean that, as time goes by and various things are experienced, machine learning software will analyze parameters to recognize and predict events in the future.”
While PinnacleART uses machine learning in industrial settings – managing the reliability of assets in warehouse and production facilities – there are hundreds of other applications across dozens of different fields. Video game development is one of them.
Machine Learning in Video Games
When applied to video games, machine learning works by feeding the system or algorithm with different information and observations that it can use to make predictions about future outcomes. To do this effectively, the system has to learn the desired input-output mapping.
According to Alessia Nigretti, who works for Unity and spends his career introducing new features to game developers, there are a few different ways to accomplish this. One commonly used method is “reinforcement learning.”
“Reinforcement Learning is a learning method based on not telling the system what to do, but only what is right and what is wrong,” Nigretti explains. “This means that we let the system perform random actions and we provide a reward or a punishment when we think that these actions are respectively right or wrong.”
There eventually comes a time when the system recognizes that it has to perform a certain set of actions in order to get positive rewards. This “revelation” leads to the development of a neutral network within the computer system that creates a complex web of outcomes and actions for different scenarios. What’s most interesting, however, is that the “machine” gets smarter with each interaction. This means an infinite number of actions and scenarios are introduced as more gameplay unfolds.
We’re still very much in the early stages of using machine learning to power video games, but the possibilities are limitless. Unity recently provided an example of the potential for reinforcement learning with a simple knock-off version of the game Crossy Road (much like Frogger).
In the game, a chicken is tasked with crossing a wide road that continues to stretch out as the game progresses. The chicken gets a point every time it reaches a gift box, while losing a point whenever it’s hit by a truck. The goal is to score as many points as possible.
The first few times, the chicken runs around with no rhyme or reason – scoring a few points here and there, but getting smacked by trucks over and over again. But after a few hours of playing the game, the machine learning kicks in and the chicken eventually dupes the game and figure out how to rack up points without getting hit.
In the future, it’s believed that game developers will be able to integrate these same machine learning principles into more complex games – such as popular first-person shooters.
“It will probably develop some strategy where it’s going to show itself in surprising ways, and you’re going to chase it, but you won’t catch it, and it won’t kill you right away,” says Danny Lange, VP of AI and machine learning at Unity. “You open the door for more creative behavior, which you could not possibly even imagine; or it would be very, very labor intensive to implement in traditional code.”
Looking Towards a Smarter Future
On the surface level, it’s clear that video games are getting better with time. Graphics, for example, seem to improve each and every year. But if you look beneath the surface at the algorithms and computer models powering these games, it’s clear that they’re improving in other ways, too. Keep an eye on machine learning, because a smarter future is quickly approaching.