Procedural Generation of 3D Maps with Snappable Meshes Rafael C
Total Page:16
File Type:pdf, Size:1020Kb
1 Procedural Generation of 3D Maps with Snappable Meshes Rafael C. e Silva, Nuno Fachada, Diogo de Andrade, and Nelio´ Codices´ Abstract—In this paper we present a technique for procedu- detail in Section III—is fully swappable, and implementing rally generating 3D maps using a set of premade meshes which new ones is relatively simple. Four of these generation meth- snap together based on designer-specified visual constraints. The ods are described in this paper and included in the provided proposed approach avoids size and layout limitations, offering the designer control over the look and feel of the generated maps, prototype implementation. as well as immediate feedback on a given map’s navigability. A The snappable meshes PCG technique was initially devel- prototype implementation of the method, developed in the Unity oped for a multiplayer combat game, created as a semester game engine, is discussed, and a number of case studies are project at Lusofona´ University’s Bachelor in Videogames—an analyzed. These include a multiplayer game where the method was used, together with a number of illustrative examples which industry-focused, interdisciplinary game development degree highlight various parameterizations and generation methods. We [4]. The decision of using PCG in this particular game project argue that the technique is designer-friendly and can be used as was made to promote its replayability, requiring players to a map composition method and/or as a prototyping system in 3D adapt to a new map on every match, keeping the experience level design, opening the door for quality map and level creation from turning stale once the combat loop is mastered. Given in a fraction of the time of a fully human-based approach. the technique’s capability of creating general 3D maps (i.e., Index Terms—Procedural content generation (PCG), 3D maps, non-action game-specific maps), its core ideas were previously designer-centric methods, constraint-based PCG. presented in a conference [5]. The present paper extends that publication in several ways, making the following contribu- I. INTRODUCTION tions: N this paper we describe a method for procedurally generat- • The technique is presented in a carefully formalized, I ing 3D maps using visual constraints. The approach, termed fully reproducible and implementation-independent fash- snappable meshes, consists of a system of connectors with ion. Furthermore, it is comprehensively classified and pins and colors—similar in concept to a jigsaw puzzle—which contextualized within the PCG state of the art, highlight- constrains how any two map pieces (i.e., meshes) can snap ing the advantages it brings with respect to explainability together. Through the visual design and specification of these [1] and potential integration with industry workflows [2]. connection constraints, and an easy-to-follow and fully ex- • A new optional connection constraint is introduced in the plainable [1] generation procedure, the method is accessible to form of a color compatibility layer, specified through a game designers and/or other non-experts in procedural content color matrix. Additionally, two navigability-focused map generation (PCG), artificial intelligence (AI) or programming. validation metrics are proposed and analyzed. While the maps are procedurally generated, the technique • A reference and standalone implementation of the tech- grants the game designer considerable influence over the final nique, developed in the Unity game engine [6], is pre- result. More specifically, the designer has complete control on sented and examined. This implementation is made avail- the modeling of individual meshes—including the placement able as free and open-source software, and the source arXiv:2108.00056v1 [cs.AI] 30 Jul 2021 and configuration of associated connectors—and can achieve code is thoroughly annotated. Further, it includes con- substantial customization on the generated maps through a crete solutions for issues considered separate from the small number of intuitive parameters. At the same time, the technique itself, such as mesh overlap detection (i.e., technique avoids size and layout limitations, common in grid- collision avoidance) and specific obstacles to validating based approaches. Maps are generated almost immediately and map navigability. can be quickly validated for navigability. With a focus on fast • Using the prototype implementation, an in-depth analysis iteration and respect for existing development workflows [2], of the technique’s generation and validation capabilities the snappable meshes PCG technique can be used in practical is undertaken, namely on how the various parameters and industry settings, while following academic best practices such generation methods influence the created maps, as well as transparency and reproducibility [3]. Further, the technique as the generation and validation times. can be easily tweaked and extended by programmers, since one • A thorough discussion on several aspects of the proposed of its core components—the generation method, discussed in technique, related to its designer-centric approach, ap- plicability (i.e., in which scenarios could the method be All authors are with the School of Communication, Arts and In- formation Technology at Lusofona´ University, Lisboa, Portugal e-mail: more useful), limitations, as well as alternative uses and [email protected] possible improvements. N. Fachada and D. de Andrade are with COPELABS, Lusofona´ University N. Codices´ is with Instituto Superior Tecnico,´ Lisboa, Portugal The paper is organized as follows. In Section II, we review 2 related work concerning the use of PCG for map design in might occupy in a chunk during play to determine which other computer games. In Section III, we describe the snappable chunks are adequate for combination, thus requiring pieces of meshes PCG technique, namely the components that make geometry annotated with gameplay information. up the system, and classify the method according to a well- PCG can be used together with pre-established level design known PCG taxonomy. A reference implementation of the patterns to generate desirable levels. Two proposals have method, developed in the Unity game engine, is presented in employed a MICC approach, where the contribution from Section IV. Several case studies are examined in Section V, the level designers is used in the optimization process of including one where the method was used for generating the generators’ evolutionary algorithm [14], [15]. This way, arenas for the aforementioned multiplayer combat game. A their accumulated knowledge of level design is fed into the discussion of the method, possible uses, limitations and poten- generators, refining not only level layouts but also agent and tial improvements follows in Section VI. Section VII closes item placement on each iteration. This is accomplished by the paper, offering some conclusions. identifying and then reinforcing the level design patterns in the heuristics, leading to both playable and enjoyable experiences. Sentient Sketchbook [16] is a MICC level design tool for II. BACKGROUND strategy games, where designers sketch maps while being The use of PCG for creating maps and levels in computer presented with similar, more detailed alternatives. These rec- games began in the late 1970’s with games such as Beneath ommendations are presented in real time using evolutionary Apple Manor and Rogue [7], and is unarguably the most search and employing gameplay metrics—such as balance, common use case of PCG in games [8]. Academic interest exploration, resources or navigability—as fitness dimensions. in this area has been growing, with a number of important A number of 3D map and level generation approaches developments occurring in the last 15 years [9], [10]. have also been proposed. SuSketch [17], aimed at generating PCG techniques are often fully autonomous, in the sense first-person shooter levels, is one such case. Like Sentient that the user simply performs some initial configuration, such Sketchbook, the user provides the initial designs and the as defining parameters and/or output constraints, before con- tool offers alternative layouts and feedback on a number tent is generated. Recently, mixed-initiative content creation of gameplay metrics in a full MICC fashion. Additionally, (MICC) techniques, in which a combination of human input SuSketch also provides gameplay predictions which take into and computer-assisted PCG are used, have gained traction in account different character classes. game development in general and map design in particular FPSEvolver is a 3D MICC generation proposal in which the [8], [11]. However, the line that separates autonomous PCG human contribution for level design comes from the players and MICC-PCG is ill-defined. For example, Yannakakis & themselves. It consists of a multiplayer shooter featuring a Togelius [8] claim that “the PCG process is autonomous when novel grid-based interactive evolution approach for generating the initiative of the designer is limited to algorithmic parame- maps according to the players’ preferences [18]. Players terizations before the generation starts”. Then, how to classify vote on a selection of evolving scenarios, with the goal of a PCG technique that works according to this statement, but generating levels in accordance with what they consider to be produces results which mainly depend on designer-provided a good map. building blocks, such as the one presented in this paper? Oblige is a 3D level generator for the