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.

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

Adversarial Search Chapter 6 Sections 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
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.
1 Game Playing. 2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
Adversarial Search Chapter 6.
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
This time: Outline Game playing The minimax algorithm
Lecture 02 – Part C Game Playing: Adversarial Search
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
CS 561, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
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.
Game-Playing Read Chapter 6 Adversarial Search. Game Types Two-person games vs multi-person –chess vs monopoly Perfect Information vs Imperfect –checkers.
1 DCP 1172 Introduction to Artificial Intelligence Lecture notes for Chap. 6 [AIMA] Chang-Sheng Chen.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Adversarial Search: Game Playing Reading: Chess paper.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game-Playing Read Chapter 6 Adversarial Search. State-Space Model Modified States the same Operators depend on whose turn Goal: As before: win or win.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
CSC 412: AI Adversarial Search
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Adversarial Search CS30 David Kauchak Spring 2015 Some material borrowed from : Sara Owsley Sood and others.
Game Playing.
Adversarial Search CS311 David Kauchak Spring 2013 Some material borrowed from : Sara Owsley Sood and others.
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.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 9 of 14 Friday, 10 September.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
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.
Adversarial Search Chapter 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
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.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Paula Matuszek, CSC 8520, Fall Based in part on aima.eecs.berkeley.edu/slides-ppt 1 CS 8520: Artificial Intelligence Adversarial Search Paula Matuszek.
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 1 (Game Playing)
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.
Adversarial Search CMPT 463. When: Tuesday, April 5 3:30PM Where: RLC 105 Team based: one, two or three people per team Languages: Python, C++ and Java.
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.
Artificial Intelligence AIMA §5: Adversarial Search
Adversarial Search and Game-Playing
Last time: search strategies
PENGANTAR INTELIJENSIA BUATAN (64A614)
Adversarial Search.
Game Playing.
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
CS51A David Kauchak Spring 2019
Games & Adversarial Search
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 to 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

Types of Games Information: Can Know (Observe) –… outcomes of actions / moves? –… moves committed by opponent? Uncertainty –Deterministic vs. nondeterministic outcomes –Thought exercise: sources of nondeterminism?

MiniMax Games with two players MIN and MAX are a search problem with: –Initial state –Successor function –Terminal test / state –Utility function (objective / payoff) Win / loss / draw(chess) +1 / -1 / 0(chess) -192 … +192 (backgammon)

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

MiniMax (partial tic-tac-toe space)

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 has 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 function MiniMax(State s, Event e, boolean isMax) { State s1 = updateState(s, e); if (isLeaf(s1)) return eval(s1); if (isMax) { int highest = 0; foreach (Event e1 in maxmoves(s1)) { int tmp = MiniMax(s1, e1, !isMax); if (tmp > highest) highest = tmp; } return highest; } else { int lowest = 100; foreach (Event e1 in minmoves(s1)) { int tmp = MiniMax(s1, e1, !isMax); if (tmp < lowest) lowest = tmp; } return lowest; }

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 On each move, a player may pick up 1, 2, or 3 sticks The last player to make a legal move wins

What does the search tree look like?

MiniMax Example of MiniMax – 2 nd 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

MiniMax NIM Search tree Max moves Min moves Max moves Min moves

Properties of Minimax Complete?

Properties of Minimax Complete? –… yes, provided following are finite: Number of possible legal moves (generative breadth of tree) “Length of game” (depth of tree) – more specifically? A finite strategy can exist even in an infinite tree! –Perfect vs. imperfect information? Q: What search is perfect minimax analogous to? A: Bottom-up breadth-first

Properties of Minimax Complete? –… yes, provided the tree is finite: Number of possible legal moves (generative breadth of tree) “Length of game” (depth of tree) – more specifically? Optimal?

Properties of Minimax Complete? –… yes, provided the tree is finite Optimal? –… yes, provided perfect info (evaluation function) and opponent is optimal! –… otherwise, guaranteed if evaluation function is correct Time Complexity?