The roguelike is a sub-genre of role-playing video games, characterized by randomization for replayability, permanent death, and turn-based movement. Many early roguelikes featured ASCII graphics. Games are typically dungeon crawls, with many monsters, items, and environmental features. Computer roguelikes usually employ the majority of the keyboard to facilitate interaction with items and the environment. The name of the genre comes from the 1980 game Rogue. (source: Wikipedia)
The interesting part of a Roguelike game is the dungeon: unlike solid perfect mazes like the one explained at Perfect maze generation – tile based version, roguelike dungeons have rooms, corridors, loops… not the kind of stuff we can obtain with a perfect maze generation script.
So I selected some interesting resources to help you understanding the process of dungeon creation, and I am obviously creating a script to create my own dungeons.
Let’s see the links:
Algorithm for random dungeon generation.
Lots of useful information about roguelike genre.
Forum thread about a roguelike dungeon creation contest with some interesting entries with source code, like this one or this one (with source code) that allows you to create a town full of enemies.
Grid-based dungeon generator: an easy method to generate maps that contain rooms guaranteed to fit within the dungeon space.
Portable open-source library written in C++ with a set of classes that can be used in all roguelike games. Classes are categorized to fullfill tasks of random map generation, pathfinding and counting field of view.
Some samples of code for a roguelike dungeon generation.
A simple method to generate a basic dungeon using a bsp tree, a space partitioning method. In mathematics, space partitioning is the process of dividing a space (usually a Euclidean space) into two or more disjoint subsets (see also partition of a set). In other words, space partitioning divides a space into non-overlapping regions. Any point in the space can then be identified to lie in exactly one of the regions.
This editor does not work but you can see how many options you can set for your dungeon generation.
A little program that builds a dungeon based on a particle aggregation algorithm.
Cellular automata method for generating random cave-like levels.
Multipart tutorial about unangband dungeon generation.
DungeonMaker manual – interesting read – and source code
That’s it… I already started coding my dungeon generation script, if you have one, let me know and I’ll publish it on the blog.