“I’m sorry Dave. I’m afraid I can’t do that.”
If you’re a sci-fi film fan or (ahem) of a certain age, that quote from HAL 9000, the sentient computer and antagonist of ‘2001: A Space Odyssey’, will likely have sent a small shiver down your spine. Artificial intelligence, or AI, has long been a go-to Hollywood villain – think Skynet, Ultron and, arguably the most evil of them all, Proteus IV from ‘Demon Seed’.
Luckily, though, science fact hasn’t mirrored fiction (not yet, at least) and “friendly AI” is now in almost all our homes in the form of Siri, Cortana, Alexa and the like. It’s also used in more mundane processes like search engines, email filtering, and chatbots.
However, AI in game design needs to catch up.
Chances are you’ve heard lots about AI playing games – famous examples include AlphaGo, the computer program that plays the board game Go, and Deep Blue, the chess-playing computer that beat world champion Garry Kasparov in 1997.
But there’s a huge difference between this and the AI used in actual games. In fact, game design is one area where AI is actually a bit behind the times. One of the reasons for this is because researchers are using these game-playing computers to understand how to train machines to perform complicated tasks in other, more lucrative, areas (which we’ll go over in more detail later). So this type of research is accelerating at a much faster rate than in-game AI.
There are other reasons why game design has fallen behind in this field. But before we get into those, let’s look at some AI basics.
A brief definition of AI
To simply put it, AI is the simulation of human intelligence by machines. By finding patterns in large amounts of data, we can train them to learn from experience and perform human-like tasks.
AI in games at the moment
If you’ve ever played a video game, then you’ve interacted with AI in some form or another. At the moment, there are two core components to game AI.
- Pathfinding: this is used in all games and is where AI plots the shortest route between two points. A good example is the ghosts in ‘Pac-Mac’, which use pathfinding to decide which direction to go in.
- Finite state machines: this lets designers define complex behaviors. It powers NPCs (non-playable characters) in games, especially in open-world RPGs like ‘Red Dead Redemption 2’ or ‘Zelda: Breath of the Wild’.
These two techniques have been around since the 1980s and 90s, and the way games developers use them hasn’t really changed much since then. Obviously, as processing power has improved they made them look more sophisticated – but the underlying principles and fundamental concepts have hardly changed.
In practice, this means that while bosses in tricky games like ‘Dark Souls’ are using a form of AI to anticipate what players are going to do next, they’re still following set patterns which most of us can overcome without too much difficulty. And even games like ‘No Man’s Sky’ which uses a technique called procedural generation to build an almost infinite number of planets (18 quintillion if you’re counting), are still using long-established programming techniques to do that. So why aren’t game developers taking advantage of developments in this area?
The ghost in the machine
Precisely because it learns, AI is inherently unpredictable – which makes it a disadvantage in gaming. Developers ultimately want to know what a player will experience. So if you put in something that’s constantly adapting and learning from the player, there’s a good chance unexpected things will happen. At worst, this could make your game unplayable.
Imagine if all the NPCs in ‘Skyrim’ remembered every ‘bad’ thing you’ve ever done in Tamriel. It’d be carnage. So game developers have largely stuck with the type of AI that powers those Pac-Man villains – which nowadays isn’t actually considered all that intelligent.
To put it bluntly, they need to get over this. Why? Because used properly, AI could fundamentally change the way games are designed and played.
3 things AI could bring to the gaming table
1. It could make it quicker to create games
First up, AI could speed up the time it takes developers to build levels and craft open-world environments. In time, it could even build entire games from scratch. This would mean bigger and better games with more sophisticated and complex environments in much less time. This could particularly benefit small, indie game designers with less resources.
2. It could make your games more personal
Developers could also use AI to make the rules of a game changeable – so the experience I have playing it could be completely different to yours. Games could even learn what individual players like and dislike, and adapt things to suit them as they’re playing, creating a completely personalized experience. Automated game design like this could mean that every time you sit down to play a game will be like the first time – because the game is constantly redesigning itself, no two play-throughs will ever be the same.
3. It could bring self-learning characters into the mix
And lastly, while it’s not likely to happen any time soon, one day we could get a self-learning character in a game. One that can change and grow in the same way that we humans do.
So what are we waiting for? AI is the future of game design, and one we can and should embrace.
AI tools that are already about
Feeling inspired? There are lots of AI tools out there which you can use to add new features to your games and apps. Here’s a small snapshot of five of them we’ve found online.
- Caffe2 – developed by Facebook, Caffe2 aims to be an easy way to experiment with deep learning (where artificial neural networks learn from large amounts of data). It works across various platforms and integrates with Android Studio, Visual Studio and Xcode for mobile development.
- Core ML – you can use this to integrate trained machine learning models into iOS apps. It’s been designed for on-device performance, which uses less memory and power.
- ML Kit – made by Google, ML Kit offers the technologies the search engine uses to power its own experiences on mobile, and comes in both out-of-the-box solutions and custom models.
- TensorFlow – an open-source software library for building machine learning models. It has flexible architecture which makes it easy to use on desktop, mobile and edge devices.
- Cognitive Services – marketed as a way to use AI to solve business problems, Microsoft’s Cognitive Services lets you add intelligent algorithms to see, hear, speak, understand and interpret your user’s needs.