AI – Week 8 AI + 2 Player Games Lee McCluskey, room 3/10

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

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)
For Friday Finish chapter 5 Program 1, Milestone 1 due.
AI for Connect-4 (or other 2-player games) Minds and Machines.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
1 CSC 550: Introduction to Artificial Intelligence Fall 2008 search in game playing  zero-sum games  game trees, minimax principle  alpha-beta pruning.
CS 484 – Artificial Intelligence
Adversarial Search CSE 473 University of Washington.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
Alford Academy Business Education and Computing1 Advanced Higher Computing Based on Heriot-Watt University Scholar Materials Problem abstraction and symbolic.
AI – Week 11 AI and Games (3) Lee McCluskey, room 2/09
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Artificial Intelligence in Game Design
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.
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Adversarial Search: Game Playing Reading: Chess paper.
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,
AI – Week 10 AI and Games (2) Lee McCluskey, room 3/10
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.
Hex Combinatorial Search in Game Strategy by Brandon Risberg May 2006Menlo School.
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.
Game Playing.
Games CPS 170 Ron Parr. Why Study Games? Many human activities can be modeled as games –Negotiations –Bidding –TCP/IP –Military confrontations –Pursuit/Evasion.
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.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
For Wednesday Read Weiss, chapter 12, section 2 Homework: –Weiss, chapter 10, exercise 36 Program 5 due.
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.
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.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
For Friday Finish chapter 6 Program 1, Milestone 1 due.
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.
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.
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
Artificial Intelligence
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search. Game playing u Multi-agent competitive environment u The most common games are deterministic, turn- taking, two-player, zero-sum game.
Adversarial Search 2 (Game Playing)
G51IAI Introduction to AI Andrew Parkes Game Playing 2: Alpha-Beta Search and General Issues.
Search: Games & Adversarial Search Artificial Intelligence CMSC January 28, 2003.
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.
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Games with Chance Other Search Algorithms
Announcements Homework 3 due today (grace period through Friday)
Alpha-Beta Search.
Alpha-Beta Search.
Alpha-Beta Search.
CSE (c) S. Tanimoto, 2001 Search-Introduction
Minimax strategies, alpha beta pruning
Alpha-Beta Search.
Mini-Max search Alpha-Beta pruning General concerns on games
Search.
Search.
Alpha-Beta Search.
Games & Adversarial Search
Minimax strategies, alpha beta pruning
Unit II Game Playing.
Presentation transcript:

AI – Week 8 AI + 2 Player Games Lee McCluskey, room 3/10

Artform Research Group RECAP – SYMBOLIC AI n Representing “knowledge” (rather than just “data”) Usually done using “logic” or some other “declarative” language eg using PDDL to represent knowledge about actions n Reasoning – like planning, learning, problem solving, inference Usually done using SEARCH eg nodes contain states of the world, arcs represent action execution. Heuristics can make search feasible. -

Artform Research Group Games and Leisure applications AI point of view: Feasible application of AI because we can abstract from the “real world” Computer games and virtual worlds point of view: they tend to be more appealing if n they are realistic: their virtual world appears to embody the physical laws of the natural world, eg gravity, lighting. u achieved by good graphics n they are believable: human characters’ behaviour resemble human behaviour, NPC’s are rational u achieved by good AI Eg South Park, Wallace and Grommet, Donald Duck are “believable” animations but not very realistic! People recognise and empathise with characters through the narrative … rather than through their physical characteristics AI techniques can be embedded in opponents, other characters, or the environment to make the game more believable.

Artform Research Group Reactive “intelligence” Most current games with virtual environments use programmed behaviour via reactive condition- action rules to mimic intelligence BELIEF/ WORLD STATE SET OF CONDITION- ACTION RULES EXTERNAL ENVIRONMENT (eg real world) sensorseffectors

Artform Research Group Reactive “intelligence” n Behaviour of NPCs: Use an FSM n State of NPCs: Use a set of attribute-value pairs n Transitions can be random to give the appearance of unexpected behaviour wander retreat attack Search for food Detect enemy Low energy Detect enemy

Artform Research Group AI – predictive, deliberative, goal directed n We could us automated planning to help characters appear believable in virtual environments. They could be given goals, and it would be up to them to plan to meet them. However, if the game is adversarial and tightly coupled, planning on its own would be useless! n In adversarial, tightly coupled, turn-based games (chess, draughts, connect-4, card games, strategy games..) AI techniques have been well- developed to enable computer move generation.

Artform Research Group AI in Turn-Based, 2-player Games Assume: n Take one turn each n World state is knowable / calculable n Players will always try the ‘best’ move n A world state can be evaluated to decide if it is better than another World state = game state (eg board situation) Action = move a piece Goal = win game, or maximise gains AI move generating program = search tree of possible future board situations to find goal TAKING OPPONENT INTO ACCOUNT

Artform Research Group Search in 2-player games: Game Tree A 2 player “game tree” is a tree where n nodes are “boards” (game situations) n uni-directional arcs are “moves” connecting one board to another, and alternative arc layers of the tree represent alternative player’s moves n the route node is the initial board n Each node can be given a value with respect to one of the players, depending how good the board situation is for that player n depth of the tree is sometimes called its “ply”.

Artform Research Group Search in 2-player games: Minimax Minimax 1. Using breadth first search create a “game tree” to a certain depth n (n-ply) 2. Start at the leaves and evaluate each board. 3. Find the min or max of each board set depending on who is making the move, and attach this value to the node directly about the leaves. 4. Continue till the root is reached 5. Make the move which maximises the values of the nodes connecting the root

Artform Research Group Minimax with alpha/beta pruning Minimax + alpha/beta pruning is a good heuristic as it SAVES RESOURCE but always gives the SAME, optimal answer as mini-max Minimax with alpha/beta Change STEP 3: n When evaluating nodes at a layer, check the current value at the layer above. IF continuing to evaluate nodes in the layer is useless, then stop. This happens if n AT A MAX layer: we find a node with higher value than current MIN in the layer above n AT A MIN layer: we find a node with a lower value than the current MAX found in the layer above

Artform Research Group Other Heuristics n The minimax has problems if the search is stopped when “there is a lot going on”. If the evaluation function only evaluates piece values, then the minimax can suffer from the Horizon effect: a board is evaluated to be good when in fact the next move proves disasterous. Heuristic: grow the tree when boards are in a state of “flux”. Do not grow boards that are “quiet”. n Minimax with alpha-beta pruning is still very resource hungry for games like chess. Heuristic: at each ply, evaluate the boards FIRST, sort them into order, and search only the ones that are the highest/lowest value (depending on whether it is a max or min ply)

Artform Research Group Other types of Games n N-Player: There are N-player versions of minimax, but these have to have assumptions about the other player built in (eg that the other players do not ‘gang-up’ on one). These can be used in Poker etc n Imperfect Information: Some Games (esp card games) players have imperfect world knowledge. In these cases the player/computer can use n-person minimax but has the added complication of using probabilities / constraints to evaluate opposing player’s ‘hands’ n Games that Learn – using AI Games techniques the “deliberation” aspect can be used to support learning by experience.

Artform Research Group Summary n AI search techniques have been used in Two Player Games very successfully for years. n The most common techniques are based on games tress, mini-max, and alpha-beta pruning