Game Playing.

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

Seminar on Game Playing in AI. 1/21/2014University College of Engineering2 Definition…. Game Game playing is a search problem defined by: 1. Initial state.
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search Chapter 5.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
This time: Outline Game playing The minimax algorithm
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
Game Playing CSC361 AI CSC361: Game Playing.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6: Adversarial Search Fall 2008 Marco Valtorta.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search: Game Playing Reading: Chess paper.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Alpha-Beta Search. 2 Two-player games The object of a search is to find a path from the starting position to a goal position In a puzzle-type problem,
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
CSC 412: AI Adversarial Search
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Lecture 5 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game Playing. Introduction Why is game playing so interesting from an AI point of view? –Game Playing is harder then common searching The search space.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Agents that can play multi-player games. Recall: Single-player, fully-observable, deterministic game agents An agent that plays Peg Solitaire involves.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Instructor: Vincent Conitzer
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
GAME PLAYING 1. There were two reasons that games appeared to be a good domain in which to explore machine intelligence: 1.They provide a structured task.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Adversarial Search Chapter 6 Section 1 – 4. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Adversarial Search Chapter 5 Sections 1 – 4. AI & Expert Systems© Dr. Khalid Kaabneh, AAU Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
ADVERSARIAL SEARCH Chapter 6 Section 1 – 4. OUTLINE Optimal decisions α-β pruning Imperfect, real-time decisions.
Chapter 5 Adversarial Search. 5.1 Games Why Study Game Playing? Games allow us to experiment with easier versions of real-world situations Hostile agents.
1 Chapter 6 Game Playing. 2 Chapter 6 Contents l Game Trees l Assumptions l Static evaluation functions l Searching game trees l Minimax l Bounded lookahead.
Artificial Intelligence AIMA §5: Adversarial Search
Adversarial Search and Game-Playing
PENGANTAR INTELIJENSIA BUATAN (64A614)
Pengantar Kecerdasan Buatan
Adversarial Search.
Game Playing.
David Kauchak CS52 – Spring 2016
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Game Playing

Introduction Why is game playing so interesting from an AI point of view? Game Playing is harder then common searching The search space is too large for complete searches We are facing an unpredictable opponent Games are adversarial search problems Solution is strategy, contingency plan. There are time limits Game playing is considered to be an intelligent activity.

Introduction Two-Person games How do we think when we play e.g. Chess? If I move my queen there, then my opponent has to move his knight there and then can I move my pawn there and check mate. We are making some assumptions We want our best move The opponent wants his best move The opponent has the same information as we Our opponent wants to win

Game Trees Game trees are used to represent two-player games. Alternate moves in the game are represented by alternate levels in the tree (plies). Nodes in the tree represent positions. Edges between nodes represent moves. Leaf nodes represent won, lost or drawn positions. For most games, the game tree can be enormous.

Game Trees This is an example of a partial game tree for the game tic-tac-toe. Even for this simple game, the game tree is very large.

Assumptions In talking about game playing systems, we make a number of assumptions: The opponent is rational – will play to win. The game is zero-sum – if one player wins, the other loses. Usually, the two players have complete knowledge of the game. For games such as poker, this is clearly not true.

Minimax Minimax is a method used to evaluate game trees. A static evaluator is applied to leaf nodes, and values are passed back up the tree to determine the best score the computer can obtain against a rational opponent.

MiniMax Games with two players MIN and MAX are a search problem with: Initial state Successor function Terminal test / state Utility function (objective / payoff)

MiniMax Utility function Is assumed to be in relation with Max What is good for max is always bad for min. E.g. if max wins then min lose In chess the utility function might be. -1 if min wins 0 for a draw 1 if max wins In other games, e.g. Othello the utility function might be more advanced. utility = number of my pieces – number of his pieces

MiniMax Simple Games If we play e.g. TicTacToe or NIM, we can generate a complete search tree Some leafs in the tree will end up with max winning and some with min winning For more complex games a complete search tree is impossible. But that’s a question for the near future.

MiniMax Searching with minimax We use depth first search to reach down to the leafs first When we reach a leaf, we evaluate the current state by a utility function and then returns the result to the parent node. If we are not in a leaf and have evaluated all children. If it, from this state, is max move, then return the highest utility If it is a min move return the lowest utility.

MiniMax Example of MiniMax – 1st version of NIM The rules of NIM are as follows We start with a number of sticks in a group (7) On each move, a player may pick up 1, 2, or 3 sticks The last player to make a legal move wins

MiniMax Example of MiniMax – 2nd version of NIM The rules of NIM are as follows We start with a number of sticks in a group On each move, a player must divide a group into two smaller groups Groups of one or two sticks can’t be divided The last player to make a legal move wins

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

MiniMax NIM Search tree Max moves Min moves Max moves Min moves 6 1-5 2-4 3-3 Min moves 1-1-4 1-2-3 2-2-2 Max moves 1-1-1-3 1-1-2-2 Min moves 1-1-1-1-2

Minimax – Animated Example 3 6 The computer can obtain 6 by choosing the right hand edge from the first node. Max 5 1 3 6 2 7 6 Min 5 3 1 3 7 Max 6 5

Bounded Lookahead For trees with high depth or very high branching factor, minimax cannot be applied to the entire tree. In such cases, bounded lookahead is applied: When search reaches a specified depth, the search is cut off, and the static evaluator applied. Must be applied carefully: In some positions a static evaluator will not take into account significant changes that are about to happen.

Static Evaluation Functions Since game trees are too large to be fully searched, it is important to have a function to statically evaluate a given position in the game. A static evaluator assigns a score to a position: High positive = computer is winning Zero = even game High negative = opponent is winning It is most important that a static evaluator will give a better score to a better position – the actual values are not so important.

Searching Game Trees Exhaustively searching a game tree is not usually a good idea. Even for a game as simple as tic-tac-toe there are over 350,000 nodes in the complete game tree. An additional problem is that the computer only gets to choose every other path through the tree – the opponent chooses the others.