- Home /
Altering a "Drunkard Walk" random level generation algorithm to create an ever-changing, non-euclidian labyrinth
I've been banging my head against this brick wall of a problem for quite some time, maybe you lovely people can offer me some assistance. Forgive me ahead of time because I don't know many of the correct terms for what I've doing, thanks to the fact that I dove headfirst into this project without prior knowledge of the Unity engine and most of my work is plagiarized piecework. ANYWAY
I've crafted an assortment of prefab room 'tiles' that can be assembled into a maze, and I've been writing a variation on a 'drunkard walk' procedural dungeon creation algorithm that puts them all together.
But after logically assembling my prefab tile set into a maze prior to the start of each "floor", I intend to have the maze reassemble itself 'illogically' in real time, as the player moves through it. For example, if the player closes a door, turns his back on or moves away from one section of the maze, (i.e., a bounding box that surrounds the player or the bounding box that represents his line of sight is no longer in contact with that section of the labyrinth) those prefab rooms are destroyed and replaced by an opposite or just 'illogically' facing one.
Say the player turns left in the maze, opens a door, and finds himself at a dead end. When he turns around to go back through the door, he will find that the room has changed. Impossibly, the hallway he just walked through now turns left, instead of right. Or it now leads to a staircase that descends forever, or a massive hall that couldn't have possibly fit in the room that had been there previously.
There are several issues with the game so far; Occasionally the framerate slows dramatically when previous rooms are being replaced, and often the placement of those rooms is -too- illogical, the prefabs no longer tend to fit together properly or assemble at the wrong point of contact and thus the player sometimes falls through the floor into a void of doom.
Also, despite differentiating between the 'drunkard walk' pre-produced 'logical' portion of maze and the 'illogical' shifting section with a variable based on wether or not the player has already entered that room, large portions of the pre-produced maze are often unnecessarily deleted.
Is this 'drunkard walk' method of level generation even a viable one for this project, or should I scrap this code and switch to something akin to what this guy is doing?
Your answer
Follow this Question
Related Questions
Spawning collectibles in a randomly generated maze 1 Answer
Infinite Sidescroller 1 Answer
Create the visual spring in Unity? 3 Answers
Procedural Skinned mesh? 1 Answer
Grouping vertexes using bones 1 Answer