Patterns and Procedural Content Generation in Digital Games
Total Page:16
File Type:pdf, Size:1020Kb
STEVE DAHLSKOG STEVE DISSERTATION DOCTORAL 2, NO SCIENCE COMPUTER IN STUDIES STEVE DAHLSKOG PATTERNS AND PROCEDURAL CONTENT GENERATION IN DIGITAL GAMES PATTERNS AND PROCEDURAL CONTENT GENERATION IN DIGITAL GAMES DIGITAL IN GENERATION CONTENT PROCEDURAL AND PATTERNS Automatic Level Generation for Digital Games Using Game Design Patterns MALMÖ UNIVERSITY2016 MALMÖ PATTERNS AND PROCEDURAL CONTENT GENERATION IN DIGITAL GAMES Studies in Computer Science No 2 © Steve Dahlskog, 2016 ISBN 978-91-7104-684-0 (print) ISBN 978-91-7104-685-7 (pdf) Holmbergs, Malmö 2016 STEVE DAHLSKOG PATTERNS AND PROCEDURAL CONTENT GENERATION IN DIGITAL GAMES Automatic Level Generation for Digital Games Using Game Design Patterns Department of Computer Science Faculty of Technology and Society Malmö University, 2016 The publication is also electronically available at: http://dspace.mah.se/handle/2043/20371 Dedicated to my family and to the loving memory of Elfride Åkesson, Stig Åkesson, Majken Nilsson and Karl-Erik Nilsson. ABSTRACT The development of content in digital games, such as game worlds, quests, levels, 3D-models, and textures, is costly and time consuming. To address this, different approaches to automate the process of creating game con- tent, often referred to as procedural content generation (PCG), has been suggested. However, PCG is a complex task and include challenges such as creating content with variation, coherent style, speed, and correctness. The research in the thesis is concerned with generating game content with the aid of game design patterns, both by establishing models and exploring different methods to generate actual game content for different games. The methods include implementations of evolutionary computation, i.e. a set of search-based approaches that searches for instances of game design pat- terns on different abstraction levels that make up Super Mario Bros. (SMB) levels and a learning algorithm implementation based on a model (n-grams) of patterns from the original SMB-game. The different generators were eval- uated with metrics concerned with the expressive range of the generators and with user tests. ix PUBLICATIONS This thesis is based on the following papers. • Patterns and Procedural Content Generation – Revisiting Mario in World 1 Level 1 [48] • Patterns as Objectives for Level Generation [49] • Procedural Content Generation Using Patterns as Objectives [51] • A Multi-level Level Generator [50] • A Comparative Evaluation of Procedural Level Generators in The Ma- rio AI Framework [101] • Linear levels through n-grams [52] • Patterns, Dungeons and Generators [53] • Player Experience Evaluation of Level Generators in the Mario AI Framework (submitted) The following paper is related to the research but not included in the thesis • The Conceptual Relationship Model: Understanding Patterns and Me- chanics in Game Design [163] xi The only legitimate use of a computer is to play games. — Eugene Jarvis, creator of Defender and Robotron: 2084 ACKNOWLEDGEMENTS I would like to thank my supervisors Paul Davidsson and Julian Togelius for their valuable help and support on this journey. I’m grateful for how you have approached my troubles and questions, often with a more posi- tive outlook than I myself have had. I’m also grateful for the work my co-authors have put into the different re- search projects and papers; I have learnt a lot from you. Thank you Gillian, Britton, Noor, Mark and Staffan. I would also like to mention some of my colleagues that, on a almost weekly basis, have supported this work. Thank you Olle, Carl Magnus and Jeanette. Thanks also to my colleagues at Malmö University, both past and present. I would also like to thank my children Max, Sam and Esme for letting me fiddle with this project and for bringing me joy and laughter. I love you. xii CONTENTS i comprehensive summary1 1 introduction3 2 background7 2.1 Digital games and their industry . 7 2.2 Procedural Content Generation . 12 2.2.1 Game Content . 13 2.2.2 PCG Research . 19 2.3 Application Domains . 24 2.4 Related Research Fields . 25 2.5 Concepts . 25 2.5.1 Evolutionary Computation . 25 2.5.2 n-grams . 30 2.5.3 Design Patterns . 32 2.5.4 Game Design Patterns . 34 3 research focus 39 3.1 Research Questions . 39 3.2 Research Limitations . 41 4 methodology 43 4.1 Methodological consideration and motivation . 43 4.2 The Design Science Research Framework . 44 4.2.1 Environment and Knowledge base . 44 4.2.2 Research output . 45 4.2.3 Research activities . 47 4.3 Research process . 48 4.3.1 Literature studies . 51 4.3.2 Evaluation . 51 5 contributions 53 6 conclusions and future work 59 xiii xiv contents ii papers 61 7 paper 1 – patterns and procedural content generation 63 7.1 Introduction . 65 7.1.1 Procedural content generation . 65 7.1.2 Structures, noise and meaning . 66 7.1.3 A little less randomization, a little more variation, please 68 7.2 Design patterns . 68 7.2.1 Design patterns in games . 69 7.3 Combining PCG and design patterns . 70 7.4 A plumber in a strangely designed land . 71 7.5 Looking for Patterns in all the right places . 72 7.5.1 Examples of Super Mario Bros design patterns . 72 7.6 The plan for pattern-based Mario level generation . 74 7.7 Conclusion . 76 7.8 Acknowledgments . 76 8 paper 2 – patterns as objectives for level generation 87 8.1 Introduction . 89 8.2 Background . 90 8.2.1 Design patterns . 90 8.2.2 Game content and game development . 91 8.2.3 Fitting into the pattern . 92 8.2.4 Related work . 93 8.3 Mario . 94 8.3.1 The original representation . 95 8.4 Representation and genotype-to-phenotype mapping . 95 8.4.1 Vertical slices . 97 8.4.2 Putting pieces together . 99 8.5 Fitness function . 101 8.6 Evolutionary algorithm . 103 8.7 Examples of generated levels . 103 8.8 Evaluation . 105 8.9 Discussion . 106 8.10 Conclusion . 107 contents xv 9 paper 3 – pcg using patterns as objectives 111 9.1 Introduction . 113 9.1.1 Background . 114 9.1.2 Examples of patterns . 115 9.2 Rationale . 116 9.2.1 Representation . 117 9.2.2 Evolutionary algorithm . 118 9.2.3 Fitness function . 118 9.3 Results and evaluation . 119 9.3.1 Finding patterns . 120 9.4 Expressive range . 124 9.5 Discussion . 128 9.6 Conclusion . 129 9.7 Acknowledgments . 129 10 paper 4 – a multi-level level generator 131 10.1 Introduction . 133 10.1.1 Contributions in this paper . 134 10.2 Background . 134 10.2.1 Procedural content generation in games . 135 10.2.2 Design Patterns . 135 10.2.3 Benchmark game . 136 10.3 Level Design Patterns in Mario . 137 10.3.1 Micro-patterns . 137 10.3.2 Meso-patterns . 138 10.3.3 Macro-patterns . 139 10.3.4 Multi-Level Level Generation . 141 10.4 Pattern-based level generation . 141 10.5 Automatic level analysis . 141 10.6 Methods . 142 10.6.1 Representation . 142 10.6.2 Evolutionary Algorithm . 142 10.6.3 Variation operators . 142 10.6.4 Fitness functions . 144 xvi contents 10.7 Results . 144 10.7.1 Efficiency . 145 10.7.2 Expressive Range . 146 10.8 Future work . 148 10.9 Conclusion . 149 11 paper 5 157 11.1 Introduction . 159 11.2 Related Work . 161 11.3 Experimental Testbed . 163 11.3.1 Generators . 163 11.3.2 Metrics . 165 11.4 Generator Comparison . 169 11.4.1 All Metrics . 169 11.4.2 Expressive Range Visualization . 173 11.4.3 Controllability . 174 11.5 Future Work . 175 11.6 Conclusions . 177 12 paper 6 – linear levels through n-grams 181 12.1 Introduction . 183 12.2 Capturing platformer level style with n-grams . 184 12.2.1 N-gram style capture . 185 12.2.2 Effects in other domains . 185 12.2.3 Information content . 187 12.3 Methods . 188 12.4 Results . 189 12.4.1 Effects of varying n .................... 190 12.4.2 Effects of varying training data . 192 12.4.3 Expressive range . 194 12.5 Large scale comparison . 197 12.6 Discussion . 199 12.6.1 The importance of the representation . 199 12.6.2 Pruning.