Irregular Shaped Rooms

From RogueBasin
Revision as of 22:07, 19 May 2008 by Supermeerkat (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Rectangular or any type of regularly shaped room in roguelike games has always bothered me, so instead of working I came up with a simple way to generate irregular, more "natural" looking caves, such as the ones featured below.

rooms2.JPG

How it works

The basic concept is simple enough: enclose an area in 4 rectangles, randomly choose at least 1 point in each of the rectangles, join each of those points together using a Bresenham's Line algorhithm, and then fill in the enclosed area, as illustrated below.

rooms1.JPG