Minimax AI Within Non-Deterministic Environments
Total Page:16
File Type:pdf, Size:1020Kb
Minimax AI within Non-Deterministic Environments by Joe Dan Davenport, B.S. A Thesis In Computer Science Submitted to the Graduate Faculty Of Texas Tech University in Partial Fulfillment of The Requirements for The Degree of MASTER OF SCIENCE Approved Dr. Nelson J. Rushton Committee Chair Dr. Richard Watson Dr. Yuanlin Zhang Mark Sheridan, Ph.D. Dean of the Graduate School August, 2016 Copyright 2016, Joe Dan Davenport Texas Tech University, Joe Dan Davenport, August 2016 Acknowledgements There are a number of people who I owe my sincerest thanks for arriving at this point in my academic career: First and foremost I wish to thank God, without whom many doors that were opened to me would have remained closed. Dr. Nelson Rushton for his guidance both as a scientist and as a person, but even more so for believing in me enough to allow me to pursue my Master’s Degree when my grades didn’t represent that I should. I would also like to thank Dr. Richard Watson who originally enabled me to come to Texas Tech University and guided my path. I would also like to thank Joshua Archer, and Bryant Nelson, not only for their companionship, but also for their patience and willingness to listen to my random thoughts; as well as my manger, Eric Hybner, for bearing with me through this. Finally I would like to thank some very important people in my life. To my Mother, I thank you for telling me I could be whatever I wanted to be, and meaning it. To Israel Perez for always being there for all of us. To my children for teaching me to parent. To my Gran, Doug, Robbi, Dakon, Trey, and Alex, thank you for always being ready to help. I could thank every member of my family for something so I will say a simple thank you to each of you. Last I want to thank my wife Jessica, I thank her last because after God she is first in my life and I would not be here without her love and support standing beside me. ii Texas Tech University, Joe Dan Davenport, August 2016 Table of Contents Acknowledgements ............................................................................................................. ii Table of Contents ............................................................................................................... iii Abstract .............................................................................................................................. iv List of Figures ..................................................................................................................... v I. Introduction ..................................................................................................................... 1 Motivation ........................................................................................................................1 Problem Statement ...........................................................................................................2 Overview ..........................................................................................................................3 Terms ...............................................................................................................................4 II. Background .................................................................................................................... 5 State of the Art .................................................................................................................5 Minimax ...........................................................................................................................8 Background of Minimax ..............................................................................................8 Putting Minimax to Use .............................................................................................10 Minimax applied in domains of higher complexity ...................................................12 Improving performance..............................................................................................14 Non-deterministic domains ........................................................................................16 Expectiminax .................................................................................................................16 III. System Description ..................................................................................................... 18 Types ..............................................................................................................................18 Description .....................................................................................................................21 IV. Implementation Process .............................................................................................. 23 Prototype 1 – Standard Minimax ...................................................................................23 Prototype 2 – Expected Minimax with Static Expected Value ......................................29 Results ............................................................................................................................36 V. Conclusion & Future Work .......................................................................................... 39 Conclusions ....................................................................................................................39 Future Work ...................................................................................................................40 Future work – EMPV .................................................................................................40 Future work – Search Optimization ...........................................................................40 Future Work – Stress Testing & Experimentation .....................................................40 References ......................................................................................................................... 42 iii Texas Tech University, Joe Dan Davenport, August 2016 Abstract True artificial intelligence implementations in modern video games are a rarely seen occurrence. Most reliable sources say that the reason for this has to do with the unreliability in non-deterministic domains and poor performance. In this research, we used a well-known decision algorithm, minimax, in an attempt to focus on both of these issues while still providing emergent intelligence to the system. Minimax has existed since 1928, and has been proven sound in games of perfect information such as chess, or checkers. We refer to these games as deterministic domains in which every action has a known resulting outcome. We will look to extend minimax to non-deterministic domains through the use of expectiminimax. The result of this research was that the minimax and variant expectiminimax algorithm were both applicable in a commercial game domain, providing both acceptable performance and emergent intelligence in both deterministic and non-deterministic environments. iv Texas Tech University, Joe Dan Davenport, August 2016 List of Figures 1. Standard Minimax Prototype UI ................................................................................... 23 2. SMP Deep Copy Constructor........................................................................................ 25 3. SMP AI Class ................................................................................................................ 27 4. SMP vs EMP Successor Function................................................................................. 30 5. EMP Avoidance Function ............................................................................................. 31 6. EMP Mitigation Function ............................................................................................. 33 7. EMP expectedDamage Function ................................................................................... 34 8. SMP vs EMP Time to Depth Comparison .................................................................... 37 v Texas Tech University, Joe Dan Davenport, August 2016 Chapter I Introduction Motivation While the video game industry has boomed and bloomed over the past decade to an extremely respectable $61 billion dollars in sales in 2015 (DiChristopher 2016), the artificial intelligence, henceforth known as AI, techniques being used are far from the forefront of cutting edge. In a 2015 gamasutra.com article, one AI developer stated that his current use of AI implementations are based mostly around “AI techniques that were well-known in the 1970’s” (Graft 2015). The problem for most AI developers is that game AI needs to fit a commercially proven set of experience expectations. In situations where we employ tactics to produce emergent intelligence, like machine learning and decision algorithms, this proves especially difficult. Assume a game designer wants to see a certain type of AI behavior repeated more often. The developer can’t simply step back to the code, change a few settings and ask if that is satisfactory. They must now go back to their data set, and attempt to retrain the agent to see if they can produce this type of requested behavior. Therefore, if we wish to introduce more modern AI techniques into modern video games, the proposed techniques must produce accurate and repeatable results that can be designed around. This is highly important to me as I feel games are as much a teaching and learning tool as they are a source of entertainment. Being able to produce more accurate