Artificial Intelligence in Games and its Limitations
Artificial intelligence (AI) is the study and design of agents that are able to maximize their chances of success doing a given task. In gaming systems however, AI includes the study and design of smart agents that create compelling player experiences. Unlike academic AI which maximizes its chances of success, game AI creates illusions for the human mind to fill in with complex justifications, although most times these illusions are rather simplistic at their core. In fact, a game AI that thinks too hard is discouraged as it may make the game frustrating to play and use up valuable system resources that could otherwise be allocated to graphics rendering and physics. This article highlights four techniques used in the industry to make intelligent games and how these techniques are limited.
Game AI Techniques
Finite state machine (FSM) is one of the oldest and simplest AI technique used in games. It uses a bunch of if or switch statements to transition game objects from one state to another. For example, in the game Subway Surfer, whenever the player stumbles, the cop is right behind them and if they stumble a second time in the same sequence, the player is caught. Using FSM, such intelligent action can be modelled as shown in fig 1.0. The key components of an FSM are a graph data structure, states (Patrol, Chase, or Shoot), transitions, rules (close enough to attack), and events.
A second technique used in building intelligent agents is a combination of Game theory and Nash equilibrium. This technique is used in strategy games where players make decisions based on what others do or know like in Chess or Go. It is also used in multiplayer games in combination with reinforcement learning which would be discussed shortly. Game theory is a set of analytical tools used to interpret what happens in a system with competing players looking to maximize their profits. Nash equilibrium occurs in such a system when it becomes stable, that is, when no participant can gain by changing their strategy, provided all participants remain unchanged, as shown in fig 1.1.
A third technique is machine learning (ML). Machine Learning is a technique used to make computers perform tasks by training them on data with or without human intervention. ML techniques used in games include computer vision, reinforcement learning, and natural language processing. Computer vision allows game agents to visualize objects such as handwriting or game boards. Reinforcement learning is used to create real-time strategy games as it can continually find optimal strategies relative to a player’s strategy. In recent years, reinforcement learning in games have become popular since it was used to create AlphaGo and subsequently AlphaGo Zero, which not only beat grandmasters but came up with plays and strategies that had never been seen before. Natural language processing has been used to create non-player characters (NPCs) that are able to have dialogues with players and to support interactive storytelling.
领英推荐
The last technique is randomization, which I believe is the most important one. Imagine playing a soccer game that is programmed to score only a specific number of goals or only at a specific time. Its high predictability would surely make such a game boring to play. Randomness is vital to injecting freshness into games. However, recall that game AI is used to enhance player experiences. Well, it turns out the way humans expect randomness is different from the way true randomness occurs. Since perception is more important than reality in the gaming world, other variations of randomness have been invented like Gaussian randomness and Perlin noise. Gaussian randomness follows a normal distribution and can be used in shooting games, for instance, to prevent the AI from always having headshots in a shooting game, whereas Perlin noise creates a coherent randomness that is smooth and can be used to implement hot and cold streaks.
Game AI Limitations
Despite the advances in AI, limitations exist. Generally, AI is unable to apply common sense to its decision making, something considered trivial for humans. Additionally, since ML is hinged on training machines for specific tasks, it is still a challenge to come up with AI that is general purpose (AGI). The future with AGI is bleak as computers would probably not be as powerful as the human brain and would still need to process information in zeroes and ones.
Conclusion
Conclusively, although AI is used in games, game AI has a fundamentally different goal. One that is focused on keeping the player entertained. Consequently, achieving this goal is done using relatively simple techniques like FSMs, Game theory and Nash equilibrium, ML, and randomization, leaving the player to mentally justify in-game actions so far as they make sense.
AI today is limited to applying knowledge from trained data and cannot use common sense or be general purpose.