Random Level Generation

 Author: Cameron Taylor
Posted on 2/17/2022

I started working on the random level generation and my biggest issue that the time was that I wasn't able to tell if the generation was correct or not. In order to fix this I opened up my END lab and transferred over my files to start drawing the levels out onto the screen. I then had an issue where none of the rooms were connected and I had no way of detecting if two rooms were next to each other to connect in the first place. This is a big issue because if not all the rooms are connected correctly or in a manner that is solvable; then the player can't finish a floor.

The main issue that was holding me back is that I had no way to know where one room was relative to another. To fix this I used a map to store the location of a room and the output was the index inside the vector of rooms. Once I was able to store that I could generate a whole bunch of rooms all stretching out like a snake and showing proper connection points. I had a small issue with it sometimes wrapping back around on the origin point, but I fixed that. This will improve the user experience because the rooms will be completely random and crazy unique every time. I also have the ability to put in a seed that will generate the same floor layout every time (tested).

Comments

Popular posts from this blog

Adding assets to every enemy -- Owen Meyers

Sphere to AABB collision