DOC PREVIEW
UCF COT 4810 - Game Trees

This preview shows page 1-2-3-25-26-27 out of 27 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 27 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Game TreesTrees – A ReviewPowerPoint PresentationCommon Traversal AlgorithmComputer GamesSlide 6Slide 7Slide 8Slide 9Slide 10Minimax - ComputerMinimax - HumanDemonstrationConclusionsWhat can we do?Alpha-Beta PruningSlide 17Slide 18Slide 19Slide 20Transposition TablesSlide 22Slide 23Slide 24Slide 25Slide 26ReferencesGame TreesRyan WilsonChapter 6Trees – A ReviewTrees are a collection of nodesA Tree has a root node and zero or more sub-treesEBAGC D F H IRoot NodeAn Example TreeCommonTraversalAlgorithmFunction TraverseTree( node )visit( node )for each child of nodeTraverseTree( child )end forEnd FunctionTraverseTree( root )Computer GamesProblem: How do we make an intelligent opponent for a human player to compete against?One Possibility:Game TreesGame TreesTreat each state of the game as a node in a treeSearch the tree to find the best moveXX XX XXOO OO OXXGame Trees3 Components to Implementing a Game Tree:Tree GeneratorPosition EvaluatorMinimax MethodXXX XXOOO OX X…XXOOOXO O OXXOOXXOX01-11 = Computer Wins0 = Draw-1 = Human Wins…PositionEvaluator4060 203040 2040MAXComputer’s TurnMINHuman’s TurnREMEMBER!Higher Scoreis better forthe computer!Minimax - ComputerFunction FindComputerMove(GameStateNode) var bestValueif( terminal )return evaluate(GameStateNode)for each child of GameStateNodevalue = FindHumanMove(child)if( value > bestValue )bestValue = valueend forEnd functionMinimax - HumanFunction FindHumanMove(GameStateNode) var bestValueif( terminal )return evaluate(GameStateNode)for each child of GameStateNodevalue = FindHumanMove(child)if( value < bestValue )bestValue = valueend forEnd functionDemonstrationTic-Tac-Toe!ConclusionsIn Tic-Tac-Toe, there’s only about 27 legal moves for the computer to considerThat’s about 30,000 movesBut it’s still kind of slow…Almost 45 seconds to make the first move!Experts estimate 10100 legal moves in Chess!That’s approx. 2333 legal positions!What can we do?Apply the position evaluator to non-terminal nodesLimit the depth of your search through the treeHave to estimate the value of a positionAlpha-Beta Pruning“Trim” un-needed portions of the treeTransposition TablesAlpha-Beta Pruning Don’t need to look at all subtrees of a given node if you can already know which one is best4060 203040 <20>40MAXComputer’s TurnMINHuman’s TurnREMEMBER!Higher Scoreis better forthe computer!Alpha-Pruning100 40 120 30100 >120<100MAXComputer’s TurnMINHuman’s TurnREMEMBER!Higher Scoreis better forthe computer!Beta-PruningDemonstrationTic-Tac-Toe!With Alpha-Beta PruningConclusionsA definite improvement!First move only takes about 4 seconds (about 2000 moves)Transposition TablesIn many games, there are multiple ways to arrive at the same board position…X XOXO XX XOXO XTransposition TablesOnce we’ve calculated the value of a given position, we save it in a table so it’s easy to look up.For each position in the tree, look that position up in the table, if it exists, return the value stored in the table.DemonstrationTic-Tac-Toe!With Alpha-Beta PruningWith Transposition TablesConclusionsAnother improvement!First move only takes about 3 seconds (918 nodes)Almost ½ as many nodes!Game TreesHow-To of Game TreesAlpha-Beta PruningTransposition TablesReferencesDewdneyThe New Turing OmnibusWeissAlgorithms, Data Structures, and Problem Solving with C++WeissData Structures & Algorithm Analysis in


View Full Document

UCF COT 4810 - Game Trees

Documents in this Course
Spoofing

Spoofing

25 pages

CAPTCHA

CAPTCHA

18 pages

Load more
Download Game Trees
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Game Trees and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Game Trees 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?