Computers Playing Games Arif Zaman CS 101. Acknowledgements Portions of this are taken from MIT’s open-courseware

Slides:



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

Game Playing CS 63 Chapter 6
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
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 and adversarial search
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
CMSC 671 Fall 2001 Class #8 – Thursday, September 27.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
University College Cork (Ireland) Department of Civil and Environmental Engineering Course: Engineering Artificial Intelligence Dr. Radu Marinescu Lecture.
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: Game Playing Reading: Chapter next time.
Application of Artificial intelligence to Chess Playing Capstone Design Project 2004 Jason Cook Bitboards  Bitboards are 64 bit unsigned integers, with.
Adversarial Search CSE 473 University of Washington.
Artificial Intelligence for Games Game playing Patrick Olivier
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
An Introduction to Artificial Intelligence Lecture VI: Adversarial Search (Games) Ramin Halavati In which we examine problems.
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.
Computers Playing Games Arif Zaman CS 101. Acknowledgements Portions of this are taken from MIT’s open-courseware
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Games and adversarial search
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6: Adversarial Search Fall 2008 Marco Valtorta.
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search: Game Playing Reading: Chess paper.
Othello Sean Farrell June 29, Othello Two-player game played on 8x8 board All pieces have one white side and one black side Initial board setup.
double AlphaBeta(state, depth, alpha, beta) begin if depth
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Game Playing.
Othello Artificial Intelligence With Machine Learning
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
Minimax with Alpha Beta Pruning The minimax algorithm is a way of finding an optimal move in a two player game. Alpha-beta pruning is a way of finding.
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.
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
Adversarial Search Chapter 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
Computing & Information Sciences Kansas State University Lecture 8 of 42 CIS 530 / 730 Artificial Intelligence Lecture 8 of 42 William H. Hsu Department.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 9 of 42 Wednesday, 14.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Artificial Intelligence and Searching CPSC 315 – Programming Studio Spring 2013 Project 2, Lecture 1 Adapted from slides of Yoonsuck Choe.
Game Playing Revision Mini-Max search Alpha-Beta pruning General concerns on games.
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
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Othello Artificial Intelligence With Machine Learning Computer Systems TJHSST Nick Sidawy.
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
Instructor: Vincent Conitzer
Adversarial Search Chapter 5.
Artificial Intelligence
Artificial Intelligence
Instructor: Vincent Conitzer
Search.
Search.
Adversarial Search CMPT 420 / CMPG 720.
Artificial Intelligence and Searching
Presentation transcript:

Computers Playing Games Arif Zaman CS 101

Acknowledgements Portions of this are taken from MIT’s open-courseware Some items are adapted from Chapter 5 on Games by some professor who adapted it from notes by Charles R. Dyer, University of Wisconsin-Madison

Why Computers Play? Humans play for enjoyment, but computers…? Games of strategy and skill require “intelligence”. We may learn about thinking by learning how to teach computers. Hard but well defined problems, unlike other AI problems like speech, ethics etc. Competition, knowledge-representation, … To provide entertainment, competition and training to humans (that play or program).

Game Theory Von Neumann and Morgenstern analyzed two person zero-sum games, where each person takes a decision simultaneously, and then gets paid according to a payoff matrix. Economic games, can be multi-person, multi-stage. Enemy Strategy AB My Strategy X10-10 Y-240

Board Games Two Person Alternating moves Zero Sum Deterministic (not Backgammon or Ludo) Perfect Information (not Bridge, Hearts) Examples –Tic-Tac-Toe –Checkers –Chess –Go –Reversi (Othello)

History 1949 Claude Shannon paper on Chess 1951 Alan Turing simulation on Checkers 1955 Chess Program using α-β MacHack 1990 Belle (harware assist) 2000 Deep Blue (serious hardware)

Top-down Program Repeat Until Done –DrawBoard –GetPlayerMove –CheckLegalMove‘also check if game over –MakePlayerMove –DrawBoard –FindLegalMoves‘also check if game over –EvaluateLegalMoves –MakeBestMove

Static Position Evaluator Given a position, come up with a “value”. Values are 0…1 or 0…infinity or –infinity…infinity can represent “probability” of my lose/win In chess can count –my pieces – enemy pieces. –my total piece value – enemy total piece value. –Add points for Mobility –Add points for Center Control –Negative points for exposed king, etc. This is where humans experts excel.

Game Tree Mini-Max

Crude Evaluator You can start off with a crude static evaluator, and a high ply minimax. Russians believed that better would be an excellent but slow static evaluator with lower plies. The extreme strategies are of course a perfect evaluator with 1-ply Or the complete game-tree search with trivial evaluator.

Deep Blue 32 node supercomputer, each with eight special chess processors. 50 – 100 billion moves in 3 mins with a ply search

Other Tricks: α-β pruning α-β pruning: We do not need to look at every possible move, especially if we have a good candidate. Lookup Tables: for opening moves. Example of ply search

Other Tricks: Quiessence Search Quiessence: Static evaluate at peaceful situations. Go deeper into fights. Tree Folding: Memo- ization Special program: for endgames. Variable depth trees result from quiessence searches.

Other Games Go is much harder. The best computer is far worse than the best human, even though the rules are very simple Checkers computers are far better than the best humans Tic-Tac-Toe is still a great mystery. Othello has a very interesting story.

Rules of the game Start with four squares filled. Move next to opposite colored square. Change color of all opposite colored squared surrounded by moved piece and another piece of the same color. Must capture.

Reversi (Othello) D E Moriarty and R Miikkulainen, “Discovering Complex Othello Strategies Through Evolutionary Neural Networks” Created a strong player without any initial knowledge, by “breeding”! Start with a “population” of 100 “random” programs. Kill the 90 losers in a competition. Breed the 10 winners by “re- combining” their “genes” with a bit of “mutation.” Repeat for 1000’s of generations.

Positional Strategy Programs quickly learned the basic positional strategy: Take corners. Avoid neighbors of corners Take neighbors of neighbors of corners. Mobility Strategy Keep low piece count Restrict opponents moves Discovered only once in Japan, and then everyone learnt it from them.

Mobility vs Positional The mobility strategy (learned by ENN = Evolutionary Neural Network) looks like it is loosing, but converts it to a win in the last 3-4 moves!

But… Specially designed programs to play Othello still do even better eg. Bill or Logistello.

More Complexities Randomness –Dice games Ludo Monopoly Learn Probability Theory, and maximize chance of winning, or expected points. Multi-player Games –Collusion strategies Scrabble, Monopoly –Card games Use AI to recognize typical player types and weaknesses. Try to predict human response.

Write your own game! By the end of this course, you should have most of the tools to write your own game player. If you are interested, it will help to take “Data Structures”, so that you can represent trees on a computer.