Computer Game AI: Difference between revisions
From GameLabWiki
No edit summary |
|||
(19 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Computer Game AI is the use of Artificial Intelligence in computer games in a broader sense, that is, "to create a compelling experience for the player." | Computer Game AI is the use of Artificial Intelligence in computer games in a broader sense, that is, "to create a compelling experience for the player."<ref name=":0" /> The first Computer Game AI ever to beat a human player in a specific game is the chess computer [[deep blue]]. | ||
==Introduction== | ==Introduction== | ||
Artificial Intelligence (AI) is used in video games to generate responsive, adaptive or „intelligent“ behaviors primarily in nonplayer characters (NPC’s). This so called „game AI“ focusses in general on small, relatively easy to solve tasks with the objective to improve the game-player experience. In contrast, academic AI is often used „to advance human understanding"<ref name=":1">Funge, John David: Artificial lntelligence for Computer Games. An Introduction, Massachusetts 2004, Chapter 1, S.1-15.</ref> by using a general solution. Used in many modern video games, game AI is most often implemented by using techniques such as pathfinding and decision trees to guide the actions of the NPC’s. | |||
==Main Part== | ==Main Part== | ||
===How to be intelligent for the player=== | |||
Although AI does not need to be personalized, most referrals to AI in video games are made to computer-controlled NPCs. But how does the player perceive the intelligence of an AI? They consider several aspects like goal-related behavior, physical characteristics, language cues and social skills. "A good looking and sympathetic NPC is likely to be considered more intelligent"<ref name=":2">Nareyek, Alexander: AI in Computer Games. In: ACM (Hrsg.): ACM Queue, Game Development. Vol. 1, No. 10, 02.2004, S.59-65.</ref> John David Funge puts it this way: <blockquote>"In terms of the player's perception of a game's AI, appropriate animations can also make an enonnous difference. For example, consider an NPC who is surrounded by hostile monsters and cannot think of anything intelligent to do. The NPC could simply stand there looking dumb, or the animation system can be triggered to play an animation of the NPC running around screaming. It is surprising how an appropriate animation can make all the difference in the player's perception of the AI."<ref name=":1" /></blockquote>Apart from an appropriate behavior of the NPC in complex situations, the aim of the AI is basically not to be better than the player, but to be as credible and entertaining as possible for them. This goal is mostly implicit. Instead, the NPC follows the lower level task of stopping the player at all costs.<ref name=":2" /> "Measures such as cheating are a lutely acceptable as long as the “suspension of disbelief” is retained."<ref name=":2" /> | |||
===Algorithms=== | |||
The basics of seemingly intelligent movement for game AI are not getting stuck in anything on their way and taking a possibly short route to the destination. To archive this goal, a couple of tools are available for development. The functionality of some popular pathfinding algorithms, including A*, can be tested on "PathFinding.js"<ref>PathFinding.js: https://qiao.github.io/PathFinding.js/visual/ (last checked on 14.04.2020)</ref> | |||
[[File:Pathfinding and Steering.png|thumb]] | |||
====Pathfinding with A*==== | |||
A* is the most used algorithm to compute a long distance route for NPCs. It requires the definition of waypoints and their connection to a network that spans the entire map to enable the evaluation of a route from A to B. Given a starting point and an end point, the A* algorithm gradually tries to find the shortest route along the waypoints. Step by step the algorithm explores the waypoints in increasing distance to the starting point until the end point is reached. Thereby A* uses an evaluation component which generates an estimate of the distance between a point and the destination to concentrate the spread on the most promising waypoints.<ref name=":2" /> (Shown in Fig.1) | |||
"In many cases, a game applies pathfinding techniques at multiple granularity levels. For example, for long distances, a path of high granularity is computed first, and then the paths between the selected waypoints are computed with finer granularity."<ref name=":2" /> | |||
====Finite state Machines and Decision Trees==== | |||
Both finite state machines (FSM) and decision trees can be realized by using simple if-then statements and are both used to control the behavior of an NPC in specific situation based on environmental events. "FSM describe under which events/conditions a current state is to be replaced by another—for example, switching from an attack mode to an escape mode if the NPC is hit."<ref name=":2" /> | |||
Decision trees use a branch and leaf structure, which, starting from one point, is always divided into two further branches and thus enables decision making. "This type is often used to make high-level strategic decisions–for example, if a computer guided opponent in a strategy game should prepare an attack or concentrate on resource gathering."<ref name=":2" /> | |||
====Expert systems==== | |||
One way to create high-level behavior in games, more in the style of academic AI, is to use brute force to create a controller that has a lot of knowledge about behavior in a specific game world. This expert system suffers at the beginning from the enormous amount of situations that may occur, which inevitably leads to many of the possibilities being overlooked. This in turn causes the NPC to behave inappropriately if one of the unexpected cases occurs, causing the controlled NPC to behave stupidly. If one of these errors is found before the game is released, it can be easily fixed by adding new information about the unexpected event to the controller. For this reason it is very difficult to establish such an AI system in a complex game world and without much time effort this approach is only possible in "toy problems". One advantage is that AI does not have to be perfect in games. The game can already be launched when the process of adding new knowledge does not result in any significant changes.<ref name=":1" /> | |||
===The problem with the term (artificial) intelligence=== | ===The problem with the term (artificial) intelligence=== | ||
Line 10: | Line 29: | ||
As it turns out the answer to this question isn't really straightforward. It is argued, that intelligence constitutes itself from a socio-intelligent territory, that lies somewhere in between humans and their cultural techniques.<ref>Gramelsberger et al: ''Mind the Game. Die Exteriorisierung des Geistes ins Spiel gebracht'', in: Gesellschaft für Medienwissenschaft (Hg.): Zeitschrift für Medienwissenschaft. Heft 21: Künstliche Intelligenzen, Jg. 11 (2019), S.29-38.</ref> Taking into consideration, that humans and cultures differ from each other and also more than likely change over time, this means that there isn't really a clear-cut way to describe intelligence. Again, it needs a frame of reference. | As it turns out the answer to this question isn't really straightforward. It is argued, that intelligence constitutes itself from a socio-intelligent territory, that lies somewhere in between humans and their cultural techniques.<ref>Gramelsberger et al: ''Mind the Game. Die Exteriorisierung des Geistes ins Spiel gebracht'', in: Gesellschaft für Medienwissenschaft (Hg.): Zeitschrift für Medienwissenschaft. Heft 21: Künstliche Intelligenzen, Jg. 11 (2019), S.29-38.</ref> Taking into consideration, that humans and cultures differ from each other and also more than likely change over time, this means that there isn't really a clear-cut way to describe intelligence. Again, it needs a frame of reference. | ||
While the Turing test provides a universally acclaimed method to measure the intelligence of machines, by letting a human interact with a machine. If that human is unable to distinguish the interaction with that with another human the test is passed. This test however proves to be a wrong frame of reference for AI in video games specifically, as the goal of AI in video games is not necessarily to emulate human-like behavior, but to provide the player with a fun gaming experience.<ref>Dill, Kevin: What Is Game AI?. In: CRC Press (Hrsg.): ''Game AI Pro. Collected Wisdom of Game AI Professionals'', 2014 | While the Turing test provides a universally acclaimed method to measure the intelligence of machines, by letting a human interact with a machine. If that human is unable to distinguish the interaction with that with another human the test is passed. This test however proves to be a wrong frame of reference for AI in video games specifically, as the goal of AI in video games is not necessarily to emulate human-like behavior, but to provide the player with a fun gaming experience.<ref name=":0">Dill, Kevin: What Is Game AI?. In: CRC Press (Hrsg.): ''Game AI Pro. Collected Wisdom of Game AI Professionals'', 2014.</ref> | ||
==Conclusion== | ==Conclusion== | ||
The constantly increasing processor power inspires the hope for an increasing performance of AI in general and Game AI in particular. With more available power for calculating AI, there is the possibility for an increased use of Expert Systems in games and therefore new possibilities. | |||
==Related Links/Research== | ==Related Links/Research== | ||
[[Category:Research Approaches]] | [[Category:Research Approaches]] | ||
<references /> | <references /> | ||
__FORCETOC__ |
Latest revision as of 13:52, 18 January 2021
Computer Game AI is the use of Artificial Intelligence in computer games in a broader sense, that is, "to create a compelling experience for the player."[1] The first Computer Game AI ever to beat a human player in a specific game is the chess computer deep blue.
Introduction
Artificial Intelligence (AI) is used in video games to generate responsive, adaptive or „intelligent“ behaviors primarily in nonplayer characters (NPC’s). This so called „game AI“ focusses in general on small, relatively easy to solve tasks with the objective to improve the game-player experience. In contrast, academic AI is often used „to advance human understanding"[2] by using a general solution. Used in many modern video games, game AI is most often implemented by using techniques such as pathfinding and decision trees to guide the actions of the NPC’s.
Main Part
How to be intelligent for the player
Although AI does not need to be personalized, most referrals to AI in video games are made to computer-controlled NPCs. But how does the player perceive the intelligence of an AI? They consider several aspects like goal-related behavior, physical characteristics, language cues and social skills. "A good looking and sympathetic NPC is likely to be considered more intelligent"[3] John David Funge puts it this way:
"In terms of the player's perception of a game's AI, appropriate animations can also make an enonnous difference. For example, consider an NPC who is surrounded by hostile monsters and cannot think of anything intelligent to do. The NPC could simply stand there looking dumb, or the animation system can be triggered to play an animation of the NPC running around screaming. It is surprising how an appropriate animation can make all the difference in the player's perception of the AI."[2]
Apart from an appropriate behavior of the NPC in complex situations, the aim of the AI is basically not to be better than the player, but to be as credible and entertaining as possible for them. This goal is mostly implicit. Instead, the NPC follows the lower level task of stopping the player at all costs.[3] "Measures such as cheating are a lutely acceptable as long as the “suspension of disbelief” is retained."[3]
Algorithms
The basics of seemingly intelligent movement for game AI are not getting stuck in anything on their way and taking a possibly short route to the destination. To archive this goal, a couple of tools are available for development. The functionality of some popular pathfinding algorithms, including A*, can be tested on "PathFinding.js"[4]

Pathfinding with A*
A* is the most used algorithm to compute a long distance route for NPCs. It requires the definition of waypoints and their connection to a network that spans the entire map to enable the evaluation of a route from A to B. Given a starting point and an end point, the A* algorithm gradually tries to find the shortest route along the waypoints. Step by step the algorithm explores the waypoints in increasing distance to the starting point until the end point is reached. Thereby A* uses an evaluation component which generates an estimate of the distance between a point and the destination to concentrate the spread on the most promising waypoints.[3] (Shown in Fig.1)
"In many cases, a game applies pathfinding techniques at multiple granularity levels. For example, for long distances, a path of high granularity is computed first, and then the paths between the selected waypoints are computed with finer granularity."[3]
Finite state Machines and Decision Trees
Both finite state machines (FSM) and decision trees can be realized by using simple if-then statements and are both used to control the behavior of an NPC in specific situation based on environmental events. "FSM describe under which events/conditions a current state is to be replaced by another—for example, switching from an attack mode to an escape mode if the NPC is hit."[3]
Decision trees use a branch and leaf structure, which, starting from one point, is always divided into two further branches and thus enables decision making. "This type is often used to make high-level strategic decisions–for example, if a computer guided opponent in a strategy game should prepare an attack or concentrate on resource gathering."[3]
Expert systems
One way to create high-level behavior in games, more in the style of academic AI, is to use brute force to create a controller that has a lot of knowledge about behavior in a specific game world. This expert system suffers at the beginning from the enormous amount of situations that may occur, which inevitably leads to many of the possibilities being overlooked. This in turn causes the NPC to behave inappropriately if one of the unexpected cases occurs, causing the controlled NPC to behave stupidly. If one of these errors is found before the game is released, it can be easily fixed by adding new information about the unexpected event to the controller. For this reason it is very difficult to establish such an AI system in a complex game world and without much time effort this approach is only possible in "toy problems". One advantage is that AI does not have to be perfect in games. The game can already be launched when the process of adding new knowledge does not result in any significant changes.[2]
The problem with the term (artificial) intelligence
Artificial intelligence in computer games or, computer sciences in general, has been a topic for decades. However oftentimes finding a clear definition for what exactly artificial intelligence is and what isn't, often proves to be an issue. The problem begins with the term of intelligence itself, and this has been criticized as early as in the 70s, when Joseph Weizenbaum described intelligence as a meaningless term that is in need of a frame of reference.[5] In the case of AI this frame of reference would be our own human intelligence, which poses the question: What is human intelligence?
As it turns out the answer to this question isn't really straightforward. It is argued, that intelligence constitutes itself from a socio-intelligent territory, that lies somewhere in between humans and their cultural techniques.[6] Taking into consideration, that humans and cultures differ from each other and also more than likely change over time, this means that there isn't really a clear-cut way to describe intelligence. Again, it needs a frame of reference.
While the Turing test provides a universally acclaimed method to measure the intelligence of machines, by letting a human interact with a machine. If that human is unable to distinguish the interaction with that with another human the test is passed. This test however proves to be a wrong frame of reference for AI in video games specifically, as the goal of AI in video games is not necessarily to emulate human-like behavior, but to provide the player with a fun gaming experience.[1]
Conclusion
The constantly increasing processor power inspires the hope for an increasing performance of AI in general and Game AI in particular. With more available power for calculating AI, there is the possibility for an increased use of Expert Systems in games and therefore new possibilities.
Related Links/Research
- ↑ 1.0 1.1 Dill, Kevin: What Is Game AI?. In: CRC Press (Hrsg.): Game AI Pro. Collected Wisdom of Game AI Professionals, 2014.
- ↑ 2.0 2.1 2.2 Funge, John David: Artificial lntelligence for Computer Games. An Introduction, Massachusetts 2004, Chapter 1, S.1-15.
- ↑ 3.0 3.1 3.2 3.3 3.4 3.5 3.6 Nareyek, Alexander: AI in Computer Games. In: ACM (Hrsg.): ACM Queue, Game Development. Vol. 1, No. 10, 02.2004, S.59-65.
- ↑ PathFinding.js: https://qiao.github.io/PathFinding.js/visual/ (last checked on 14.04.2020)
- ↑ Weizenbaum, Joseph: Computer Power and Human Reason. From Judgment to Calculation, New York 1976, Kapitel 9 [dt.: Die Macht der Computer und die Ohnmacht der Vernunft, Frankfurt/ M. 1994]. (S. 271)
- ↑ Gramelsberger et al: Mind the Game. Die Exteriorisierung des Geistes ins Spiel gebracht, in: Gesellschaft für Medienwissenschaft (Hg.): Zeitschrift für Medienwissenschaft. Heft 21: Künstliche Intelligenzen, Jg. 11 (2019), S.29-38.