From 515fa65e6105bb56b910bf736cccc1b3beabc90e Mon Sep 17 00:00:00 2001 From: Alex Bethel Date: Sun, 19 Dec 2021 11:50:16 -0600 Subject: [PATCH] Room generation strategy description --- src/rooms.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/rooms.rs b/src/rooms.rs index b1b805c..3f6c955 100644 --- a/src/rooms.rs +++ b/src/rooms.rs @@ -1,5 +1,17 @@ //! Generator for levels that consist of a number of rooms connected //! by hallways. +//! +//! The basic strategy here is that we start off by making some number +//! of attempts to place rectangular rooms of random sizes and +//! positions within the region; of these attempts, we only keep those +//! that are spread some distance away from other existing rooms. We +//! then use a pathfinding algorithm to navigate from one room to all +//! the others, leaving hallways and doors as we travel. The +//! pathfinding algorithm is weighted to try and travel through +//! existing rooms and hallways rather than cutting new hallways +//! through the stone to encourage rooms to connect to other rooms +//! near them, and it has some randomness added to its weights to +//! discourage long, linear hallways. use std::ops::Range;