Volume 14, Number 3

Procedural Generation in 2D Metroidvania Game with Answer Set Programming and Perlin Noise

  Authors

John Xu1 and John Morris2, 1USA, 2California State Polytechnic University, USA

  Abstract

Designing metroidvania games often poses a unique challenge to video game developers, namely the difficulty of consistently preventing soft-locking, which hinders or blocks the player’s ability to traverse through levels effectively [1]. As a result, many turn to hand-making all levels to ensure the level’s traversability, but in the process often forsaking the ability to rely on procedural generation to lessen the time and burden on human game developers [2]. On the other hand, when developers rely on popular ways of procedural generation such as using perlin noise, they find themselves unable to control those procedural algorithms to guarantee certain characteristics of the outputs such as traversability [3]. Our paper aims to present a procedural solution that can also effectively guarantee the traversability of the generated level. Our method uses Answer Set Programming (ASP) to verify generation based on restrictions we place, guaranteeing the outcome to be what we want [4]. The generation of a level is divided into rooms, which are first mapped out in a graph to ensure traversability from a starting room to an ending boss area. The rooms’ geometry is then generated accordingly to create the full level. Using perlin noise, we were also able to create a demonstration of how traversability works in another form of procedural generation, and compare it with our methodology to identify strengths and weaknesses. To demonstrate our method, we applied our solution as well as the perlin noise algorithm to a 2D metroidvania game made in the Unity game engine and conducted quantitative tests on the ASP method to assess how well our method works as a level generator [5].

  Keywords

Procedural Generation, Answer Set Programming, Video Game Application