Strategic Features and Terrain Generation for Balanced Heroes of Might and Magic III Maps
Total Page:16
File Type:pdf, Size:1020Kb
See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/328307880 Strategic Features and Terrain Generation for Balanced Heroes of Might and Magic III Maps Conference Paper · August 2018 DOI: 10.1109/CIG.2018.8490430 CITATIONS READS 2 142 6 authors, including: Jakub Kowalski University of Wroclaw 25 PUBLICATIONS 95 CITATIONS SEE PROFILE Some of the authors of this publication are also working on these related projects: Evolutionary algorithm for DFA synchronization View project "The length of a minimal synchronizing word and the \v{C}erny conjecture' View project All content following this page was uploaded by Jakub Kowalski on 07 November 2018. The user has requested enhancement of the downloaded file. Strategic Features and Terrain Generation for Balanced Heroes of Might and Magic III Maps Jakub Kowalski, Radosław Miernik, Piotr Pytlik, Maciej Pawlikowski, Krzysztof Piecuch, Jakub S˛ekowski Institute of Computer Science, University of Wrocław Wrocław, Poland [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] Abstract—This paper presents an initial approach to a generic algorithms, simulation-based evaluations, or neural networks algorithm for constructing balanced multiplayer maps for strat- [5]. However, their implementations usually have a purely egy games. It focuses on the placement of so-called strategic scientific character, as they are applied mostly to test-bed features – map objects that have a crucial impact on gameplay, usually providing benefits for the players who control them. games and tools [6], [7], [8], [9], [10], [11], [12], [13], The algorithm begins with constructing a logical layout of the indie games [14], or reimplementations of older titles [15], map from the perspective of a single player. We use a novel [16], [17]. There are, of course, notable exceptions, including approach based on graph grammars, where rules do not add level generation for Angry Birds [18], Cube 2 [19], [20], or new features but are initially constrained by the content of the StarCraft [21]. Some academic approaches even turned out start node, which simplifies their construction. To introduce other players’ space, the single-player graph is multiplied and partially into commercial (usually independently published) games, e.g. merged. The result is projected onto a grid by combining Sam- Galactic Arms Race [22], Petalz [23], or Darwin’s Demons mon mapping, Bresenham’s algorithm, and Voronoi diagrams. [24]. Nevertheless, it is often a difficult and laborious task Finally, strategic features are arranged on the map using an to meet all of the requirements and generate maps that are evolutionary search algorithm. playable in an already existing, commercially published game. We implemented the proposed method in a map generator which we are developing for the popular strategy game Heroes Our ambition is to develop a map generator for Heroes of of Might and Magic III. We also point out how this approach can Might and Magic III (HoMM3) [25] which could be widely be adapted to other games, e.g. StarCraft, WarCraft, or Anno. used by the game’s community. This paper describes the first Index Terms—procedural content generation, map generation, step towards this goal. We are presenting an algorithm that graph grammars, heroes of might and magic generates a balanced map layout, projects it onto a grid, and ensures a fair placement of the most important map features, I. INTRODUCTION mainly towns and mines. Procedural content generation (PCG) has been used in One of the main reasons for our work is, as we believe, games since the introduction of home computers. Examples a community need for such a tool. Although the game is include Beneath Apple Manor from 1978, or released in 1980 nearly 20 years old, it is considered the best part of the Rogue. However, the progress of PCG techniques did not go entire Heroes of Might and Magic series and is still widely hand in hand with the progress in other areas of game devel- played. There are multiple fan-made mods and extensions, opment. Nowadays, most popular commercial video games, including Horn of the Abyss, In the Wake of Gods, and VCMI especially AAA titles, either do not use procedural generation – an attempt to entirely rewrite the original HoMM3 engine. or use relatively simple constructive generative techniques [1], Additionally, in 2015, Ubisoft released the HD Edition of the which are not especially interesting from the research point of game (642; 075 ± 24; 614 sold copies according to the Steam view. Spy website1). Sadly, this version does not include expansions World generation in Civilization VI [2] is based mainly and lacks the random map generator. on Perlin noise and simple heuristics for objects placement. Existing template-based generators usually require a skilled Dungeons in Diablo III [3] consist of handcrafted tiles that user to modify generator’s behavior. Instead, we aim to pro- are combined together using a simple generator, and later pose a method that will be able to produce reliable maps based populated with randomized treasures and monsters. The levels on simple user preferences. We provide necessary background in Spelunky [4] always contain 16 rooms whose layouts about map generation approaches in the next section. Our are selected from a set of predefined templates. To increase algorithm is fully described in Section III. Section IV contains visual diversity, random obstacles are placed according to details of our implementation, which is tailored for Heroes of the templates’ indications. Lastly, monsters are put in spots Might and Magic III and yields playable maps. We discuss the determined by heuristic rules. results produced by our algorithm, present the arguments for On the other hand, academia-rooted PCG research often focuses on more advanced techniques, such as evolutionary 1https://steamspy.com/app/297000, retrieved March, 2018 its generality, and give a perspective of the future research in Lastly, we want to raise the subject of using cellular Section V. Finally, we conclude in Section VI. automata (CA) as a map-filling algorithm. It is often needed to populate an area with obstacles (water, impassable rocks, etc.) II. RELATED WORK in a way that is random, fast, and still somewhat controllable. A. Procedural Map Generation in Games In [31], cellular automata have been utilized to generate sur- prisingly lifelike cave-rooms. In particular, the authors perform In this section, we provide a brief overview of the PCG an exhaustive study on the influence of the CA parameters research and algorithms relevant to this study. For the compre- on the style of the obtained caves. In the genetic algorithm hensive survey on procedural generation and its role in games, for generating Dune 2-like maps [17], an interesting approach we refer to textbooks [5], [26]. to cellular automata-based genotype-to-phenotype mapping is Graph grammars ([27], [28]) allow to combine a powerful used. Instead of direct map representation, the evolutionary and intuitive concept of grammatical rules with a capacious process modifies only the CA parameters (e.g. size of a Moore- graph representation. This approach is often used for creat- neighbourhood, activation threshold, number of iterations), ing non-linear story-driven levels, where the level structure which are later used to fill the map with rock, sand, and strongly follows the generated plot. In other words, all possible indirectly other features like player starting zones. paths towards the objectives, along with the events that can be encountered along the way, are constructed as a randomly B. HoMM3 Map Generation generated graph. A random map generator had been introduced into HoMM3 In general, application of graph grammar rules is a compli- with the first expansion – Armageddon’s Blade. Despite many cated task, as the left-hand part of a rule has to match a proper faults it was, and still is, commonly used (its exclusion subgraph, which then has to be modified in-place according from HoMM3 HD Edition caused many complaints from to its right-hand side. To make generated structures more the players). The generator on its default settings tends to predictable, additional constraints are usually placed upon the produce highly unbalanced maps filled with items that are maximum number of application of certain rules or resources rarely used by human map-makers (e.g. Pandora’s Boxes with that those rules can place. This causes the entire architecture very random rewards), and valuable treasures that often lie to become significantly more complex. unprotected. One of its bugs can even occasionally make a Graph grammars are especially convenient for generating player starting position completely surrounded by obstacles. RPG-style one-player maps. A good example is a mission However, by overriding generator’s template, it is possible graphs generator for Dwarf Quest [14]. It is based on evo- to modify, to some limited extent, the algorithm’s behavior. lutionary search, where grammatical rules are applied as This allows to handcraft a structure similar to our map layout mutation operators. Evolved mission graphs are converted into (see Section III-C), which contains information about the Dwarf Quest levels consisting of pre-made rooms mapped zones’ characteristics and relative positions. Many alternative to nodes using so-called layout solver. Another approach, templates have been made and shared among the community2. presented in [12], generates Zelda-like levels via two-step The improvements of the random map generator are impor- evolutionary algorithm: the first phase generates an acyclic tant aspects of HoMM3 mods. Horn of the Abyss provides a high-level graph of areas, while the second evolves, for each graphical template editor offering a wide array of settings3. Re- area, a low-level cyclic graph consisting of rooms and doors. cently, a new web-based map generator had been published4.