Search-Based Procedural Generation of Maze-Like Levels

Daniel Ashlock, Colin Lee and Cameron McGuinness
Submitted to IEEE Transactions on Artificial Intelligence and Computational Intelligence in Games.

Abstract PDF eprint

A correctly designed dynamic programming algorithm can be used as a fitness function to permit the evolution of maze-like levels for use in games. This study compares multiple representations for evolvable mazes including direct, as well as positive and negative indirect representations. The first direct representation simply specifies, with a binary gene, which squares of a grid are obstructed. The second paints the maze grid and passage is allowed only between colours that are the same or adjacent in a rainbow. The positive and negative representations are developmental and evolve directions for adding barriers or digging -Y´tunnels¡. These representations are tested with a design space of fitness functions that automatically generate levels with controllable properties. Fitness function design is the most difficult part of automatic level generation and this study gives a simple framework for designing fitness functions that permits substantial control over the character of the mazes that evolve. This technique relies on using checkpoints within the maze to characterize the connectivity and path lengths within the level. Called checkpoint based fitness, these fitness functions are built on a menu of properties that can be rewarded. The choice of which qualities are rewarded, in turn, specifies within broad limits the characteristics of the mazes to be evolved. Three of the representations are found to benefit from a technique called sparse initialization in which a maze starts mostly empty and variation operators fill in details while increasing fitness. Different representations are found to produce mazes with very different appearances, even when the same fitness function is used. The example fitness functions designed around dynamic programming with checkpoints are found to permit substantial control over the properties of the evolved mazes.