Dungeon Procedural Generation

  • View
    23

  • Download
    1

Embed Size (px)

DESCRIPTION

By David Adams

Text of Dungeon Procedural Generation

  • Automatic Generation of Dungeons for Computer Games

    Author David Adams Date - 28/05/2002 Supervisor Michael Mendler This report is submitted in partial fulfilment of the requirement for the degree of Bachelor of Science with Honours in Computer Science by David Adams.

  • Declaration

    All sentences or passages quoted in this dissertation from other peoples work have been specifically acknowledged by clear cross-referencing to author, work and page(s). Any illustrations which are not the work of the author of this dissertation have been used with the explicit permission of the originator and are specifically acknowledged. I understand that failure to do this amounts to plagiarism and will be considered grounds for failure in this dissertation and the degree examination as a whole. Name: Signature: Date:

    ii

  • Abstract The genre of dungeon games, or first-person shooter games as they are more commonly known, has emerged over the last ten years to become one of the most popular types of computer game. At present, the levels in this type of game are generated manually, which is a very expensive and time-consuming process for games companies. If levels could be generated automatically then this would not only reduce development costs, but allow levels to be generated at run-time, giving game players a new playing experience each time a game was played and greatly improving the replayability of the game. In this project, a technique known as graph grammars will be used in order to allow descriptions of randomly generated game levels to be created automatically. As part of the project, algorithms to assess the size, difficulty and fun-value of a level will be developed, to allow individual levels to be tailored to particular requirements. This project is being undertaken in cooperation with Infogrames.

    Figure 0a: Screenshot from the dungeon game Half Life [57]

    iii

  • Acknowledgments I would like to thank the following people for their help during this project: - Ian Badcoe, of Infogrames, for sparing the time to describe the objectives of the project to me. Marian Gheorghe, my second examiner, for his comments on this report. Michael Mendler, my project supervisor, for his support throughout the project.

    iv

  • Contents

    Chapter 1 Introduction ................................................................................................. 1 Chapter 2 Literature Review........................................................................................ 3

    2.1 DUNGEON GAMES.................................................................................................. 3 2.1.1 Description..................................................................................................... 3 2.1.2 History............................................................................................................ 3

    2.2 AUTOMATIC CONTENT GENERATION IN GAMES .................................................... 5 2.2.1 Content Generation in Dungeon Games........................................................ 5 2.2.2 Current Automatic Content Generation in Games ........................................ 5 2.2.3 Fractal and Bitmap Terrain Generation........................................................ 6 2.2.4 The Context-Free Grammar Approach.......................................................... 7

    2.3 GRAPH GRAMMARS ................................................................................................ 9 2.3.1 Introduction.................................................................................................... 9 2.3.2 Algorithmic Node Replacement Systems...................................................... 10 2.3.3 Algebraic Node Replacement Systems ......................................................... 11 2.3.4 Controlling Rule Application....................................................................... 12 2.3.5 Summary ...................................................................................................... 13

    2.4 GRAPH GRAMMAR TOOLS.................................................................................... 13 2.4.1 Task Specific Tools ...................................................................................... 13 2.4.2 General Programming Tools ....................................................................... 14

    2.5 LEVEL DESIGN ..................................................................................................... 16 2.5.1 Game Theory................................................................................................ 16 2.5.2 Psychology and Game Design ..................................................................... 17 2.5.3 Good Level Design....................................................................................... 18

    2.6 SUMMARY............................................................................................................ 19 Chapter 3 A General Graph Grammar System .......................................................... 21

    3.1 DESIGN ................................................................................................................ 21 3.1.1 Specific Requirements.................................................................................. 21 3.1.2 Graph Grammar Approach and Language.................................................. 21 3.1.3 Class Design ................................................................................................ 21 3.1.4 Algorithm Design ......................................................................................... 23

    3.2 EXAMPLE ............................................................................................................. 24 3.3 THE POWER OF CONTEXT-FREE GRAPH GRAMMARS ........................................... 25

    Chapter 4 The Dungeon Generation System ............................................................. 27 4.1 A BASIC STRATEGY TO GENERATE LEVELS ........................................................ 27

    4.1.1 Search Concepts........................................................................................... 27 4.1.2 Design .......................................................................................................... 28 4.1.3 Example........................................................................................................ 31

    4.2 ESTIMATING PARAMETERS .................................................................................. 31 4.2.1 Size ............................................................................................................... 33 4.2.2 Difficulty ...................................................................................................... 35 4.2.3 Fun-value ..................................................................................................... 35

    4.3 CREATING GOOD LEVELS .................................................................................... 36 4.3.1 The Pointless Area Problem ........................................................................ 36 4.3.2 Design .......................................................................................................... 37 4.3.3 Example........................................................................................................ 41

    4.4 A GRAPHICAL USER INTERFACE .......................................................................... 42 4.4.1 Introduction.................................................................................................. 42 4.4.2 Design .......................................................................................................... 42

    v

  • 4.4.3 Example........................................................................................................ 44 4.5 SUMMARY............................................................................................................ 44

    Chapter 5 Evaluation.................................................................................................. 46 5.1 RULES FOR AN EXAMPLE GAME........................................................................... 46

    5.1.1 Introduction.................................................................................................. 46 5.1.2 Modelling the Game..................................................................................... 46 5.1.3 Example........................................................................................................ 49 5.1.4 Conclusions.................................................................................................. 50

    5.2 EFFICIENCY.......................................................................................................... 51 5.2.1 The Problem................................................................................................. 51 5.2.2 Improving Rule Application......................................................................... 51 5.2.3 Improving Dealing With Pointless Areas .................................................... 51 5.2.4 Results .......................................................................................................... 52

    5.3 OTHER FACTORS.................................................................................................. 54 Chapter 6 - Conclusion ................................................................................................. 55

    6.1 PROJECT SUMMARY ............................................................................................. 55 6.2 SUCCESS OF THE PROJECT.................................................................................... 55 6.3 FUTURE WORK.......