Open In App

Game Playing in Artificial Intelligence

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

Game Playing is an important domain of artificial intelligence. Games don’t require much knowledge; the only knowledge we need to provide is the rules, legal moves and the conditions of winning or losing the game. Both players try to win the game. So, both of them try to make the best move possible at each turn. Searching techniques like BFS(Breadth First Search) are not accurate for this as the branching factor is very high, so searching will take a lot of time. So, we need another search procedures that improve –

  • Generate procedure so that only good moves are generated.
  • Test procedure so that the best move can be explored first.

Game playing is a popular application of artificial intelligence that involves the development of computer programs to play games, such as chess, checkers, or Go. The goal of game playing in artificial intelligence is to develop algorithms that can learn how to play games and make decisions that will lead to winning outcomes.

  1. One of the earliest examples of successful game playing AI is the chess program Deep Blue, developed by IBM, which defeated the world champion Garry Kasparov in 1997. Since then, AI has been applied to a wide range of games, including two-player games, multiplayer games, and video games.

There are two main approaches to game playing in AI, rule-based systems and machine learning-based systems. 

  1. Rule-based systems use a set of fixed rules to play the game. 
  2. Machine learning-based systems use algorithms to learn from experience and make decisions based on that experience. 

In recent years, machine learning-based systems have become increasingly popular, as they are able to learn from experience and improve over time, making them well-suited for complex games such as Go. For example, AlphaGo, developed by DeepMind, was the first machine learning-based system to defeat a world champion in the game of Go.

Game playing in AI is an active area of research and has many practical applications, including game development, education, and military training. By simulating game playing scenarios, AI algorithms can be used to develop more effective decision-making systems for real-world applications.

The most common search technique in game playing is Minimax search procedure. It is depth-first depth-limited search procedure. It is used for games like chess and tic-tac-toe. 

Minimax algorithm uses two functions – 

MOVEGEN : It generates all the possible moves that can be generated from the current position. 

STATICEVALUATION : It returns a value depending upon the goodness from the viewpoint of two-player 

This algorithm is a two player game, so we call the first player as PLAYER1 and second player as PLAYER2. The value of each node is backed-up from its children. For PLAYER1 the backed-up value is the maximum value of its children and for PLAYER2 the backed-up value is the minimum value of its children. It provides most promising move to PLAYER1, assuming that the PLAYER2 has make the best move. It is a recursive algorithm, as same procedure occurs at each level.

 

Figure 1: Before backing-up of values   

 

Figure 2: After backing-up of values We assume that PLAYER1 will start the game. 

4 levels are generated. The value to nodes H, I, J, K, L, M, N, O is provided by STATICEVALUATION function. Level 3 is maximizing level, so all nodes of level 3 will take maximum values of their children. Level 2 is minimizing level, so all its nodes will take minimum values of their children. This process continues. The value of A is 23. That means A should choose C move to win.   

Reference : Artificial Intelligence by Rich and Knight

Advantages of Game Playing in Artificial Intelligence:

  1. Advancement of AI: Game playing has been a driving force behind the development of artificial intelligence and has led to the creation of new algorithms and techniques that can be applied to other areas of AI.
  2. Education and training: Game playing can be used to teach AI techniques and algorithms to students and professionals, as well as to provide training for military and emergency response personnel.
  3. Research: Game playing is an active area of research in AI and provides an opportunity to study and develop new techniques for decision-making and problem-solving.
  4. Real-world applications: The techniques and algorithms developed for game playing can be applied to real-world applications, such as robotics, autonomous systems, and decision support systems.

Disadvantages of Game Playing in Artificial Intelligence:

  1. Limited scope: The techniques and algorithms developed for game playing may not be well-suited for other types of applications and may need to be adapted or modified for different domains.
  2. Computational cost: Game playing can be computationally expensive, especially for complex games such as chess or Go, and may require powerful computers to achieve real-time performance.

Reference books:

  1. “Artificial Intelligence and Games” edited by Michael Buro.
  2. “Game AI Pro: Collected Wisdom of Game AI Professionals” edited by Steve Rabin.
  3. “Artificial Intelligence with Python” by Prateek Joshi

Last Updated : 27 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads