Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the gamebox-dgen Reference Manual, version 1.0.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:48:46 2018 GMT+0.
• Introduction: | What gamebox-dgen is all about | |
• Systems: | The systems documentation | |
• Files: | The files documentation | |
• Packages: | The packages documentation | |
• Definitions: | The symbols documentation | |
• Indexes: | Concepts, functions, variables and data types |
A procedural dungeon generation library.
This library can be used to generate a random dungeon for use in game development.
(ql:quickload :gamebox-dgen)
If you just want to generate the map data:
(box.dgen:make-stage)
If you want to preview the generated map, drawing it with unicode characters in your REPL:
(box.dgen:print-stage (box.dgen:make-stage))
The result will look something like this:
MAKE-STAGE
takes several optional arguments to influence the generator.
:SEED
specifies the random seed integer to use. This makes it possible to regenerate the same
dungeon at a later time. If this is not specified, it will be chosen randomly.
:WIDTH
specifies the width of the stage in cells.
:HEIGHT
specifies the height of the stage in cells.
:CORRIDOR-WINDINESS
specifies how windy corridors will be, as a range from 0.0 to 1.0. This has
minimal effect for densely packed rooms - see :ROOM-DENSITY
below to control this. Default value
is 0.0.
:ROOM-DENSITY
specifies how densely rooms should be packed in the stage, as a range from 0.1 (10%)
to 1.0 (100%). Note: This is only an estimation. Default value is 0.65.
:ROOM-SIZE-MIN
specifies the minimum size in cells the width or height of a room is allowed to be,
within the range 3 to 99. Note: This should be supplied as an odd integer value, else it will be
incremented by 1. Default value is 3.
:ROOM-SIZE-MAX
specifies the maximum size in cells the width or height of a room is allowed to be,
within the range ROOM-SIZE-MIN
to 99. Note: This should be supplied as an odd integer value, else
it will be incremented by 1. Default value is 11.
:DOOR-RATE
specified the percentage of junctions that should be doors, as a range from 0.0 to 1.0.
A junction is an intersection between a room and a corridor. Default value is 0.5.
All of the data you need to render a map is located in the GRID
slot of the returned stage data
object. This is an array of CELL
objects, each having the following slots:
X
: The X location in the map.
Y
: The Y location in the map.
CARVED
: Determines whether this cell is ground that can be walked upon.
REGION-ID
: An integer representing the region. A region is a group of adjacent cells. Each room's
cells are of the same REGION-ID
. Likewise, a corridor between two rooms (or more, in the case of
branching) is of the same REGION-ID
. You can think of a REGION-ID
as belonging to a set of cells
as if it was flood-filled, stopping at junctions (what this library calls doors or whatever your
game may define them as).
FEATURES
: A list of symbols identifying a special cell property, if any. Currently, this can be
one or more of the following:
:JUNCTION
: The cell joins 2 unique regions.:DOOR
: A junction has a chance of becoming a door.:STAIRS-UP
: The cell with an entrance staircase.:STAIRS-DOWN
: The cell with an exit staircase.:ROOM
: The cell is part of a room.:CORRIDOR
: The cell is part of a corridor.:WALL
: The cell is part of a wall.Copyright © 2015-2018 Michael Fiano.
Licensed under the MIT License.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The gamebox-dgen system: |
Michael Fiano <mail@michaelfiano.com>
Michael Fiano <mail@michaelfiano.com>
(:git "git@github.com:mfiano/gamebox-dgen.git")
MIT
A procedural dungeon generator.
# gamebox-dgen
A procedural dungeon generation library.

## Overview
This library can be used to generate a random dungeon for use in game development.
## Install
“‘ lisp
(ql:quickload :gamebox-dgen)
“‘
## Usage
If you just want to generate the map data:
“‘ lisp
(box.dgen:make-stage)
“‘
If you want to preview the generated map, drawing it with unicode characters in your REPL:
“‘ lisp
(box.dgen:print-stage (box.dgen:make-stage))
“‘
The result will look something like this:

