Project Rogue Mind


Capstone Poster

The Game

Rogue Mind is a 3D exploration horror game featuring a procedurally generated dungeon that is different every time you play. The player wakes up in a unfamiliar room with a large locked door with 3 strange locks. As the player explores the liminal, unsettlingly barren rooms they start to notice a few things, such as the objects and sounds consistently appearing with a few exceptions. However they also notice when they retrace their steps they find rooms that weren’t there before, rooms that used to be small but now are big, or used to be big but now are small. The player can’t remember where they have been as if these places are all new, save for a few rooms where key items or moments are found. All while this mystery of the mind unfolds the mystery of the space begins to reveal itself. Somewhere within these walls is a creature to remind you that you are not alone. The goal for the player must be to find out where they are and how to get out with their life. 

The player may notice inspirations from the backrooms urban legend, which is a place existing in the seams of reality, in between realms of consciousness. The monotony of the bland environment and fluorescent hum sticks like a pin in your head, giving the impression that there is no way out. Other inspirations were some video games such as the Portal series, Stanley Parable, and Superliminal. There also was a cinematic inspiration from the movie Cube which is about strangers trapped in a maze of rooms that shift around and contain deadly traps.


How To Play

The player starts in a room with the ability to move with WASD, sprint with shift, and look around with the mouse. The goal is to find key items that are needed to unseal the door. Once the player gets their bearings and they release the first lock, they then travel out the lone door to explore the vast unknown.


Throughout the game there is a lot of exploring and instead of looking for things out of the ordinary, looking for someone that fits too well and doesn’t match the area around it. The player travels around for a bit and may try and head towards rooms they’ve been in before, but the layout is different. The player can try and find a way around, perhaps back to the start room or another memorable key room they encountered, or they can travel around and try to manipulate the world around them and hope a path reveals itself before them.

Once the player finds the next key, they may not notice any immediate change but when they continue their search they will start to notice the rooms take on a new form or theme. Just when they get used to environment, it changes appearance as if they’re memory is being realized by the influence of discovering things lost. 

While all of this is occurring, the player still must not stay in one place for too long or risk being discovered by the creature that stalks around. Thankfully the creature seems to have almost no memory or even object permanence so the player only needs to keep a minimum distance to stay safe. Given the little amount of things in the rooms, there is a slim chance that a weapon could be  found if one even exists. The focus is just on getting away and out of here.


Technology Used

The game experience was made using Unity 3D with scripts written in C#. I chose unity because of its popularity and the fact that I have used it previously so I have a decent understanding of working in its environment. Its popular use helped in that there is a lot of resources online by both professional and amateur developers.

Alongside unity I used VS Code for the actual coding as well as Cinema 4D for creating some 3D elements.


Development Process

Development took trying many things and retrying different things. This project started with the thought that there will be a number of rooms of semi-random sizes and they will all be generated and then aligned with each other. This proved to be simplifying the process much more than it actually is. The first step was to get a floor and some walls and doorways standing. To do this an algorithm called Binary Space Partitioning is used, in other words it’s basically taking a space and splitting it into 2 parts and then repeating that process for each of those parts. After creating these good sized spaces it is then the job to erect walls along the borders to create enclosed rooms, as well as adding doorways to allow travel between rooms. For the actual creation of the 3D objects such as the walls, unity’s built-in ProBuilder editor was used, the API allows construction of basic shapes and a couple abnormal ones. Combining these things lead to a game that looks different every time you play. (E)(F)

The next challenge to tackle was the memory mechanic, as the player progresses through the game they “forget” certain rooms they’ve been in and if they return to the area the layout and sizes will be different. First, the initial problem was that if only a single room were to be replaced then it would need to be replaced by a room and is equal or lesser size which would lead to either no noticeable change or the gradual evolution of a dungeon with a bunch of tiny rooms. This was resolved by selecting a group a rooms for each cycle of rotating in new rooms. Due to the nature of the Binary Space Partitioning algorithm, the rooms can be grouped neatly in groups of 2^x rooms, meaning every group of 4, 8, 16, etc rooms formed a 4 sided space that can easily be replaced. The selected group is simply destroyed and then the generation algorithm is give the bounds of the space the create a new section.

An issue with generating a space with a number of rooms that may or may not have doors is that not all the rooms may be accessible. The solution to this was to incorporate a pathfinding algorithm to make sure that the dungeon that is generated is one that can be sufficiently traversed by the player. The algorithm involved in making this is an A* pathfinding algorithm. A* is also used in determining the movement of the creature so when the player is close enough it pursues the player but when there is enough distance it targets some other room in the dungeon to wander toward.

Much of the development was spent on these things but there were also many smaller things that took up some time. Among those were creating the 3D props such as tables and lights, as well as placing those objects during runtime so that they fill the space but also don’t look completely out of place (though some abnormality is intentional). Early on in development, and then improved later, a simple player character was put together that can move, sprint and interact with the environment as well as an environment that can be interacted with.


Algorithms

Binary Space Partitioning is the main algorithm used to generate the dungeon as well as its regenerations. The algorithm is given an area with a given length and width, these are the length and width of the whole dungeon. The algorithm is also fed how many iterations to go through, or how many times to split the available spaces. As the algorithm progresses it creates a tree, or a path that shows each space as a node that is connected to a parent node (also a space). In this case the top node of the tree is the whole dungeon and then two nodes are created underneath that which are the two resulting spaces from dividing the dungeon. Each of those nodes are then parent node of two more nodes each as the space is split even more.

Breadth First Search is an algorithm used to travel through the tree created by binary space partitioning and in this case returns all of the nodes that don’t have any children. A similar algorithm, Depth First Search could have also been used to get the same result. Breadth First Search works by starting from the top most node, or root, of a given tree and adds each node directly below it, or child, to a list before expanding the first child on the list to add those children, if any, to the list. It then repeats this process for each node in the list. For usage in Mind Rogue, each node that didn’t have a child was placed on another list which is the list of rooms from which everything else is made.

A* Pathfinding is an algorithm used to find the best, shortest path between two points and is used to check whether the generated dungeon is traversable enough for the game to progress. The algorithm works by having two calculated values, or heuristics, added together to create the value that determines what the next step will be. The two values calculated are the distance from the starting position and distance from the goal position. The third total value is then given to each possible step from the current position and the algorithm chooses the spot with the lowest value and then does it all again.


What’s Next

There is a lot to do to expand on what has been developed so far, among those are:

  • Improved generation to create more unique rooms and multiple floors.
  • Add more lore elements to give it a clear story
  • Add inventory system and usable items to create custom paths

Acknowledgements

First, thank you so much to my advisor Dr. Eric Kaltman for his encouragement and guidance. I’m also grateful for the other capstone students for their feedback and ideas. I also couldn’t have done this without the numerous resources online from other programmers and game developers.

Leave a Reply

Your email address will not be published. Required fields are marked *

css.php