Towards Multiobjective Procedural Map Generation
Total Page:16
File Type:pdf, Size:1020Kb
Towards multiobjective procedural map generation Julian Togelius Mike Preuss Georgios N. Yannakakis IT University of Copenhagen TU Dortmund IT University of Copenhagen Rued Langgaards Vej 7 Otto-Hahn-Str. 14 Rued Langgaards Vej 7 Copenhagen, Denmark Dortmund, Germany Copenhagen, Denmark [email protected] [email protected] [email protected] dortmund.de ABSTRACT sentation and fitness function design, we will provide some A search-based procedural content generation (SBPCG) al- background on procedural generation of maps and terrains, gorithm for strategy game maps is proposed. Two repre- on search-based procedural content generation and on mul- sentations for strategy game maps are devised, along with a tiobjective evolution. number of objectives relating to predicted player experience. 1.1 Procedural map and terrain generation A multiobjective evolutionary algorithm is used for search- Maps are central to many computer games, including many ing the space of maps for candidates that satisfy pairs of First-Person Shooters (FPS) and Role-Playing Games (RPG), these objectives. As the objectives are inherently partially where the player experiences the world from a first-person conflicting, the algorithm generates Pareto fronts showing perspective as he navigates a typically hostile environment. how these objectives can be balanced. Such fronts are ar- But they are perhaps most important for strategy games, gued to be a valuable tool for designers looking to balance both of the turn-based variety and Real-Time Strategy (RTS) various design needs. Choosing appropriate points (man- games. In these games, the player views the playing area ually or automatically) on the Pareto fronts, maps can be from a third-person perspective (usually from above) while found that exhibit good map design according to specified directing one or several units as they traverse an area and criteria, and could either be used directly in e.g. an RTS perform missions, usually involving battle. For the remain- game or form the basis for further human design. der of this paper, we will be concerned with such games. Most strategy games come with a set of hand-crafted maps, 1. INTRODUCTION used both in single-player\campaign"mode and multi-player This paper presents a search-based approach to generating modes. However, there are numerous reasons for wanting to maps, both terrain height and base and resource placement, automatically generate maps. Perhaps the most obvious rea- for strategy games. Search-based procedural content gener- son is that by generating a fresh map each time the game is ation has a number of important differences to other types played, you extend the life-span of the game by permitting of procedural content generation (PCG) in games; in partic- the player to explore a fresh map and the specific challenges ular it offers the possibility of directly optimizing content for it entails each time the game is played. This also means that particular types of players and experiences. As it is hard to any advantages a player has accrued in multi-player matches devise a single and unambiguous measure of quality or fit- by learning a map by heart are nullified. ness for strategy game maps, but reasonably easy to come up A slightly less obvious reason is that maps could be tai- with measures of particular aspects of map quality, we cast lored to suit specific players or groups of players, and/or to the problem of generating such maps as involving multiple generate particular gameplay experiences. For example, a objectives and use a multiobjective evolutionary algorithm player that has proven adept at a particular form of strat- at the core of our approach. egy might be presented with a freshly generated map that Thus, the contributions of this paper are twofold: we show challenges her to develop other aspects of her strategic think- how complete maps (as opposed to just height maps) can be ing; or, if she has been determined by the game to be less generated in a search-based paradigm, and show how mul- motivated by challenge and more by easy progress, the new tiobjective optimization can be applied to procedural con- map could play to the strengths of her particular playing tent generation. In both cases, we believe that this is the style while being seemingly dissimilar to previous maps she first time such an approach is published in the academic has played. In a multi-player game, maps might be gen- literature. Before diving into the particulars of map repre- erated that balance out the strengths of playing styles of different players with differing levels of proficiency, without resorting to explicit handicapping in terms of game rules or units supplied. Such content generation places particular Permission to make digital or hard copies of all or part of this work for demands on models of player behaviour and preferences, as personal or classroom use is granted without fee provided that copies are well as on what ways the map creation algorithm can be not made or distributed for profit or commercial advantage and that copies controlled. bear this notice and the full citation on the first page. To copy otherwise, to But one might also want to use procedural map generation republish, to post on servers or to redistribute to lists, requires prior specific algorithms as authoring and design support tools, to com- permission and/or a fee. PCGames 2010, June 18, Monterey, CA, USA plement human creativity. In this case the PCG tools would Copyright 2010 ACM 978-1-4503-0023-0/10/06 ...$10.00. be used off-line, before a game is shipped or before new high- quality maps are made available for download. The role of with none or only insignificant backtracking. In contrast the algorithm would be to suggest new map designs accord- to this generate-and-test algorithms make several attempts, ing to optional parameters or constrains, which could then and only keep those candidate maps (or other types of gen- be modified and refined by human map designers. erated content) that pass some sort of test. One example While most strategy games stick with prefabricated maps is Tarn Adams' ambitious game Dwarf Fortress, in which (possibly complemented with an end-user map editor), a sig- initial fractal map generation is usually repeated a couple nificant minority are based on random map generation. An of times, and the user is shown screenshots of \failed" maps influential example is the Civilization series of epic turn- along with explanations of which playability tests the maps based strategy games, in which the default game mode sees failed to meet. the player playing on a new randomly generated world map. Search-based procedural content generation (SBPCG) is a No details have to the authors' best knowledge been released particular type of generate-and-test PCG, where the gener- about Civilization's map generation algorithm, but the very ated candidate content is not simply rejected or accepted by short time to generate a map suggests a relatively uncom- the test but graded on one or several numeric dimensions, plicated algorithm. The parameters available to the user for and some sort of search or optimization algorithm is used map generation are relatively few, the most important one to find better content based on the evaluations of already relating to size and connectedness of the islands forming the generated content. world's landmass. Usually, some sort of evolutionary computation (e.g. a The simplest way of generating maps similar to those used genetic algorithm or an evolution strategy) is used as the by Civilization is probably to seed the ocean with embryonal core algorithm for SBPCG. In these cases, a population of islands, and have them grown out in a random direction a candidates (e.g. maps) is created randomly at the beginning predefined number of steps [1]. Certain features on land, of a run of the algorithm, and each generation the best can- such as forest areas, can be created in the same way, and didates are selected (according to some fitness function) and simple constraints can easily be added such as not connect- the worst candidates are replaced with new candidates gen- ing certain land areas (so as not to fill in canals). erated through mutation (random perturbation) and/or re- Slightly more advanced approaches involve using fractals, combination from the best candidates. Core concerns when such as the diamond-square algorithm [12]. The diamond- devising an SBPCG solution to some content generation task square algorithm works by iteratively subdividing areas of is how to represent the content and how to devise the fitness space and offsetting the midpoint by random amounts. Such function. A recent overview of SBPCG can be found in [19]. algorithms are most commonly used for height maps, where One of the main arguments for SBPCG is that it allows the they can, for example, generate believable mountains. An designer to formulate the desired properties of the content advantage of this family of algorithms is that they are so more explicitly than with other content generation methods. fast that they can often be used for realtime terrain gener- Another argument is that it allows the use of content repre- ation [13]. sentations that sometimes yield infeasible solutions (e.g. un- Recently, Doran and Parberry suggested the use of soft- usable maps), as such candidates can be discarded but still ware agents for generating terrain [8]. In their approach, form the basis for later, better candidates. The main argu- a large number of agents are let loose on an initially fea- ment against SBPCG is that it can be very time-consuming, tureless piece of terrain and collectively shape it.