The Depths Procederal Dungeon
  So after a few failed attempts that forced me to find figure out different methods of laying the dungeon out.  I settled on procedure that creates very random floor layouts.  This is good for what I want to do because it creates dungeons that feel more like cave structures.  Currently the code for this engine only lays out the floors for voids and halls.  The next step will be to add a start and exit to each floor along with spawner and debris.
In the dream editor I only needed to lay out the areas that are inside the dungeon area and outside the dungeon area. In the future this will all be coded into the dragon speak itself to allow for growing dungeon sizes as you progress down. But for now laying it out visually was the easiest way for me to work in the code, allowing me to make quick changes that I could test.
This video shows the results of the code, and how it creates a randomized walk-able area.
Finally the code itself, I am not going to go into to much detail on how it works. But basically it finds the place holding item and lays down a three lane path marking where it started and where it ended. The next hallway is then attached to the end of that hallway. If it tries to lay a hallway and fails to do so the place item will be moved to a place that already has a floor tile. After the hall count is met it moves on putting in rooms. It will select a random places where halls have started or ended. All of this does allow for some overlap which creates some really random dungeon layouts.
It is a fairly long bit of code so I will link to the raw code. It is not fully commented so it may be hard to read. Code
In the dream editor I only needed to lay out the areas that are inside the dungeon area and outside the dungeon area. In the future this will all be coded into the dragon speak itself to allow for growing dungeon sizes as you progress down. But for now laying it out visually was the easiest way for me to work in the code, allowing me to make quick changes that I could test.
This video shows the results of the code, and how it creates a randomized walk-able area.
Finally the code itself, I am not going to go into to much detail on how it works. But basically it finds the place holding item and lays down a three lane path marking where it started and where it ended. The next hallway is then attached to the end of that hallway. If it tries to lay a hallway and fails to do so the place item will be moved to a place that already has a floor tile. After the hall count is met it moves on putting in rooms. It will select a random places where halls have started or ended. All of this does allow for some overlap which creates some really random dungeon layouts.
It is a fairly long bit of code so I will link to the raw code. It is not fully commented so it may be hard to read. Code

Comments
Post a Comment