'dungeon creator': make random ASCII RPG dungeons

lotus 3189fa8f89 fixed make clean by adding .i files 2 weeks ago
include e70d8446d5 Added debug and optimizd build targets, updated README, added more comments, modified dir structure, prep for unit testing 2 months ago
tests 81ad94ad70 Added empty Cmocka test 2 months ago
.gitignore 1b51ff7007 add ubsan and asan to debug target, add .i files to gitignore 2 months ago
.travis.yml c1732ff313 added travis build, updated readme with badge 1 month ago
LICENSE.md d62957b8bc first commit 6 months ago
README.md c1732ff313 added travis build, updated readme with badge 1 month ago
compile_commands.json e70d8446d5 Added debug and optimizd build targets, updated README, added more comments, modified dir structure, prep for unit testing 2 months ago
duncr.1 d62957b8bc first commit 6 months ago
duncr.c e70d8446d5 Added debug and optimizd build targets, updated README, added more comments, modified dir structure, prep for unit testing 2 months ago
makefile 3189fa8f89 fixed make clean by adding .i files 2 weeks ago

README.md



License Build Status

short for 'dungeon creator'

Generates random ASCII RPG dungeons.

Motivation

I wanted a fun C project to work on, and something that I could potentially use now and expand later. Eventually I would like to include this in an ASCII roguelike game of my own creation. Make some super sweet maps!

Project Goals

  1. Clean, safe, and portable C style
  2. Commandline interface
  3. Include portals, enemies, gold, items, etc.
  4. Customization options

Example Dungeon

( 31x31 grid)
-- Level 1: ----------------------------------------------------------
##############################
#################       ######
################          ####
#   ###########           ####
#   ###### ####        #   ###
#   #####  h    #    ###   ###
#    ####    ##   ############
#  ^ ####    ## ########  ####
#    ##    ####  ######     ##
### ###    ## #  ########   ##
#   #       #   #########   ##
#                ##  #### # ##
#                     ##  #  #
#      ###        ###        #
#    v #          ####       #
# #    # #         #######   #
#      #           ######### #
# p         #     ############
##    ###m  # x   ############
##     ###  ####  ############
### # ########### ############
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################
##############################

Prerequisites

  • C99 capable compiler/lib
  • POSIX compatible make (Gmake, Bmake, etc.)

Build

git clone https://git.zerohack.xyz:443/lotus/duncr.git
cd duncr
make && make install # will likely need root privileges

# to make a debug version
make debug

# to make an optimized version
make opt

Usage

# note: the order of arguments does not matter
duncr                     # use defaults (one 80x80 level)
duncr -g 100              # generate one 100x100 level
duncr -g 73 -n 12         # generate twelve 73x73 levels
duncr -c 5                # generate a level with maximum handiCap
# handicap means more gold and items and less baddies..
duncr > my_dungeon.txt    # redirect the output to save the level

# Legend: 
# #: walls
#  : floor (empty space)
# h: hero
# x: enemy
# ^: stairs up
# v: stairs down
# t: trap (gas, spikes, rope, fire)
# p: portal (transport to another portal on level)
# g: gold
# m: merchant (buy items)

TODO

  • make basic version
  • included portals
  • include stairs
  • include traps
  • include items
  • include gold
  • remove VLAs
  • improve map creation algorithm (better number of walkers)
  • proper argument input
  • check user input
  • pass structs into functions (for cleanliness)
  • add capability to create multiple maps in one call (-n flag)
  • add handicap scaling
  • improve tile placement probability code

License

BSD 3-clause License (see LICENSE.md)