Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.

Slides:



Advertisements
Similar presentations
Adversarial Search Chapter 6 Sections 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Advertisements

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.
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
AI for Connect-4 (or other 2-player games) Minds and Machines.
Games & Adversarial Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 5.
COMP-4640: Intelligent & Interactive Systems Game Playing A game can be formally defined as a search problem with: -An initial state -a set of operators.
Hoe schaakt een computer? Arnold Meijster. Why study games? Fun Historically major subject in AI Interesting subject of study because they are hard Games.
Adversarial Search Chapter 6.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
An Introduction to Artificial Intelligence Lecture VI: Adversarial Search (Games) Ramin Halavati In which we examine problems.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Artificial Intelligence in Game Design
State Space 4 Chapter 4 Adversarial Games. Two Flavors Games of Perfect Information ◦Each player knows everything that can be known ◦Chess, Othello Games.
Problem Solving Using Search Reduce a problem to one of searching a graph. View problem solving as a process of moving through a sequence of problem states.
This time: Outline Game playing The minimax algorithm
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.
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 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.
CISC 235: Topic 6 Game Trees.
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.
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
Game Playing.
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.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
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.
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
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?
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory.
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.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
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.
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.
Game Playing Why do AI researchers study game playing?
Adversarial Search.
State Space 4 Chapter 4 Adversarial Games.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search CS 171/271 (Chapter 6)
CS51A David Kauchak Spring 2019
Games & Adversarial Search
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Game Playing

Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. After 40 years, best chess player is now a computer. ( Kasparov vs. Deep Blue, 1997) After 40 years, best chess player is now a computer. ( Kasparov vs. Deep Blue, 1997) Kasparov vs. Deep Blue, 1997 Kasparov vs. Deep Blue, Is this intelligence? Is this intelligence? How can computers play games of strategy? How can computers play games of strategy?

Play against a partner LLWWLLWWWLWLWWWW player W player L player W

Demo: tpage.html Demo: tpage.html tpage.html tpage.html Many two-person games can be viewed as tree search Many two-person games can be viewed as tree search Game assumptions: Game assumptions: –no randomness –2-player –each player plays best strategy

Tic-Tac-Toe TREE nodes are board positions edges are valid moves

Some nodes are WIN, some are LOSE, some are TIE, some are indeterminate Some nodes are WIN, some are LOSE, some are TIE, some are indeterminate GOAL: get to a node that is a WIN GOAL: get to a node that is a WIN Why can’t we use search techniques we’ve seen already to find a WIN node and head towards it? Why can’t we use search techniques we’ve seen already to find a WIN node and head towards it? –opponent gets to move every other turn… may decide to move a different way! TOP level - we choose. NEXT level opponent chooses, then us, etc. TOP level - we choose. NEXT level opponent chooses, then us, etc.

Who wins? W L our choice Must be a move for us so that: we win.

Who wins? W our choice his choice What must be true for us to win? W

Who wins? WLLL our choice his choice What must be true for us to WIN? Must be a move for us so that: no matter what our opponent chooses: we win.

Who wins? WWLLWLLW our choice his choice our choice There must exist a move for us so that: no matter what our opponent chooses: there is a move for us: so that we win.

Who wins? LLWWLLWWWLWLWWWW our choice his choice our choice

Labeling the tree LLWWLLWWWLWLWWWW our choice his choice our choice

Labeling the tree LLWWLLWWWLWLWWWW our choice his choice our choice W L WW W L L L L W W W L W W Label the nodes as W/L depending on whether we win or lose if we get to that node

Issue PROBLEM PROBLEM –In practice, don’t have entire tree - it is likely way way big. –quick calculation: size of chess tree? SOLUTION 1 SOLUTION 1 –look ahead fixed distance (construct tree only to certain depth) –label nodes based on heuristic / guess of whether “win” or “lose”

Solution 2 Extension of solution 1 Extension of solution 1 –look ahead fixed distance (construct tree only to certain depth) –label nodes with NUMBERS which measure how good the position is. Numbers come from an evaluation function EXAMPLE: Chess eval function: 9q + 5r + 3n + 3b + p Many complex evaluation functions are used example: Othello Game Eval Function... example: Othello Game Eval Function...

20.0*([0,0]+[0,7]+[7,0]+[7,7])+-7.0*([1,1]+[1,6]+[6,1]+[6,6])+2.0*([2,2]+[2,5]+[5,2]+[5,5])+-3.0*([3,3]+[3,4]+[4,3]+[4,4])+-3.0*([1,0]+[0,1]+[6,0]+[0,6]+[7,1]+[1,7]+[7,6]+[6,7])+ 11.0*([2,0]+[0,2]+[5,0]+[0,5]+[7,2]+[2,7]+[7,5]+[5,7]) + 8.0*([3,0]+[0,3]+[4,0]+[0,4]+[7,3]+[3,7]+[7,4]+[4,7])+-4.0*([2,1]+[1,2]+[5,1]+[1,5]+[6,2]+[2,6]+[6,5]+[5,6])+1.0*([3,1]+[1,3]+[4,1]+[1,4]+[6,3]+[3,6]+[6,4]+[4,6])+2.0*([3,2]+[2,3]+[4,2]+[2,4]+[5,3]+[3,5]+[5,4]+[4,5])

New goal: get to the highest valued node (opponent tries to get to the lowest valued node) our choice his choice our choice What is best we can do? Why?

Play against a partner player Max player Min player Max

MIN-MAX labeling Start at bottom (dep on lookahead) Start at bottom (dep on lookahead) Compute evaluation function for the leaf nodes Compute evaluation function for the leaf nodes Work upwards. Label a node with largest of children if it is our choice, or smallest of children if opponent choice Work upwards. Label a node with largest of children if it is our choice, or smallest of children if opponent choice our choice his choice our choice

MIN-MAX labeling Start at bottom (dep on lookahead) Start at bottom (dep on lookahead) Compute evaluation function for the leaf nodes Compute evaluation function for the leaf nodes Work upwards. Label a node with largest of children if it is our choice, or smallest of children if opponent choice Work upwards. Label a node with largest of children if it is our choice, or smallest of children if opponent choice our choice his choice our choice

alpha/beta pruning 5371 our choice his choice our choice ? Why doesn’t this matter?

General game-playing programs: have large databases of beginning, ending move combinations have large databases of beginning, ending move combinations look-ahead more in the direction of most promising board positions look-ahead more in the direction of most promising board positions use advanced techniques for pruning parts of the tree that are not likely to lead to good positions use advanced techniques for pruning parts of the tree that are not likely to lead to good positions

Summary Many two-person games of skill can be modeled as a tree, with vertices representing board positions, and edges representing moves. Many two-person games of skill can be modeled as a tree, with vertices representing board positions, and edges representing moves. An evaluation function is used to label how good a particular board position is. An evaluation function is used to label how good a particular board position is. A game-playing program combines special knowledge of beginning and end games, with look-ahead based on evaluation function, and careful pruning, to determine what the likely best next move is A game-playing program combines special knowledge of beginning and end games, with look-ahead based on evaluation function, and careful pruning, to determine what the likely best next move is Some games will remain too complex for computers to play as well as humans until new methods are proved effective. Some games will remain too complex for computers to play as well as humans until new methods are proved effective.