Random Dungeon Generator – Command List

This is the list of all supported Commands. Read from the top through the end and check for mandatory command.

Step 1: Base

In the first step we chose the most fundamental algorithm to generate the base.

$dungeonGenerator.prims()

or

$dungeonGenerator.randomWalk()

Step 2: Maze Settings

optional

  • borderWidth (w)
    w: Number not below 0

Prims Settings

When chosing Prims algorithm, you can use these commands (in any order). They are optional.

  • mergeDeadEnds (probability)
    probability (optional): float number 0 < x < 1.0
  • cutOffDeadEnds (iterations)
    iterations (optional): number not below 0

RandomWalk Settings

When choosing RandomWalk algorithm, you can use these commands (in any order). They are optional.

  • start (direction)
    direction: chose from “top”, “right”, “left”, “bottom”
  • exit (direction)
    direction: chose from “top”, “right”, “left”, “bottom”
  • allowGoingBack (boolean)
  • allowLargeAreas (boolean)
  • allowRevisit (boolean)

Step 3: Generate

Call this method, it’s mandatory.
generate()

Step 4: Place Entrance and Exit

  • placeEntranceOn (direction)
  • placeExitOn (direction)
    direction: chose from “top”, “right”, “left”, “bottom”, “any”

Step 5: Decorations

  • drawDecorations (regionIds)
    regionIds: optional, Array of Numbers
  • drawDecorationXTimes (regionId, min, max)
    regionId: required, Number
    min: optional, Number, default 1
    max: optional, Number, default min

Finalize

Call finalize() command, it’s mandatory.

Leave a comment