‘MAKE-STAGE‘ takes several optional arguments to influence the generator.
‘:SEED‘ specifies the random seed integer to use. This makes it possible to regenerate the same
dungeon at a later time. If this is not specified, it will be chosen randomly.
‘:WIDTH‘ specifies the width of the stage in cells.
‘:HEIGHT‘ specifies the height of the stage in cells.
‘:CORRIDOR-WINDINESS‘ specifies how windy corridors will be, as a range from 0.0 to 1.0. This has
minimal effect for densely packed rooms - see ‘:ROOM-DENSITY‘ below to control this. Default value
is 0.0.
‘:ROOM-DENSITY‘ specifies how densely rooms should be packed in the stage, as a range from 0.1 (10%)
to 1.0 (100%). Note: This is only an estimation. Default value is 0.65.
‘:ROOM-SIZE-MIN‘ specifies the minimum size in cells the width or height of a room is allowed to be,
within the range 3 to 99. Note: This should be supplied as an odd integer value, else it will be
incremented by 1. Default value is 3.
‘:ROOM-SIZE-MAX‘ specifies the maximum size in cells the width or height of a room is allowed to be,
within the range ‘ROOM-SIZE-MIN‘ to 99. Note: This should be supplied as an odd integer value, else
it will be incremented by 1. Default value is 11.
‘:DOOR-RATE‘ specified the percentage of junctions that should be doors, as a range from 0.0 to 1.0.
A junction is an intersection between a room and a corridor. Default value is 0.5.
All of the data you need to render a map is located in the ‘GRID‘ slot of the returned stage data
object. This is an array of ‘CELL‘ objects, each having the following slots:
‘X‘: The X location in the map.
‘Y‘: The Y location in the map.
‘CARVED‘: Determines whether this cell is ground that can be walked upon.
‘REGION-ID‘: An integer representing the region. A region is a group of adjacent cells. Each room’s
cells are of the same ‘REGION-ID‘. Likewise, a corridor between two rooms (or more, in the case of
branching) is of the same ‘REGION-ID‘. You can think of a ‘REGION-ID‘ as belonging to a set of cells
as if it was flood-filled, stopping at junctions (what this library calls doors or whatever your
game may define them as).
‘FEATURES‘: A list of symbols identifying a special cell property, if any. Currently, this can be
one or more of the following:
* ‘:JUNCTION‘: The cell joins 2 unique regions.
* ‘:DOOR‘: A junction has a chance of becoming a door.
* ‘:STAIRS-UP‘: The cell with an entrance staircase.
* ‘:STAIRS-DOWN‘: The cell with an exit staircase.
* ‘:ROOM‘: The cell is part of a room.
* ‘:CORRIDOR‘: The cell is part of a corridor.
* ‘:WALL‘: The cell is part of a wall.
## License
Copyright © 2015-2018 [Michael Fiano](mailto:mail@michaelfiano.com).
Licensed under the MIT License.
1.0.0
gamebox-dgen.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files: |
Next: The gamebox-dgen/package<dot>lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/gamebox-dgen-20180430-git/gamebox-dgen.asd
gamebox-dgen (system)
Next: The gamebox-dgen/neighborhood<dot>lisp file, Previous: The gamebox-dgen<dot>asd file, Up: Lisp files [Contents][Index]
gamebox-dgen (system)
package.lisp
Next: The gamebox-dgen/region<dot>lisp file, Previous: The gamebox-dgen/package<dot>lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
gamebox-dgen (system)
neighborhood.lisp
Next: The gamebox-dgen/stage<dot>lisp file, Previous: The gamebox-dgen/neighborhood<dot>lisp file, Up: Lisp files [Contents][Index]
neighborhood.lisp (file)
gamebox-dgen (system)
region.lisp
Next: The gamebox-dgen/cell<dot>lisp file, Previous: The gamebox-dgen/region<dot>lisp file, Up: Lisp files [Contents][Index]
region.lisp (file)
gamebox-dgen (system)
stage.lisp
Next: The gamebox-dgen/graph<dot>lisp file, Previous: The gamebox-dgen/stage<dot>lisp file, Up: Lisp files [Contents][Index]
stage.lisp (file)
gamebox-dgen (system)
cell.lisp
Next: The gamebox-dgen/corridor<dot>lisp file, Previous: The gamebox-dgen/cell<dot>lisp file, Up: Lisp files [Contents][Index]
cell.lisp (file)
gamebox-dgen (system)
graph.lisp
Next: The gamebox-dgen/room<dot>lisp file, Previous: The gamebox-dgen/graph<dot>lisp file, Up: Lisp files [Contents][Index]
graph.lisp (file)
gamebox-dgen (system)
corridor.lisp
Next: The gamebox-dgen/junction<dot>lisp file, Previous: The gamebox-dgen/corridor<dot>lisp file, Up: Lisp files [Contents][Index]
corridor.lisp (file)
gamebox-dgen (system)
room.lisp
Next: The gamebox-dgen/stairs<dot>lisp file, Previous: The gamebox-dgen/room<dot>lisp file, Up: Lisp files [Contents][Index]
room.lisp (file)
gamebox-dgen (system)
junction.lisp
Previous: The gamebox-dgen/junction<dot>lisp file, Up: Lisp files [Contents][Index]
junction.lisp (file)
gamebox-dgen (system)
stairs.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The box.dgen package: |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions: | ||
• Internal definitions: |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions: | ||
• Exported generic functions: | ||
• Exported classes: |
Next: Exported generic functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Get a cell in STAGE using the coordinates X and Y.
cell.lisp (file)
(setf cell) (function)
Set a cell in STAGE to VALUE at the coordinates given by X and Y.
Get the cell index in STAGE, given the cell object, CELL.
Generate the stage.
Accepts several optional arguments to influence the generator:
:SEED specifies the random seed integer to use. This makes it possible to regenerate the same
dungeon at a later time. If this is not specified, it will be chosen randomly.
:WIDTH specifies the width of the stage in cells.
:HEIGHT specifies the height of the stage in cells.
:CORRIDOR-WINDINESS specifies how windy corridors will be, as a range from 0.0 to 1.0. This has
minimal effect for densely packed rooms - see :ROOM-DENSITY below to control this. Default value is
0.0.
:ROOM-DENSITY specifies how densely rooms should be packed in the stage, as a range from 0.1 (10%)
to 1.0 (100%). Note: This is only an estimation. Default value is 0.65.
:ROOM-SIZE-MIN specifies the minimum size in cells the width or height of a room is allowed to be,
within the range 3 to 99. Note: This should be supplied as an odd integer value, else it will be
incremented by 1. Default value is 3.
:ROOM-SIZE-MAX specifies the maximum size in cells the width or height of a room is allowed to be,
within the range ROOM-SIZE-MIN to 99. Note: This should be supplied as an odd integer value, else it
will be incremented by 1. Default value is 11.
:DOOR-RATE specified the percentage of junctions that should be doors, as a range from 0.0 to 1.0. A junction is an intersection between a room and a corridor. Default value is 0.5.
stage.lisp (file)
Print the generated stage using Unicode line drawing characters.
stage.lisp (file)
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
automatically generated reader method
stage.lisp (file)
automatically generated reader method
room.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
room.lisp (file)
automatically generated reader method
stage.lisp (file)
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
A cell represents a single unit in the stage grid which can contain various features.
cell.lisp (file)
standard-object (class)
:x
x (generic function)
:y
y (generic function)
carved (generic function)
(setf carved) (generic function)
region-id (generic function)
(setf region-id) (generic function)
(quote (:wall))
features (generic function)
(setf features) (generic function)
-1
distance (generic function)
(setf distance) (generic function)
A stage represents the generated grid of cells and the data used to render it.
stage.lisp (file)
standard-object (class)
:width
49
width (generic function)
:height
49
height (generic function)
grid (generic function)
(setf %generator) (generic function)
:seed
(genie:make-seed)
seed (generic function)
(make-hash-table)
regions (generic function)
(setf regions) (generic function)
(setf %graphs) (generic function)
:corridor-windiness
0
corridor-windiness (generic function)
(setf corridor-windiness) (generic function)
:room-size-min
3
room-size-min (generic function)
:room-size-max
11
room-size-max (generic function)
:room-density
0.65
room-density (generic function)
:door-rate
0.5
door-rate (generic function)
:hollow-walls
hollow-walls (generic function)
stage-rooms (generic function)
(setf stage-rooms) (generic function)
dead-ends (generic function)
(setf dead-ends) (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables: | ||
• Internal macros: | ||
• Internal functions: | ||
• Internal generic functions: | ||
• Internal structures: | ||
• Internal classes: |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
region.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
neighborhood.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
graph.lisp (file)
neighborhood.lisp (file)
region.lisp (file)
junction.lisp (file)
stage.lisp (file)
corridor.lisp (file)
corridor.lisp (file)
junction.lisp (file)
junction.lisp (file)
neighborhood.lisp (file)
region.lisp (file)
stairs.lisp (file)
corridor.lisp (file)
stairs.lisp (file)
neighborhood.lisp (file)
junction.lisp (file)
junction.lisp (file)
graph.lisp (file)
graph.lisp (file)
graph.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
graph.lisp (file)
neighborhood.lisp (file)
region.lisp (file)
corridor.lisp (file)
stairs.lisp (file)
neighborhood.lisp (file)
stage.lisp (file)
corridor.lisp (file)
corridor.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
corridor.lisp (file)
junction.lisp (file)
corridor.lisp (file)
graph.lisp (file)
graph.lisp (file)
region.lisp (file)
graph.lisp (file)
region.lisp (file)
graph.lisp (file)
stairs.lisp (file)
neighborhood.lisp (file)
graph.lisp (file)
stage.lisp (file)
junction.lisp (file)
graph.lisp (file)
neighborhood.lisp (file)
region.lisp (file)
stage.lisp (file)
stairs.lisp (file)
graph.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
corridor.lisp (file)
neighborhood.lisp (file)
region.lisp (file)
region.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
neighborhood.lisp (file)
stairs.lisp (file)
neighborhood.lisp (file)
corridor.lisp (file)
stage.lisp (file)
neighborhood.lisp (file)
Next: Internal structures, Previous: Internal functions, Up: Internal definitions [Contents][Index]
automatically generated reader method
stage.lisp (file)
automatically generated writer method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated writer method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated writer method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated writer method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
neighborhood.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated writer method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated reader method
stage.lisp (file)
automatically generated writer method
stage.lisp (file)
Next: Internal classes, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
neighborhood.lisp (file)
structure-object (structure)
0
extent-minimum (function)
(setf extent-minimum) (function)
1
extent-maximum (function)
(setf extent-maximum) (function)
graph.lisp (file)
structure-object (structure)
connectable (function)
(setf connectable) (function)
mst (function)
(setf mst) (function)
final (function)
(setf final) (function)
neighborhood.lisp (file)
structure-object (structure)
nh-stage (function)
(setf nh-stage) (function)
nh-x (function)
(setf nh-x) (function)
nh-y (function)
(setf nh-y) (function)
(box.dgen::make-extent)
nh-extent (function)
(setf nh-extent) (function)
(function box.dgen::nset-default)
nh-set-fn (function)
(setf nh-set-fn) (function)
(function box.dgen::nmap-default)
nh-map-fn (function)
(setf nh-map-fn) (function)
region.lisp (file)
structure-object (structure)
cells (function)
(setf cells) (function)
Previous: Internal structures, Up: Internal definitions [Contents][Index]
room.lisp (file)
standard-object (class)
:x1
x1 (generic function)
:x2
x2 (generic function)
:y1
y1 (generic function)
:y2
y2 (generic function)
:w
width (generic function)
:h
height (generic function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index: | ||
• Function index: | ||
• Variable index: | ||
• Data type index: |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F G L |
---|
Jump to: | F G L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
A B C D E F G H I L M N O P R S U V W X Y |
---|
Jump to: | %
(
A B C D E F G H I L M N O P R S U V W X Y |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | %
*
C E F I M S X Y |
---|
Jump to: | %
*
C E F I M S X Y |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | B C E G N P R S |
---|
Jump to: | B C E G N P R S |
---|