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.

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.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
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.
Adversarial Search CSE 473 University of Washington.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Chess AI’s, How do they work? Math Club 10/03/2011.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Artificial Intelligence in Game Design
The Implementation of Machine Learning in the Game of Checkers Billy Melicher Computer Systems lab
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)
MAE 552 – Heuristic Optimization Lecture 28 April 5, 2002 Topic:Chess Programs Utilizing Tree Searches.
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
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.
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.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
CISC 235: Topic 6 Game Trees.
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.
Adversarial Search CS30 David Kauchak Spring 2015 Some material borrowed from : Sara Owsley Sood and others.
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.
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 Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Parallel Programming in Chess Simulations Tyler Patton.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
CMSC 421: Intro to Artificial Intelligence October 6, 2003 Lecture 7: Games Professor: Bonnie J. Dorr TA: Nate Waisbrot.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Parallel Programming in Chess Simulations Part 2 Tyler Patton.
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.
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.
Artificial Intelligence AIMA §5: Adversarial Search
Adversarial Search and Game-Playing
Iterative Deepening A*
PENGANTAR INTELIJENSIA BUATAN (64A614)
Games and adversarial search (Chapter 5)
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
David Kauchak CS52 – Spring 2016
Adversarial Search Chapter 5.
Game playing.
Alpha-Beta Search.
Alpha-Beta Search.
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Alpha-Beta Search.
Alpha-Beta Search.
Alpha-Beta Search.
Data Structures and Algorithms
CS51A David Kauchak Spring 2019
CS51A David Kauchak Spring 2019
Unit II Game Playing.
Presentation transcript:

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 before AI Safe skill level for my experience and gain some learning. Topic/subject matter doesn’t seem too abstract or complex to understand. Rules of games are relatively easy follow Optimal strategies for the games I chose were “relatively” simple Allows me to implement one of the algorithms we learned in class to an actual program

Results of Project Created unbeatable Tic-Tac-Toe but not “expert” Tic-Tac-Toe program Created a somewhat intelligent Checkers program that plays reasonably intelligent in early to mid game but considerably less intelligently towards the end of a game (few pieces remaining) No where close to unbeatable Heuristics become difficult to design for more complex games.

General Methods for AI program for 2 Player Game Transposition Tables Limited Discrepancy Search Intelligent Backtracking Quiescence Minimax Search  This is what I try to implement Minimax Search Alpha-Beta Pruning  This is what I try to implement Alpha-Beta Pruning Heuristic value  Use more deterministic Heuristic values

Basic Structure of Application Code for both Checkers and TicTacToe 1 method to generate all possible next 1 turn moves for a game state. Methods to set rules for the game board as well as the rules for AI program. 1 method for mini-max 1 method for mini-max-alpha-beta (tic-tac-toe only). 1 method to calculate final heuristic (checkers only).

AI algorithms Used Mini-Max to make an unbeatable tic-tac-toe game (but not optimal) that can see every possible combination. Used Alpha-Beta improvement to make an unbeatable tic-tac-toe game (but not optimal) in order to understand the difference in the recursive calls made to Mini-Max vs. Mini-Max-Alpha-Beta Used Mini-Max to try to make an checkers AI program that can see 8 moves into the future without lag and 10 moves into future for Alpha- Beta without lag.

Heuristics Checkers (based off strategies of Checkers players) +120 for Kings and -120 for opposing Kings +40 for Pawns and -40 for opposing Pawns +25 for Edge positions +10 for Back Row +5 for each neighbor ally piece Tic-Tac-Toe Return +10 for win Return -10 for loss Return 0 for draw

MiniMax From a certain game state, It simulates all possible “next” game states for the next X turns (X is determined by programmer for how into the future MiniMax will see), and returns the best value from these possibilities.

Alpha-Beta Modification to increase Efficiency of Minimax Adds Alpha, Beta variables at each recursion call. Alpha receives highest heuristic value, Beta receives lowest heuristic value Whenever Alpha > Beta, you return Alpha to higher level recursion call to prune decision tree

Decision Tree Scale Comparison Tic Tac Toe: Approximate moves per turn, max 9 Perfect 2 player game example for AI program Able to create an unbeatable AI program without the use of an end-game database Mini-Max is the only property necessary to solve Connect 4: Able to create an unbeatable AI program without the use of an end-game database No need for Alpha-Beta Prune. Unbeatable in 1989 (first player always wins or draws) Checkers (one million times more complex than connect 4): Chinook, 2007, unbeatable AI program. Perfect players always end in draw. parallel processing Chess: Approximate moves per turn is 20 parallel processing Requires heuristics (estimates) so you know for sure not optimal. State space is too huge to be solved by deterministic turing machine. NP problem? Go: Approximate moves per turn is 200 NP problem?

observations Not much difference between TTT vs Checkers program besides the algorithm to generate all next possible states. (Considerably more annoying for Checkers) Heuristics have more flexible for Checkers. No need for more complex heuristics for TTT You can see how much more annoying it will get for GO and Chess. Increase in number of combinations TTT vs Checkers TTT combinations decreased as game went further. Checkers combinations increased as game went further as more pieces had options to move. Program ran much slower towards the middle part of game. Tic-Tac-Toe If AI goes first, it sometimes chooses the 12 O’Clock, 3 O’Clock, 6 O’Clock, and 9 O’Clock positions. It set heuristic values for all 9 possible positions to 0. Assumes player it plays against is optimal. Loses opportunities to win easily against naïve players. Checkers (some similarities to Humans) The lower the depths, the more defensive the AI programs tended to play. Makes sense intuitively since you tend to play cautious if you can predict what is going on next. Clump units together. Game turns increased as a result. AI interestingly kept all of its units at the back as long as possible. Similar to how some expert chess players play. AI programs took more risks at greater depths. Infinite loop when AI vs AI towards end.

Improvements that COULD have been made My checkers AI program ran too slow if I allowed it to search into the future > 8 moves for min-max and >10 for alpha beta prune. Could have used a file to store states My heuristic function may have been too basic Not enough stack memory in IDE to run an algorithm that considers chain kills >2. Could have considered additional AI methods (evaluator methods, etc.) Wasted too much time due to incorrect assumptions.

Some Philosophical thoughts I thought about What is the missing link between AI and Human Int. Self-Learning algorithms Psychological behavior analysis Humans don’t know if there is an unbeatable AI for chess or GO because we don’t understand limitations of human intelligence Unbeatable checkers program (Chinook) relied on moves from Checkers Grand Masters, instead of self-learning Humans have not been able to solve P = NP problem

Continued. Experienced human players are good at ruling out an entire decision branches based on subconscious tendencies AI programs are good at precision searching very fast. (brute-force) humans are not capable of doing. AI programs have a more difficult time than Human beings at considering decision trees that have don’t have an obvious outcome (“better” or “worse” moves are fuzzy), but experienced players are able to see based on experiences. Example: GO AI players cannot consider Psychology of opponent.