There are more and more applications of artificial intelligence in games, including automatic pathfinding, attack, character growth, state machines and many other artificial intelligence technologies, and NPCs in games are becoming more and more “intelligent”, sometimes making it difficult to distinguish the real from the fake. Today we will explore the application principles of artificial intelligence in games and discuss how they will affect the future development of games.
Intelligent + automatic – artificial intelligence in games
For example, in strategy games, we command a large number of NPCs to move from one location to another, which requires consideration of various obstacles, enemy fire points and path consumption, and many other factors. If the specific operation by our players one by one, will certainly be tired of vomiting blood, and if left to NPC automatic movement, then how to find the best route to move, for these games do not really think consciousness of the character, is not a simple matter. And now most of the game, similar to this planning of the route, with the help of big data + intelligent self-learning, so that NPCs have a certain artificial intelligence, which can completely replace the player, automatically achieve the best movement (Figure 1).
Figure 1 The Three Kingdoms of Chaos new ancient city treasure exploration route planning map
Behind the high intelligence – know the artificial intelligence in the game
How does the AI work in the actual game scenes? Take The Sims game as an example, there are a large number of game scenes which are relatively simple and mechanical, as long as a simple judgment can be made to complete the game operation. For such game scenarios, AI is generally implemented by means of “behavior trees”. The behavior tree controls the behavior of the characters in the game through state enumeration and process, and adds “IF/THEN” type judgments to the nodes to realize the intelligent behavior of the characters. To perform the “eating” action in The Sims, the AI just needs to set up a judgmental behavior tree (Figure 2).
Figure 2 Behavior tree judgment
The above is only a simple AI application, for complex scenarios in games such as FIFA and live soccer, AI generally uses “multi-layer state machine” for team collaboration. Artificial intelligence divides the whole team into 1+X layers, where “1” is the team state machine and X is the state machine of each character (various states of team members such as starting, passing, shooting, etc.). Under the jurisdiction of team “1”, the states of members in X layer will be coordinated, so that each team member can collaborate with each other to complete various complex game states.
Of course, for more complex game scenarios, not simply 1 + X can be completed, in order to make the game character more like real humans in the game, artificial intelligence also introduced neural networks, self-learning and other applications. For example, for complex strategy games, developers will let the AI play their respective roles to fight each other, and then through a certain model to generate complex algorithms, and then with the powerful self-learning ability of artificial intelligence, so that the AI can respond to each scene in the game with ease.
The FIFA game also applies a deep neural network Deepfakes algorithm, which generates extremely realistic faces of soccer players by replacing any face in the video with another person’s face through autoencoder and convolutional neural network (Figure 3). Then a large number of player avatars are intercepted from the video footage of the game to obtain information from all angles, and the model is architected and trained to make the game characters more realistic and believable.
Figure 3 FIFA training model
Of course, for large strategy games such as King’s Glory and League of Legends, which have a wealth of more complex factors such as alignment, blood addition, defense addition, and deceleration, AI needs to learn and train these factors with the help of more advanced algorithms, more complex models, and more powerful neural network technology.
Not only automatic – more applications of artificial intelligence in the game
Now there are many games that have the function of automatic hanging and upgrading, and when you have not been online for a period of time, you will find your character growing on its own, these are also applications of artificial intelligence. Without the player’s operation, the game character realizes many automated operations, planning travel paths, designing attack actions, and even realizing the game self-learning to familiarize with the enemies and background environment that need to be defeated to enhance the realism and complexity, allowing us to easily realize the mastery of the game.
On the other hand, for game developers, the use of technologies such as neural networks and genetic algorithms to react interactively to different players and achieve a linear task flow different from the stereotypical one in traditional games makes the game more flexible, which not only saves a lot of development costs but also optimizes the game experience (Figure 4).
Figure 4 “Road to Survival” equipped with AI Director background core
For example, in real-time strategy games such as StarCraft, the fog of war prevents both sides of the game from knowing all the information, in which case a higher level of intelligence is needed to judge the current situation based on the limited information collected. Google’s AlphaGO has made a big splash in the Go wars, but its current performance in real-time strategy is not as good as it could be, and the AI’s judgment is simply no match for humans. We expect better performance from AI in these games, making future game matchups more exciting and interesting (Figure 5).
Figure 5 The AI is somewhat overwhelmed by StarCraft