ARogue, a RogueLike but not. ARogue is being developed for Android using the LUA based Gideros framework. Development has been underway for about a week now.
A RogueLike needs procedurally generated dungeons so I read quite a few articles about dungeon generation. Some of my favorite ones were..
NOTE: I had not read all of those articles before embarking on my journey, if I had then I might have gone down a totally different path.
I decided to make my own BSP like system to generate my dungeons. Partitioning takes place like a BSP but it doesn’t use any tree stuff, just trusty old LUA tables.
So currently my method of generating dungeons is like so..
- Subdivide space and mark any partition smaller than 4×4 as dead.
- Create a randomly sized room in each partition that is not dead.
- Loop through all rooms creating hallways from the center of one to the center of the other.
- Cull hallways that were created wider or taller than 1 cell (configurable).
- Crawl edges of rooms and create doors where the edge touches a hallway.
- Cull extraneous doors.
- Remap cells to tiles (using 8-bit) tiling method.
- Remap long hallways (configurable).
- Generate door information for each room.
Here are some pictures of some randomly generated dungeons. The dungeons are on a 16×16 grid, with 4 iterations of partition subdivision. The numbers are tile numbers used for when the dungeon is rendered later. The left image is the “vanilla” dungeon. The right image is the result of remapping long straight lengths of hallway. These ones look way nicer. The green lines show the segments of hallway that have been remapped. The yellow lines are obviously doors.
I’m pretty happy with how it is working currently. My next task is to go over the code so far and tidy it up.