Some is watching is a Player Influenced Dungeon Level Generator made for my game AI course. In this project, my group and I strove to create a dungeon generator that would not influence the enemy's difficulty, but instead change the difficulty of the level design based on player performance. This project involved a group of four in which I developed the core level generator and worked on the evaluation of what makes a certain level harder or easier. Additionally, we chose to use an open-source Unity game project as our source due to needing to focus on the AI within our limited time window.
Once we had acquired the the dungeon crawl game, we needed to figure out how to generate levels. To begin we started with a simple 2d array of integers and populated it with random numbers from 0 to 2. We then took this array and translated it into Unity's tilemaps and generated a completely random map. Next we needed to clean up the maps so that they weren't random garbage. So after the initial randomness we ran some passes smoothing out terrain and adding a wall around the outside. Additionally, we cleared areas around enemy spawners and the player spawn to make those not spawn in walls.
Having a relatively cleaned-up level generator, we switched our focus to tracking the player's statistics. We recorded many different things from how long it took to beat the level to what percent was explored, to what percent of enemies were killed, and more. After tracking all of these things we looked at the information from a game designer's point of view. What does this information mean about our player? Are they good? Are they bad? Through careful consideration, we developed a set of metrics that would construe these metrics together to come up with an understanding of how well we think the player is doing.
Once we had the player metric we also needed to consider the levels metrics. How hard or easy is the level? With such a random generator some levels can be almost impossible while some were a cake walk. So we started to do the same thing we did for the player but for the level. In this case, we looked at how the player can interact with the level. For example we with enemy spawners further from the player spawn, they would have more time to spawn making the game harder. Another might be how the player can only attack left or right to fight in narrow vertical hallways would increase the difficult of a level.
Once we had there two metrics of where the player's skill is at and where the level's difficulty is, all that was left was to put them together. We had initially intended to make a genetic algorithm for picking the best level, but with that resulting in drastic load times, we ended up generating a single generation and picking the one that best represented the current player's statistics. This meant if the player was almost dead, the coming levels would be relatively easy with wide-open space to maneuver, while if the player was flying through the prior levels, the next level would have many narrow columns with distant enemy spawners.