A Hybrid Procedural Generation Applied to 2D Video Game Level Design and Terrains
Total Page:16
File Type:pdf, Size:1020Kb
Bachelor’s Thesis Muad Mahmud Sakah A hybrid procedural generation applied to 2D video game level design and terrains Muad Mahmud Sakah COSC-4235 Thesis Specialization: Computer Science (Game Design) Minor: Mathematics Director: Ratvinder Grewal Department of Mathematics and Computer Science Faculty of Sciences, Engineering, and Architecture Laurentian University Sudbury, Ontario, Canada ©Muad Sakah, Winter 2021 1 Bachelor’s Thesis Muad Mahmud Sakah _________________________________________________________________________ Acknowledgments I would like to express my gratitude and appreciation for all the people who supported and encouraged me throughout these last four years. I would like to thank the computer science and mathematics department for the help and support they provided me. I also would like to take the time to thank Dr. Ratvinder Grewal for taking the time to be my thesis supervisor and supporter, I appreciate everything he has done for me. Secondly, a lot of appreciation goes to Dr. Aaron Langille for introducing me to the computer science field and creating an open and exciting environment for everyone to participate in. Finally, I would like to thank all these participants (friends) who helped me with the testing’s that were done to make this project very successful and perform efficiently: Mouhamed Gningue Laurentian Hickey Mathieu Roy Anthony Milad Ricardo Grant Nabil Alyatem Moaad Balaban Thank you all for your support and faith in me! 2 Bachelor’s Thesis Muad Mahmud Sakah Abstract (English) The main objective of this project is to create a 2D-level platformer and terrain(s) by focusing on the use of a procedural generation instead of manually designing them by hand. Procedural content generation (PCG) techniques have often been limited to very unique types of game elements in game development. PCG has mostly been used to create complete game levels, with the exception of dungeons, which are a particular category of game level found in adventure and role-playing games. Dungeon levels and terrains are particularly well-suited to demonstrating the benefits of PCG due to their unique combination of speed, gameplay, and game spaces. By focusing on procedural generation, this project took a unique approach in designing 2D-dungeons and terrains by mainly focusing on a mathematical and algorithmic approach. This has concluded in a project that is capable of automatically re-generating itself by randomly generating different dungeon levels and terrains. Both of these procedural generations are unique with their separate techniques and aspects. The dungeon generation is designed to randomly generate a new dungeon each time the game runs, while the terrain generation is an infinite terrain that continues to generate and only focuses on the land and mountain generation. Bear in mind, that the dungeon generation has to meet a criterion in order for it to generate properly: the feasibility of the generation, the system must be able to generate beatable dungeons; the complexity, the path challenges the levels may present to a player if this was implemented into a game. The terrain generation had its own minor list of conditions that it needs to meet: the generation, the terrain has to be capable of infinitely re-generating itself on a single platform. Apart from the generating procedures, the project has resulted into a procedural generation that can be used by a game developer to implement within they’re game(s). 3 Bachelor’s Thesis Muad Mahmud Sakah _________________________________________________________________________ Abstract (French) L'objectif principal de ce projet est de créer un jeu de plateforme et un (des) terrain (s) de niveau 2D en se concentrant sur l'utilisation d'une génération procédurale au lieu de les concevoir manuellement à la main. Les techniques de génération de contenu procédural (PCG) ont souvent été limitées à des types très uniques d'éléments de jeu dans le développement de jeux. PCG a principalement été utilisé pour créer des niveaux de jeu complets, à l'exception des donjons, qui sont une catégorie particulière de niveau de jeu trouvée dans les jeux d'aventure et de rôle. Les niveaux et les terrains des donjons sont particulièrement bien adaptés pour démontrer les avantages de PCG en raison de leur combinaison unique de vitesse, de gameplay et d'espaces de jeu. En se concentrant sur la génération procédurale, ce projet a adopté une approche unique dans la conception de donjons et de terrains 2D en se concentrant principalement sur une approche mathématique et algorithmique. Cela s'est conclu dans un projet capable de se régénérer automatiquement en générant de manière aléatoire différents niveaux et terrains de donjon. Ces deux générations procédurales sont uniques avec leurs techniques et leurs aspects distincts. La génération de donjons est conçue pour générer aléatoirement un nouveau donjon à chaque exécution du jeu, tandis que la génération de terrain est un terrain infini qui continue de générer et se concentre uniquement sur la génération des terres et des montagnes. Gardez à l'esprit que la génération de donjons doit répondre à un critère pour qu'elle se génère correctement: la faisabilité de la génération, le système doit être capable de générer des donjons battables; la complexité, le chemin défie les niveaux peuvent présenter à un joueur si cela a été implémenté dans un jeu. La génération de terrain avait sa propre liste mineure de conditions qu'elle doit remplir: la génération, le terrain doit être capable de se régénérer à l'infini sur une seule plate-forme. Outre les procédures de génération, le projet a abouti à une génération procédurale qui peut être utilisée par un développeur de jeu pour implémenter dans son (ses) jeu (s). 4 Bachelor’s Thesis Muad Mahmud Sakah Contents Acknowledgments ....................................................................................................................... 2 Abstract (English) ....................................................................................................................... 3 Abstract (French) ....................................................................................................................... 4 Contents ..................................................................................................................................... 5 List of Figures............................................................................................................................. 7 List of Tables .............................................................................................................................10 Chapter 1: Introduction .............................................................................................................11 1.1 Topic (PCG) ................................................................................................................11 1.2 Problem ......................................................................................................................12 1.2.1 Scope of the project ..............................................................................................13 1.2.2 Games That Use Procedural Content Generation ...................................................14 1.3 Context .......................................................................................................................17 1.4 Development Tools ......................................................................................................18 1.4.1 Game Engines ......................................................................................................19 1.5 Generators ..................................................................................................................19 1.5.1 Level Generator (Dungeon) ...................................................................................20 1.5.2 Tile Generator (Terrain) .......................................................................................20 1.5.3 Game Engine ........................................................................................................20 Chapter 2: Project Organization ................................................................................................21 2.1 The Process .................................................................................................................21 2.1.1 Research before Implementation. ..........................................................................21 2.1.2 Project Planning ...................................................................................................22 2.2 Main Tasks ..................................................................................................................22 2.2.1 Dungeon (map) Generator ....................................................................................23 2.2.2 Area Generation (for dungeons) ............................................................................23 2.2.3 Terrain Scale Generation ......................................................................................23 2.3 Final Tasks ..................................................................................................................24 2.3.1 Action Plan ...........................................................................................................24 2.3.2 Action Plan Alterations .........................................................................................24 5 Bachelor’s Thesis Muad Mahmud Sakah