Log In  


Dungeon Layout Generator

Cart #yositimosa-1 | 2019-05-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


Cart #yositimosa-0 | 2019-05-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Description

A generator based on this cart by @johanp. It uses a similar idea to place rooms, but is much more simplistic (I prefer to try and figure things out on my own before I dig into other people's code.) This particular version continuously generates new dungeons while running. Feel free to reuse this if you like.

Changelog

5/18/19
+Added some statistics about generators.
+Fixed some issues with rooms becoming isolated (I think)
+Randomized the variables rooms are generated with every loop to better showcase the generator.

2


Looking good!
How are you deciding when to shrink the room size?


@johanp: Right now it increments a counter for each room every frame and when that reaches 30, it shrinks the room in either x or y dimension by 1 and resets. If either reaches 0, the room is deleted, but it should probably shrink to 1-1 size before deleting instead.


Smart!


Love it! Though I did witness one generated dungeon where a room was placed in the top right corner and not connected to any other room.

Seems like a very rare event, only happened once and I watched it a while.

I'm like you, I don't like to use too much of other people's code, it's fun to try by yourself and you learn something.

If I ever make a roguelike I might try this method.


@RetroWolf: Thanks for letting me know! I think I have a fairly easy solution for that...I will upload a new version tomorrow with some improvements.



[Please log in to post a comment]