Actions

Computer Game AI

From GameLabWiki

In progress

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]

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]

"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

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

Related Links/Research

  1. 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. 2.0 2.1 Funge, John David: Artificial lntelligence for Computer Games. An Introduction, Massachusetts 2004, Chapter 1, S.1-15.
  3. 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.
  4. PathFinding.js: https://qiao.github.io/PathFinding.js/visual/ (last checked on 14.04.2020)
  5. 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)
  6. 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.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.