pub struct GenerateDungeonParams {Show 34 fields
pub dimensions: (u32, u32),
pub tiles_per_cell: u32,
pub num_floors: u32,
pub min_rooms_per_floor: u32,
pub max_rooms_per_floor: u32,
pub min_room_dimensions: (u32, u32),
pub max_room_dimensions: (u32, u32),
pub adjacent_rooms_allowed: bool,
pub min_corridor_dimensions: (u32, u32),
pub max_corridor_dimensions: (u32, u32),
pub wall_dimensions: (u32, u32),
pub wall_offset: (i32, i32),
pub min_shared_cells: (usize, usize),
pub squareness: f32,
pub min_stairs_per_floor: u32,
pub max_stairs_per_floor: u32,
pub min_teleporters_per_floor: u32,
pub max_teleporters_per_floor: u32,
pub min_items_per_room: u32,
pub max_items_per_room: u32,
pub max_item_rarity: u32,
pub item_density_scale: f32,
pub item_rarity_scale: f32,
pub min_enemies_per_room: u32,
pub max_enemies_per_room: u32,
pub max_enemy_difficulty: u32,
pub enemy_density_scale: f32,
pub enemy_difficulty_scale: f32,
pub min_traps_per_room: u32,
pub max_traps_per_room: u32,
pub max_trap_difficulty: u32,
pub trap_density_scale: f32,
pub trap_difficulty_scale: f32,
pub difficulty_ratio: f32,
}Expand description
The parameters used to generate a dungeon.
Values can be in units of cells or tiles. Dungeon is first generated on a smaller grid of cells, which are then translated to a larger number of tiles. This is what gives the dungeon its rectangular structure.
Fields§
§dimensions: (u32, u32)Width and height of dungeon in terms of cells.
tiles_per_cell: u32Number of tiles to translate cells to when outputting the final dungeon.
num_floors: u32Number of floors in the dungeon.
min_rooms_per_floor: u32Minimum number of main rooms per floor. These rooms are connected by corridors.
max_rooms_per_floor: u32Maximum number of main rooms per floor. These rooms are connected by corridors.
min_room_dimensions: (u32, u32)Minimum dimensions in cells for main rooms.
max_room_dimensions: (u32, u32)Maximum dimensions in cells for main rooms.
adjacent_rooms_allowed: boolWhether or not main rooms can connect directly with each other. If false, connections require a corridor in between.
min_corridor_dimensions: (u32, u32)Minimum dimensions in cells for corridors.
max_corridor_dimensions: (u32, u32)Maximum dimensions in cells for corridors.
wall_dimensions: (u32, u32)Dimensions in tiles for walls.
wall_offset: (i32, i32)Offset in tiles for walls.
The minimum amount of shared cells required on the x and y axes for a room to be considered a neighbor.
squareness: f32This value decreases the likelihood of a corridor having one side much longer than the other.
min_stairs_per_floor: u32Minimum downward stairs per floor. Number of upward stairs will always be equal to the number of downward stairs in the previous floor.
max_stairs_per_floor: u32Maximum downward stairs per floor. Number of upward stairs will always be equal to the number of downward stairs in the previous floor.
min_teleporters_per_floor: u32Minimum pairs of teleporters per floor.
max_teleporters_per_floor: u32Maximum pairs of teleporters per floor.
min_items_per_room: u32Minimum number of items per main room or corridor.
max_items_per_room: u32Maximum number of items per main room or corridor.
max_item_rarity: u32Maximum value for item rarity score. Minimum will always be one. Items tend to be rarer in farther rooms or floors.
item_density_scale: f32Scale to be used for the item density noise map.
item_rarity_scale: f32Scale to be used for the item rarity noise map.
min_enemies_per_room: u32Minimum number of enemies per main room or corridor.
max_enemies_per_room: u32Maximum number of items per main room or corridor.
max_enemy_difficulty: u32Maximum value for enemy difficulty score. Minimum will always be one. Enemies tend to be more difficult in farther rooms or floors.
enemy_density_scale: f32Scale to be used for the enemy density noise map.
enemy_difficulty_scale: f32Scale to be used for the enemy difficulty noise map.
min_traps_per_room: u32Minimum number of traps per main room or corridor.
max_traps_per_room: u32Maximum number of enemies per main room or corridor.
max_trap_difficulty: u32Maximum value for trap difficulty score. Minimum will always be one. Traps tend to be more difficult in farther rooms or floors.
trap_density_scale: f32Scale to be used for the trap density noise map.
trap_difficulty_scale: f32Scale to be used for the trap difficulty noise map.
difficulty_ratio: f32The difficulty of the farthest room vs the difficulty of the starting room.
Trait Implementations§
Source§impl Clone for GenerateDungeonParams
impl Clone for GenerateDungeonParams
Source§fn clone(&self) -> GenerateDungeonParams
fn clone(&self) -> GenerateDungeonParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenerateDungeonParams
impl Debug for GenerateDungeonParams
Source§impl Default for GenerateDungeonParams
impl Default for GenerateDungeonParams
Source§impl<'de> Deserialize<'de> for GenerateDungeonParams
impl<'de> Deserialize<'de> for GenerateDungeonParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for GenerateDungeonParams
impl PartialEq for GenerateDungeonParams
Source§impl Serialize for GenerateDungeonParams
impl Serialize for GenerateDungeonParams
impl Copy for GenerateDungeonParams
impl StructuralPartialEq for GenerateDungeonParams
Auto Trait Implementations§
impl Freeze for GenerateDungeonParams
impl RefUnwindSafe for GenerateDungeonParams
impl Send for GenerateDungeonParams
impl Sync for GenerateDungeonParams
impl Unpin for GenerateDungeonParams
impl UnwindSafe for GenerateDungeonParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().