Modelling and Generating Strategy Games Mechanics
Total Page:16
File Type:pdf, Size:1020Kb
Modelling and Generating Strategy Games Mechanics Tobias Mahlmann Center For Computer Games Research IT University of Copenhagen A thesis submitted for the degree of Doctor of Philosophy March 2013 Abstract Strategy games are a popular genre of games with a long history, originating from games like Chess or Go. The word \strategy" is derived from the Greek word strathgìc (strateg´os),meaning (the) general, resp. strathgeÐa, meaning \art of commanding". Both terms directly hint at the subject of strategy games: warfare. Players must utilise armies and resources to their advantage on a battlefield to win a \virtual war". The first strategy games were published as \Kriegspiele" (engl. wargames) in the late 18th century, intended for the education of young cadets. Since then strategy games were refined and transformed over two centuries into a medium of entertainment. Today's computer strategy games have their roots in the board- and roleplaying games of the 20th century and enjoy great popularity. In this thesis, we use strategy games as an application for the procedural generation of game content. Procedural game content generation has regained some interest in recent years, both among the academic community and game developers alike. When the first commercial computer games were published in the early 1980s, technical limitations prevented game developers from shipping their titles with a large amount of pre-designed game content. Instead game content such as levels, worlds, stories, weapons, or enemies needed to be generated at program runtime to save storage space and memory resources. It can be argued that the generation of game content \on the fly” has gained popularity again for two reasons: first, game production budgets have risen rapidly in the past ten years due to the necessary labour to create the amount of game content players expect in games today. Secondly: the potential audience for games grew in the past years, with a diversification of player types at the same time. Thus game developers look for a way to tailor their games to individual players' preferences by creating game content adaptively to how the player plays (and likes) a game. In this thesis we extend the notion of \procedural game content generation" by \game mechanics". Game mechanics herein refer to the way that objects in a game may interact, what the goal of the game is, how players may ma- nipulate the game world, etc. We present the Strategy Games Description Language (SGDL) and its adjacent framework, a tree-based approach to model the game mechanics of strategy games. The SGDL framework allows game designers to rapid prototype their game ideas with the help of our customisable game engine. We present several example games to demon- strate the capabilities of the language and how to model common strategy game elements. Furthermore, we present methods to procedurally generate and evaluate game mechanics modelled in SGDL in terms of enjoyability. We argue that an evolutionary process can be used to evolve the mechanics of strategy games using techniques from the field of machine learning. Our results show that automated gameplay combined with expert knowledge can be used to determine the quality of gameplay emerging from game me- chanics modelled in SGDL, and that algorithms can augment the creativity of human game designers. iv Acknowledgements I would like to acknowledge all the individuals who provided me with in- sight and inspiration, in the form of discussions or collaborations, and con- tributed to my work and this thesis. Especially mentioned here should be my supervisors Julian Togelius and Georgios N. Yannakakis and all the col- leagues whom I met at the Center for Computer Games Research at the ITU Copenhagen. ii Contents List of Figures ix List of Tables xi Overview i 1 Introduction 1 1.1 Computational Intelligence in Games . .4 1.2 Published papers . .7 2 Strategy Games 9 2.1 The History of Strategy Games . 13 2.2 Strategy Games: The Delimitation of the Genre . 17 3 Related Theoretical Frameworks 23 3.1 Modelling Player Experience: Qualitative Methods . 23 3.1.1 Self-reported data . 25 3.1.2 Requirements elicitation . 26 3.1.3 Personality . 29 3.1.4 Flow . 29 3.1.5 Emotional State . 31 3.1.6 Immersion . 33 3.2 Modelling Player Experience: Quantitative Methods . 34 3.2.1 Interest . 34 3.2.2 Physiological measures . 36 3.2.3 Tension in Board Games . 37 3.2.4 Measures from Combinatorial Games . 38 iii CONTENTS 3.2.5 Learnability . 42 3.3 Defining Game Mechanics . 44 3.3.1 Different Layers of Rules . 45 3.3.2 Games as Systems . 46 3.4 Summary . 47 4 Related computational intelligence in games research 49 4.1 Generating Content . 49 4.1.1 Search-based procedural content creation . 49 4.1.2 Procedural Level Generation . 51 4.1.3 Interactive Storytelling . 51 4.1.4 Cellular automata . 52 4.1.5 L-Systems . 53 4.2 Computational Creativity . 54 4.3 AI and Learning in Games . 56 4.3.1 Game Tree Search . 56 4.3.1.1 Min-Max Search . 58 4.3.1.2 Monte-Carlo Tree Search . 59 4.3.2 State machines . 62 4.3.3 Decision- and Behaviour Trees . 63 4.3.4 Neural Networks . 63 4.3.5 Genetic Algorithms . 64 4.3.6 Genetic Programming . 65 4.4 Modelling and Generating Game Mechanics . 66 4.4.1 Unified Modelling Language (UML) . 66 4.4.2 Stanford GDL . 67 4.4.3 Answer Set Programming . 68 4.4.4 Ludi . 69 4.4.5 ANGELINA . 70 4.4.6 Fixed length genome . 71 4.5 Summary . 71 iv CONTENTS 5 The Strategy Games Description Language (SGDL) 73 5.1 Design Paradigms . 73 5.2 Basic Concepts and Terms . 75 5.3 The SGDL Tree . 77 5.3.1 Attributes and Object References . 78 5.3.2 Conditions . 78 5.3.3 Consequences . 82 5.3.4 Actions . 82 5.3.5 Multiple Consequences . 83 5.3.6 Action as Consequences . 85 5.3.7 Object Lists and Object Filter . 85 5.3.8 Winning Conditions . 87 5.4 Surrounding framework . 87 5.4.1 Maps . 88 5.4.2 Game- and Player State . 90 5.5 Comparison to other Game Description Languages . 91 5.6 Summary . 93 6 SGDL in Practice 95 6.1 Example Games . 95 6.1.1 Simple Rock Paper Scissors . 95 6.1.2 Complex Rock Paper Scissor . 96 6.1.3 Rock Wars . 98 6.1.4 Dune 2 . 102 6.2 Interlude: \Spicing up map generation" . 102 6.3 Summary . 106 7 Automated Gameplay 109 7.1 The game, the agents and the assigner . 110 7.2 Agents . 113 7.2.1 Random action selection . 114 7.2.2 Finite-state machine . 115 7.2.3 Neuroevolution of augmenting topologies . 116 7.2.4 MinMax . 117 v CONTENTS 7.2.5 Monte Carlo Tree Search . 119 7.2.6 Potential fields . 120 7.2.7 Classifier systems . 121 7.3 Results of agent versus agent training . 122 7.4 Results of human play testing . 127 7.5 Conclusions . 131 8 Measuring Game Quality 133 8.1 A Definition of Balance . 135 8.1.1 Complementary Unit Types . 137 8.1.2 Fitness function . 140 8.2 The Outcome Uncertainty of a Game . 142 8.3 Avoiding a Start-Finish victory . 144 8.4 Fitness functions for Action subtrees . 146 9 Searching the Strategy Game Space 151 9.1 Balance and Complementary Unit Sets . 152 9.2 Comparing balance to outcome uncertainty . 155 9.2.1 Evolving actions . 158 9.2.2 The solution representation . 159 9.2.3 The Evolutionary Algorithm . 160 10 Overall Results 163 10.1 Further experiments . 168 10.2 Game in focus: a qualitative analysis . 171 10.3 Summary . 173 11 Beyond tactics: Conclusions and Discussion 175 11.1 Modelled Games . 175 11.2 New Game Mechanics . 176 11.3 The Strategy Games Description Language . 177 11.3.1 Verbosity vs. Versatility . 178 11.4 The SGDL Framework ..