https://github.com/glouw/dungen
The dungeon generator
https://github.com/glouw/dungen
dungeon generator procedural
Last synced: about 1 year ago
JSON representation
The dungeon generator
- Host: GitHub
- URL: https://github.com/glouw/dungen
- Owner: glouw
- License: mit
- Created: 2018-02-17T21:42:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-13T20:15:07.000Z (over 7 years ago)
- Last Synced: 2025-04-04T02:51:03.682Z (over 1 year ago)
- Topics: dungeon, generator, procedural
- Language: C
- Homepage: http://glouw.com/2018/02/17/dungen.html
- Size: 106 KB
- Stars: 50
- Watchers: 5
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Delaunay Triangulation Dungeon Generator.
>> Inspired by Tiny Keep's dungeon generator.
Use case:
#include "Map.h"
int main()
{
const Map map = xmgen(80, 120, 10, 40);
xmprint(map);
xmclose(map);
}
Where the map generation function is defined as:
Map xmgen(
number of columns,
number of rows,
size of grid,
max number of rooms);
Generated map is stored as a 2D array of characters.
Here's what it looks like:
#############################################################
########### # # # ###########
## ## # # # ###########
## ## # # # # #
## ## # # # # #
## #
## ## # # # # #
## ## # # # # #
## ## # # # ##### #####
########### # # # ##### #####
############### ################### ################### #####
############### ############### # ## ##
############# ############# # ## ##
########### ########### # # #
########### ########### # # #
########### ########### #
########### ########### # # #
########### ########### # # #
############# ############# # ## ##
############### ############### # ## ##
############### ############################# ######### #####
### ##### ######################## #### ###
### ##### #### ############# ### ##
### ### ## ############# ## #
### ### ## ############# ## #
### ############# #
### ### ## ############# ## #
### ### ## ############# ## #
### ##### #### ############# ### ##
### ##### ####### ################ #### ###
##### ######### ######### ############################# #####
# # ##### ###### ### #### ###
# # ## ### ### #### ###
# # ## ### ### #### ###
# # ## ### ### #### ###
# ## ###
# # ## ### ### #### ###
# # ## ### ### #### ###
# # ## ### ### #### ###
# # ############ ### #### ###
##### #######################################################
##### ###### ### ################################
## ### ### ################################
## ### ### ################################
## ### ### ################################
## ################################
## ### ### ################################
## ### ### ################################
## ### ### ################################
############ ### ################################
############### ######### ###################################
############ ### ############## #############
############ ### ############## ##### ###
############ ### ############## #### ##
############ ### ############## #### ##
############ ### ############## ##
############ ### ############## #### ##
############ ### ############## #### ##
############ ### ############## ##### ###
############ ### ############## ####### #####
############### ######### ################### ######### #####
# ### #### ############## ####### #####
# ## ## # ### #### ##
# ## ## # ## ### ##
# ## ## # ## ### ##
# ## ### ##
# ## ## # ## ### ##
# ## ## # ## ### ##
# ## ## # ### #### ##
# ### #### ###### ####### ####### #####
##### ############################# ######### ######### #####
# ######################### ######### ##### #
# ####################### ##### ### #
# ####################### #### ## #
# ####################### #### ## #
# ####################### #
# ####################### #### ## #
# ####################### #### ## #
# ####################### ##### ### #
# ######################################### #
##### ################################################# #####
##### ##### ### ##### ############# #
# # ## #### ############# #
# # ## #### ############# #
# # ## #### ############# #
# ############# #
# # ## #### ############# #
# # ## #### ############# #
# # ## #### ############# #
########### ### ##### ############# #
############### ######### ######### ################### #####
########### ##### ##### # ##### #####
########### ## ## # ## ##
########### ## ## # ## ##
########### ## ## # ## ##
########### ## ## ##
########### ## ## # ## ##
########### ## ## # ## ##
########### ## ## # ## ##
########### ########### # ###########
#############################################################
Credit to Phi Dinh for the awesome algorithm.