Artificial intelligence in video games has always gone hand in hand. In this article we will see how these two concepts have walked together since before video games even existed.
The beginnings of artificial intelligence in video games: chess
Even before the term "video games" was coined, developers were already thinking about trying to create an artificial intelligence capable of winning over chess grandmasters by means of the Minimax algorithm. The number of possible moves in a chess game, although tending to be infinite, is a finite number. Could we find a combination with which to always win? After only 10 moves in a game to this game, the number of possible positions in it is 165 quadrillion and a half. We currently do not have the computational capacity to be able to solve this question.
The objective of the Minimax algorithm is to find the ideal turn in every moment of the game from all the possible moves within a chess game. This is done by exploring the different possible moves in the future of the game and choosing the one that will benefit the player the most.
The dream of defeating a chess grandmaster came true in 1997 when the IBM supercomputer known as Deep Blue was able to defeat in a six-game match the considered one of the best chess players of all time Garri Kasparov. The two were tied at the start of the last game, but the machine was able to take the win there. The match was surrounded by controversy as in the second match Kasparov says he noticed irregularities in the machine's behaviour, as if he were playing with a person.
At present, there is still no perfect formula for winning at chess, but thanks to Machine Learning techniques you are getting closer and closer to achieving it.
When artificial intelligence created a sub-genre
Another title that was very important in the development of artificial intelligence in video games is Rogue. This game was released in 1980 and we are an adventurer who must explore a dungeon. One of the most interesting aspects of Rogue is that, thanks to AI, the dungeon is different from the previous one.
This feature was so important in the world of video games, that it created a new sub-genre within them called "roguelike" and was the basis for what we call today procedural games, which are capable of creating all or part of the content automatically with algorithms. Some examples of procedural games are Minecraft or No Man's Sky. This technique is currently not usually applied to all the content of the video game, since the machine is not yet able to interpret well the "human touch" applied to the game. An experienced user is able to notice when something has been done procedurally or not. He feels that he lacks some soul and pampering. There is still room for improvement in this type of videogame.
Looking for the right difficulty
Video games always seek the satisfaction of the player, in their essence they are a tool created to entertain someone. For that reason, it is necessary to keep the user in a balanced level of challenge and skill, since if the skill is much lower than the challenge proposed by the game, the user will get frustrated, while if the opposite happens, he will tend to get bored and leave the game.
This becomes a headache for the developers, who have to choose for which user profile they will create their game. The more profiles they want to reach, the more variants they must generalise in the artificial intelligence of the enemies, in the skills of the characters, in the elements of the map...
But we still have a problem. How do we know what means easy and what means hard? Where do we set the bar? That's what the dynamic adaptive difficulty was created for. With it, the game is able to recognize the difficulties that the user is experiencing and to raise or lower the difficulty depending on the user's ability.
One video game that uses adaptive dynamic difficulty is Resident Evil 4. In it, the intelligence of the enemies is reduced when we are defeated several times in a row in the same place. It is also used in Mario Kart 8, increasing or reducing the probability of different objects appearing in the boxes depending on the current position in the race.
The current adaptive dynamic difficulty still needs to be polished. The user can benefit from it depending on his or her patterns. For example, in The Last of Us: Part 2, if the user takes too long to move from one area to another he or she will be offered a hint. There is no way to know if the user really needed it or if he simply put the remote aside and waited to receive it. These types of decisions can affect the progression the player gets as he progresses through the game.
Sports video games
To finish the article we want to make a special mention to the artificial intelligence in the sport video games. This characteristic, in some titles more than others, has been evolving to give an artificial intelligence to teams and players as similar as possible to their real personality. If a team has a more defensive style it will try to defend better, if a more aggressive player will show it on the pitch.
However, this type of technology requires a high cost. Let's say an average football team has 22 players and a league has 20 clubs. It would require more than 400 customised artificial intelligences, so this type of technology is usually only implemented in the most iconic video game players and clubs.
Artificial intelligence and video games are growing together. Every time a new way of using it, or evolving it, is discovered, new and exciting paths in the world of video games emerge. And although it seems like a long journey has already been made, this journey has only just begun.