Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers."— Presentation transcript:

1 Game Playing

2 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, 1997 http://en.wikipedia.org/wiki/Computer_chess http://en.wikipedia.org/wiki/Computer_chesshttp://en.wikipedia.org/wiki/Computer_chess Is this intelligence? Is this intelligence? How can computers play games of strategy? How can computers play games of strategy?

3 Play against a partner LLWWLLWWWLWLWWWW player W player L player W

4 Demo: http://www.siivoset.com/gradu/impothello/apple tpage.html Demo: http://www.siivoset.com/gradu/impothello/apple tpage.html http://www.siivoset.com/gradu/impothello/apple tpage.html http://www.siivoset.com/gradu/impothello/apple 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

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

6 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.

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

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

9 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.

10 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.

11 Who wins? LLWWLLWWWLWLWWWW our choice his choice our choice

12 Labeling the tree LLWWLLWWWLWLWWWW our choice his choice our choice

13 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

14 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”

15 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...

16 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])

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

18 Play against a partner 1487643924537268 player Max player Min player Max

19 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 07136045 our choice his choice our choice

20 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 07136045 7365 3 5 5 our choice his choice our choice

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

22 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

23

24 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.


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

Similar presentations


Ads by Google