Artificial intelligence (AI) is big business, in both the video game industry and as a whole. The technology has the potential to revolutionize every area of our life, and the use cases that we’ve seen so far are only the tip of the iceberg.
But we’re not here today to sell you on the idea of artificial intelligence, because we think that it already speaks for itself. Instead, we want to talk about gaming, and more specifically about how AI is being used to create better gaming experiences for everyone.
History of AI in Video Games
To better understand AI’s application for video games, it can help to take a little look at history. In the early days, AI was mostly used to create computerized opponents for strategy-based games like chess and checkers. The goal was to leave people feeling as though they were playing against real people, even when they were playing an algorithm.
The problem here is that true AI functions in a very different way, though the outcomes may be the same. Early video game AIs followed a simple set of instructions and just obeyed a set of “if this then that” instructions. Modern AI uses machine learning to teach itself, allowing it to act much more like a human being by being unpredictable and by finding its little tricks to outsmart the player.
The next step up for AI in gaming was arguably the arcade generation when we went from old school games of logic to a new breed of gaming only made possible by electronics. Animated sprites were introduced, such as the rudimentary AI that powers ghosts in Pacman.
In the next layer of games, marked by the console generation, AI started to truly take center stage. In the Secret of Mana on the Super Nintendo, different pre-set AIs are available. The player can specify whether party members are offensive or defensive, giving the player greater control over how they interact with AI characters.
But that’s got nothing on today, where artificial intelligence is used to power entire virtual worlds in virtual reality games, or where AI itself is a key talking point, as is the case with Detroit: Being Human. And we’re still only just scratching the surface.
Behavioral Decision Trees
Behavioral decision trees are all about allowing computer software to make complex decisions. An example of a three-step human behavioral decision tree might run as follows.
- Are you hungry?
- Yes
- Is there food in the fridge?
- Yes
- Make breakfast
- No
- Grab something on the commute
- Yes
- Is there food in the fridge?
- No
- Are you thirsty?
- Yes
- Drink some orange juice
- No
- Leave for work
- Yes
- Are you thirsty?
- Yes
This is an absurdly simple decision tree, but it helps to illustrate the way that AIs in video games think. This allows for a practically infinite number of combinations and permutations, which means that decision-making can go much, much deeper.
Behavior trees are easy to use and to understand, which makes them an attractive choice for game developers, but they can also quickly become complicated if you’re going dozens of levels deep. Nevertheless, without behavior trees, gaming would look very different.
Genetic Neural Networks
Genetic neural networks are another unique aspect of AI that could have useful applications for game developers. These essentially allow us to run simulations when we know the end result, but we don’t see the process along the way. An example here would be to reverse engineer population health data when dealing with pandemics. If we specify the outcome, a genetic neural network should be able to figure out the optimum approach to take to get to that outcome.
Most different subclasses of AI have applications in gaming. For example, natural language processing, which helps machines to understand written and spoken input, could power NPCs in games and eventually even allow us to talk directly to characters.
Genetic neural networks are no different, and a great example of them working in action comes to us via OpenAI and their Dota 2 bot, which beat a pro player after learning to play over just a couple of weeks. The developers essentially ran multiple Dota 2 games simultaneously, each running on a different node on the network, and then the data from all of these games could be brought together to strengthen the overall algorithm.
Even the most elite pro gamers can only play for maybe 14-16 hours a day. A genetic neural network can play for 24 hours a day, but it can also play 1,000 games at the same time. If it takes 10,000 hours of practice to master a skill, it will take a gamer nearly two years to master a game. The neural network could do it in ten hours.
Cheating AI
With AI already able to beat human players, you’d think that it wouldn’t need to cheat. You’d think that cheating would be impossible. But that’s not always the case, as you’ll have experienced for yourself if you’ve ever seen an AI-controlled character making moves that aren’t possible if you’re a human player.
Another entertaining example of this is a bot that was programmed to play Sonic the Hedgehog and to score the highest number of points possible. In an attempt to finish in the quickest time, the bot found a way to glitch through walls on underwater levels and used this unintended shortcut to outperform traditional players.
“Cheating” implies a certain amount of intent that most game AIs are incapable of. Still, developers need to be aware of the potential for AI to find new bugs and glitches to exploit, and indeed it should be standard practice to get an AI to play games as a routine part of QA testing. With a bit of luck, the AI will teach developers things about their game that they didn’t know themselves.
Conclusion
Even after all of the progress and evolution, we’re still in the early days of artificial intelligence, and there’s a long way for the technology to go before it reaches its true potential. At the moment, we’re starting to see some interesting use cases, but AI is yet to revolutionize gaming as much as it eventually will do.
Still, the early indications are good, and the best news of all is that the gaming marketplace is led by consumers. It’s us, the fans, who ultimately decide what takes off, and we’ll only embrace AI in gaming if it makes the games better – which it will. It’s an exciting time to be alive.