Customizing the Dungeon - BriannaLadson/TerraForge GitHub Wiki
Customizing the Dungeon
There are several options you can pass into DungeonForge in order to generate a dungeon map that's to your liking.
Seed
The seed is a value that initializes the random number generator. If you use the same seed, you'll get the same dungeon layout every time (as long as you keep the other settings the same). Valid values include any integer or string. Its default value is None.
generator = DungeonForge(
seed = 10,
)
Below are dungeon maps with different seeds.
Level Size
The level_size determines the width and height of the dungeon. Valid values are positive integers. Its default value is 25.
generator = DungeonForge(
level_size = 15,
)
Below are dungeon maps with different level sizes.
Room Size
The room_size sets the minimum/maximum width and height for the rooms. A valid value is a tuple with two positive integers (minimum, maximum). Its default value is (3, 6).
generator = DungeonForge(
room_size = (10, 30),
)
Below are dungeon maps with different room sizes.
Maximum Number of Rooms
The max_rooms sets the maximum number of rooms that will be generated on a level. Valid values are positive integers. Its default value is 10.
generator = DungeonForge(
max_rooms = 6,
)
Below are dungeon maps with different max_rooms values.
Maximum Number of Failure
The max_failure sets the number of room placements failures that are allowed to happen on a level before stopping. Valid values are positive integers. Its default value is 10.
generator = DungeonForge(
max_failure = 8,
)
Number of Levels
The z_levels sets the number of levels to generate for the dungeon. Valid values are positive integers. Its default value is 3.
generator = DungeonForge(
z_levels = 5,
)
Below is a short clip of the dungeon_demo.py, which allows you to move between the dungeon levels.