Level Generation Algorithms

Name dcss:brainstorm:branch: layouts
Summary Ideas for new branch level generators and changes to existing level generation.
Further information See also Layout Types, Dungeon Building Functions
Added by greensnark
Added on 2010-01-09 13:49

This was originally a list of proposed changes to level-generation from ##crawl-dev discussion around the beginning of 2010. It has since been updated based on a summer 2013 Mantis discussion: https://crawl.develz.org/mantis/view.php?id=7003

If you have an idea for a layout:

  • Add a description on this page. If you know which branch it goes on, add it there. If it should appear on more than one branch, add it under any of them with a note. Otherwise, add it under Orphan Layouts.
  • Make an encompass vault (or fair-sized other vault) as an example. Ideally, add some comments at the top explaining what you are trying to do. Someone may see it, think it would make a great layout, and turn it into one.
  • Program it in LUA (possibly with C++ helper functions) and submit it on Mantis as a patch.

If your idea is long and complicated and/or not directly related to layouts, please add it to the page for the appropriate branch instead.

Overall

Layout depths and weights ideally should be specified for each branch they appear on. The old style of absolute depths with forbidden branches (e.g. DEPTH:10-, !Lair) is very confusing to read. Explicit weights (even if they are 10) are a lower priority, but should be included in new layouts.

Each branch should (eventually) have a distinct style. The exception is D, which should have a lot of variation. Not all styles are worked out yet.

Convergence

Ideally, branches should change somewhat with depth. dpeg calls this convergence. However, there should still be a lot of randomness. We don't want strict cutoffs with depth. having weights that scale over depth would be an elegant way to accomplish this. A possible syntax would be:

WEIGHT: 10-100 (Dis:1-5)

which could be shortened to

WEIGHT: 10-100 (Dis)

as shorthand for the whole branch. The first format is more powerful, but the second will automatically update if/when a branch depth changes.

We could also have a way to give the weight a normal distribution across the depth range, i.e. weight 10 at the top and bottom and 100 at the peak. I don't know how useful this is or how noticeable it'll actually be in-game though. The downside is that you need at least 2 values (mean and standard deviation, probably also asymptotic minimum) to specify this. That would make the syntax significantly more complex.

Monster Placement

What is intricate architecture without interesting monster placement ? This is an unexplored area. To my knowledge, Crawl has only a few ways of dealing with that:

  • regular squares, which might contain monsters, equal chance for each square means open spaces and big rooms are favored
  • vaults, which either have monsters in specific squares or a chance of having specific monster in a specific square
  • features like stairs, statues might be generated as mimics or magical statues
  • aquatic/lava creatures are generated in the corresponding liquid
  • monster packs are spawned together

Ideas and examples:

  • amphibians and creatures with affinity for water should be more likely to be generated near water. This includes all kinds of water, generated by the main algorithm, generated by vaults (unless they have some explicit NOMONSTER flags). If Lugonu's Corruption or a dying Sky Beast produces water, subsequently spawned aquatic creatures would be more likely to generate near it.
  • firedrakes, lindwurms should be more likely to spawn near lava, and not just because the vault designer placed them there.
  • centaurs and other ranged creatures more likely to spawn in the open, (or in areas where they can see incoming player from a distance)
  • spiders, insects more likely to be placed near walls
  • smart melee monsters could favor twisted corridors and passages
  • some creatures could “like” one another, such as golem likely to spawn near to a wizard if there's already a wizard on the level.

Another idea is to have squares which are more likely to have monsters generated on them. They would be especially useful in vaults, some of which are of interesting shape but almost always empty. In the picture below, “2” means “twice as likely to generate a monster”, “3” - “thrice as likely to spawn a monster…” — b0rsuk 2013-05-23 08:53

Digits are already is use for monster placement. We could use symbols like : if this is implemented — infiniplex 2014-02-18 23:10

          ####                                                
          #22#                                                
          #..#            #####                                               
          #..#            #...#
          #..#            #...#
          #..#           ##...##
          #..#          ##.....##
          #..#         ##.......##
          #..#        ##.........##
      #####..##########...........#################
      #.4.........................................#
      #.2...................<.....................#
      #.4.........................................#
      #####..##########...........#################
   ########..###6#..####.........##
   #2..........+.+..+5.##.......##
######+####..#####..######.....##
#5.+......#..#33.+..+333.##...##
########+##..##############...###################
   #........................................333.#
   ########..###+###+######...###################
          #..#.222.#...33.#...#
          #..###+###.3333.#...#
          #..#.4...+..33..#...#
          #..##+######+####...#
          ####......+..66.#...#
             ##################

Dungeon

Any layout that doesn't stylistically fit elsewhere goes here.

This section also currently covers the possible Depths branch.

Dungeon should possibly have fewer levels with rectangular borders.

What does this mean? — infiniplex 2014-02-18 23:03
I think this is supposed to mean that the very outer rim of a level should not (always) be a pure rectangle. As far as I can see, this is for flavour, but I actually second it. — dpeg 2014-05-17 09:35

I think lava should not appear in the shallower part of D (or in D at all if Depths is added). This is primarily an issue with vaults, but it does show up in some layouts (e.g. layout_cross and layout_gridlike). I like the sense of discovery when, part way through the game, you suddenly realize “Hey, there's lava in this game!” — infiniplex 2014-02-18 23:03

Convergence:

  • Layouts get slightly smaller with depth
  • Corridors get wider. At the bottom of D, corridors could be as wide as 3 cells. Wide corridors have also been proposed for Zot.
  • Layouts get more open with depth. Narrow corridors are especially good in the early game when survivability is much more precarious. Some openness (even increase quite a bit with depth) is fine, but narrow-passage play styles need to stay viable it the late game.
  • Layouts get change from simpler at shallow levels to more complex one later. This makes a nice reward for the player as they progress deeper and see new interesting layouts. The simple/complex distinction isn't very clear (but it's not the same as open/closed). To this end, what I'm (mumra) looking at now is keeping a lot of the standard layouts in early D (basic/rooms/loops etc. but also e.g. donut/cross/etc.), and moving to more cave-like and intricate mazelike stuff in later D.

I feel like dungeon levels should have the chance to spawn using any layout generator, although branch-specific layouts should probably be quite rare so as to not diminish the uniqueness of the branches. After all, you spend a lot of time in the dungeon, and more variety is always appreciated. Would also fulfill the dungeon's pseudo-role as the hub of the game. Making deeper levels have wider corridors in general sounds excellent. — Wensleydale 2011-06-15 20:39

Now that we have Depths as a separate branch, it should probably take the place of late D in this reasoning. I would propose that D gets the width-1 corridors and the “simple” layouts, while Depths gets the wider corridors and the “complex” layouts. Increasing openness with depth applies in both. — infiniplex 2014-05-16 23:15

Underground

Crawl has come to the point where I don't raise an eyebrow when I see plants or butterflies in Dungeon. And they are not even moths.

I don't know how to call it, it's some kind of design/feature creep. First butterflies for Lair, Plants for Lair and Swamp. Then Ecumenical Temple. Then entry vaults for Lair, Hive. Shoals is not helping by making surface flora and fauna, and surface weather effects a common sight. Dungeon:1 entrance. Now, we have whole levels full of plants not just in Elven Halls, but also in the Dungeon.

Is Dungeon supposed to be underground ? Has the design changed while I looked the other way ? Is it just meant to be a random collection of rooms ? I propose to keep things in check:

  • Plants and butterflies are okay in Lair, Swamp, and Hive these areas have a natural theme.
  • Plants and butterflies are okay in immediate vicinity of Fedhas altar. He's the plant god.
  • Plants are okay in Lair/Hive entry vaults.
  • Plants are okay on D:1 - it's close to surface, there can be holes in the roof.
  • Butterflies are okay very close to altars. In particular, they shouldn't have freedom of movement because they tend to fly all over the level.
  • Plants are okay in Elven Halls, because the place is full of magic. But the algorithm should be different, unless deep elves value sacred groves they should just plant gardens, even shrubbery mazes. Elves bend reality to their will. Fungi used to be the only plant in Elven Halls - almost as if the designer knew the game takes place underground.
  • Take a page from ADOM - if there's something unusual going on, like a cave filled with sun, print a flavor message describing it and admitting it is unusual. Having to press space several times after entering a new branch or a portal vault is a small price to pay for consistent atmosphere.
  • If you insist in having harmless insects in a dungeon, make them moths. Even Zot doesn't have butterflies of wrath, it has moths of wrath.
  • Places like Shoals could be assumed to be outside. You find a route leading to the surface.

Everything else should in my opinion be removed. No forests around altars of good gods. No forests in Ecumenical Temple except close to the altar of Fedhas. — b0rsuk 2011-07-02 22:36

Lair

The ruined level builder was implemented in 0.6 (ca5fe3a). It is a modification to the existing room+corridor layout which removes walls randomly to simulate weathered building ruins, rather than neatly maintained rooms. Plants and fungi grow out of cracks (gaps) in the walls.

I really like the new look of Lair, spotty levels and HUGE wide open caverns never did it for me. The 'ruined city' layout is great. — porkchop 2010-01-13 00:13

See also Lair.

Snake Pit

The Snake Pit's rectangular rooms+corridors could be replaced with more organic rounded (semi-irregular) rooms and corridors that have smooth curves.

There is a fundamental problem here: A layout that looked like a snake pit would have rounded, twisty passages. However, such a layout would be inconvenient to navigate and lead to boring combat. As of the time of writing (2014-02-18), there is no good solution to this.

This could be something of a mix between natural-looking and architected structures. e.g. some twisty passages with small bubble-shaped rooms attached to them. Maybe things could start very natural and get more man-made towards the branch bottom. Rooms could be bubble-shaped, meaning imperfect circles, like smoothed caves.

There can be doors (the nagas build them), but they should mostly be near the bottom. This could be due to layouts with doors becoming more frequent with depth, or with individual layouts generating more doors.

See also Snake Pit.

Crypt

dpeg proposed restricted LOS (for monsters and player). This is not related to layout but should be considered at the same time.

See also Crypt.

Old Idea

From 2010-01-09.

Crypt should feel a lot more closed in and vaguely maze-like, but should avoid corridors because most Crypt inhabitants don't have ranged attacks. A layout where the level is entirely (or almost entirely) composed of small rooms (see http://doom.chaosforge.org/images/5.png for instance) would be good, and would help create a more oppressed feeling.

Sample Crypt Layout (Eronarn)

          ####                                                
          #..#                                                
          #..#            #####                                               
          #..#            #...#
          #..#            #...#
          #..#           ##...##
          #..#          ##.....##
          #..#         ##.w...w.##
          #..#        ##.ww...ww.##
      #####..##########.www...www.#################
      #...........................................#
      #.....................<.....................#
      #...........................................#
      #####..##########.www...www.#################
   ########..###.#..####.ww...ww.##
   #...........+.+..+..##.w...w.##
######+####..#####..######.....##
#..+......#..#...+..+....##...##
########+##..##############...###################
   #............................................#
   ########..###+###+######...###################
          #..#.....#......#...#
          #..###+###......#...#
          #..#.....+......#...#
          #..##+######+####...#
          ####......+.....#...#
             ##################

         |
/-\      |     /-\
|A|------|-----|B|---
\-/  .   |     \-/
     .   |      |
      . /-\     |
    ----|C|---  |
        \-/ .   |
         |   . .|
         |   .. |
         |      |
        /-\    /-\
      --|D|----|E|------
        \-/    \-/
         |
         |

Mumra's Idea

From 2013-05-05.

A network of corridors with lots of small rooms coming off them, like some V layouts but a bit more chaotic (which works because it's a branch off V).

There is an idea floating around something like putting coffins/sarcophagi in the rooms and have undead appear when you grab the loot (maybe this could just be Lua). It wants to feel like an old abandoned network of tunnels and crypts where ancient stuff is buried…

Swamp

In 0.6, Swamp was layout was changed from the noisy mix of rock and water into much neater combination of trees and water masses.

Another idea of convergence in Swamp: increase the muddiness from little (Swamp:1) to very much (Swamp:5). This should also help with the navigation, regardless of what else we do for Swamp. I fully support the trees idea, too. — dpeg 2010-01-09 23:11

Something else to consider for Swamp would be to put all the upstairs on one side of the level, and all the downstairs on the other side, to make it feel more like the player is traveling from one side of the swamp to the other. — ogaz 2010-01-11 03:17

See also Swamp.

Spider

Spider layouts are very irregular looking. They have passages a few tiles wide and may have some water in places.

See also Spider's Nest.

Vaults

See The Vaults.

Shoals

Good as is for right now, had a lot of good work go into that for 0.6.

See also Shoals.

Orcish Mines

Probably fine, spotty levels do look pretty mine-like. Might benefit from a slightly expanded monster set. Convergence could be gold becoming more common on later levels.

See also Orcish Mines.

Diamond Mine

This layout is now in Trunk as of 0.15-a0-2190-g04414b5 from Mantis issue 8699.

Another possible layout would be to make rooms composed of multiple diamond-shapes, each with a pillar in its center. This would be a less-ordered-looking version of a room and pillar mine. The pillars in a room would would be placed on a grid. It would probably be easiest to use that grid for all pillars, in case rooms overlapped.

xxxxxxxxxxxxxxxxxxxxxxx
xxxxxxx:xxxxxxx:xxxxxxx
xxxxxx:::xxxxx:::xxxxxx
xxxxx::.::xxx::.::xxxxx
xxxx::.-.::x::.-.::xxxx
xxx::.---.:::.---.::xxx
xx::.--c--.:.--c--.::xx
x::.--ccc--.--ccc--.::x
xx::.--c--.:.--c--.::xx
xxx::.---.:::.---.::xxx
xxxx::.-.::x::.-.::xxxx
xxxxx::.::xxx::.::xxxxx
xxxxxx:::xxxxx:::xxxxxx
xxxxxxx:xxxxxxx:xxxxxxx
xxxxxxxxxxxxxxxxxxxxxxx

The pattern of glyphs around the pillars is standardized, with glyphs only overwriting those of a lower precedence (highest to lowest: 'c's, '-'s, '.'s, ':'s, and 'x's). The 'x's are the background fill and not placed with the pillars. It is essential that there is a complete ring of '.'s around each pillar or the map may later be disconnected.

A method is needed here to connect the different rooms formed by the pillars. Each connection needs a path of '.'s between the rings of '.'s around the pillars it is connecting. Idealy, these would be padded with a row or two of ':'s.

After all pillars have been placed, replace the 'c's with 'x's and the '-'s with ':'s. Then use smear_map to bleed the walls ('x's) onto the non-essential floor ares (':'s). After that, replace the remaining ':'s with '.'s.

It will probably be necessary to use zonify.map_fill_zones(_G, 1, 'x') to fill the unreachable holes left be smear_map. A more sophisticated algorithm would also fill all cells accessible only by only a single, diagonal direction. An even more sophiticated algorithm would fill all non-path cells connected only be a diagonal.

A sample of what this might look like (using SUBST: :=x.. instead of smear_map) would be:

xxxxxxxxxxxxxxxxxxxxxxx
xxxxxxx.xxxxxxxxxxxxxxx
xxxxxx.x.xxxxxxxxxxxxxx
xxxxxxx.x.xxx...xxxxxxx
xxxxx......x......xxxxx
xxx.........x.......xxx
xx.....x.x.x...x...x.xx
x...x.xxx.x..xxxx....xx
xxxx...x...x..xx...x.xx
xxx.x......x...xx...xxx
xxxxxx....xx.x.x.xxxxxx
xxxxxxx.x.xxxx....xxxxx
xxxxxx.xxxxxxx...xxxxxx
xxxxxxx.xxxxxxx.xxxxxxx
xxxxxxxxxxxxxxxxxxxxxxx

Elven Halls

These should look meticulously built with interconnected corridors and strongly geometrical rooms. The deep elves are an arrogant race and are very careful and elegant about their architecture.

See also Elven Halls.

Distinguishing Features

This is a list of ideas, not requirements.

Stained glass windows:

  • These are glass walls between adjacent rooms, corridors, etc. with different tiles.
  • These would be a general feature of the Elf branch, not just set by the layout.
  • In practice, layouts often need to be designed to have these or the walls between rooms will be too thick. Sadly.

Unusual rooms shapes:

  • Squares/rectangles - these are normal, but included for completeness
  • Diamonds - a rotated square or rectangle
  • Octagons
  • Triangles
  • Hexagons
  • Crosses
  • Circles/ellipses - these can be hard to connect and are not easily recognizable of small, so I (infiniplex) don't think they are a good idea here.

Fancy Rooms

Rooms could contain:

  • Fountains
  • Statues - Deep elves are xenophobic, this might present a cultural problem.
  • Trees
  • Plant-type decoration. Note that non-tree plants (e.g. bush, plant, fungus monsters) need KMASK vault applied to them to prevent them being overwritten by vaults and thus generating placement error. They still prevent vaults from placing on top[ of them, so these should be used sparingly.

We want to avoid overlap with Vaults here. Some possibilities:

  • Elf rooms are less fancy, with e.g. a single statue or fountain
  • Most Elf rooms are plain, but a few are fancy

Note that rooms with too many features can seem boring and over-the-top relatively quickly. This was a problem with my (infiniplex's) newvaults layout.

Slime

Could probably use some more variation.

Many wide passages and open rooms are very important so that players without dig can survive the acidic walls.

See also Slime Pits.

Tomb

Probably fine as is, but could potentially have some fun with lua, for more interesting traps or such (no specific ideas). Could also be turned into a portal vault.

  • Tomb could use an alternate layout or two
  • I would love to see interesting Lua traps; boulder runs, snake pits, crushing walls, sections opening and closing to change your route, basically stuff that make this feel like an Indiana Jones temple.

See also Tomb.

Blade

Probably fine as is, but could possibly be made into a portal vault.

See also Hall of Blades.

Hells (General)

Hells are decent, but I feel like they could be improved… I don't have many specific ideas here though. I like Dis best (it feels like wandering through some abandoned hellish city, which is cool, and also doesn't have corridors). Tar is pretty cool, although might be better if the ratio of rooms to corridors was smaller. Gehenna and Cocytus are both boring layouts with lava/water added, something more interesting could certainly be done here.

ogaz's idea above in the Swamp portion is great for the Hells as well: keep the staircases away from each other as much as possible, so the player has to traverse the hells in order to reach the bottom. Some of the levels could afford to be more labyrinthine. — evktalo 2010-03-04 20:30

Deliberately placing the stairs apart from each other is spoilery and thus bad. If the player has controlled teleport, he can use it to teleport to the other side of the map directly. Otherwise, a random teleport will still decrease the average time to finding a stairs. Unfortunately. — infiniplex 2014-09-30 00:51

A good and cheap improvement would be to add large vaults, too. — kilobyte 2010-03-05 00:30

See also Hells.

Vestibule of Hell

See also Vestibule.

Dis

Dis layouts are very open. They come in 2 main types:

  1. A large open areas with rooms in it. For example, layout_chaotic_city.
  2. Rooms connected directly to each other. For example, layout_dis.

Dis layouts should few hallways (ideally none), and doors separating rooms instead of holes in the wall. There should be as few choke-points as possible.

Convergence:

  • Deeper layouts are more orderly
  • Deeper layouts have larger rooms

The thematic idea of Dis layouts is a demon-built city. The buildings can be simple or elaborate, but should all appear artificial.

Exactly why Dis is not more full of demons than the other hells is unclear. It is possible that the city was abandoned. Alternatively, the demons may have never actually intended to use Dis as a city. They may have built it for some inscrutable reason of their own.

In my mind, Dis should becomes more orderly with depth. The end vaults have rooms arranged in patterns, and the rooms have complex shapes designed with a certain style to give specific effects. This fits with my idea (from C.S. Lewis?) of Hell as a place that is “lesser” than Earth. As you descend into Dis, there is less randomness, less individuality, less freedom. At the bottom, there is Dispater, who enforces his iron will on all around him. This is a place where mortals do not belong (see e.g. Hell effect messages and Matthew 25:41). — infiniplex 2013-05-10 23:30

See also Dis.

Gehenna

Gehenna layouts are natural caves that the demons have built in. Ideally, these buildings would stick part way into the walls of the caves, but buildings in the open are also OK. And, of course, there is lots of lava.

There should usually be a path to a down stairs somewhere without crossing lava, but this is not required. Players who reach Gehenna can be assumed to have access to flight.

The caves (minus the buildings) should be quite open, but not completely so. The player should normally be able to stand in the middle and see two distinct walls. Ideally, the only choke-points are those provided by buildings.

There could be areas separated by a river (or rivers?) of lava (Phlegeston). As long as there is at least one up stairs and down stairs (including portals) in each area, this will not be a connectivity problem. Originally suggested by kilobyte

Convergence:

  • Deeper layouts have more lava
  • Deeper layouts are more open
  • Deeper layouts have larger, fancier buildings

See also Gehenna.

Cocytus

Cocytus layouts should be natural-looking and irregular. They should have few, if any, narrow hallways or wide open areas. The ideal resembles the maps in the Ice Cave portal vault.

Convergence:

  • Deeper maps have more water
  • Deeper maps have wider passages

These layouts may have to be adapted if slippery ice ever gets added.

See also Cocytus.

Tartarus

Tartarus is “a decaying netherworld” (by the branch description) and where the most wicked were imprisoned (in Greek myths). It should be somewhere between a prison and a decaying city.

At the top, Tartarus should have narrow passages and small rooms. Ideally, they would look artificial, but have no sensible organization to them. At deeper depths, the walls should “decay” away, leaving more open maps. Buildings should appear partially decayed and seem somehow warped if possible.

Tartarus layouts should draw on these themes:

  • ruin and decay
  • imprisonment, especially as long ago
  • Giger-esque twisted-ness

Convergence:

  • Shallower maps have more passages
  • Deeper maps have wider passages
  • Deeper maps have larger rooms
  • Deeper maps have more open areas
  • Deeper maps have more buildings

See also Tartarus.

Tartarus does not have a distinctive layout style yet.

Fortification

Possibly all Tartarus layouts should have “fortified” walls with jagged edges. There would be 2 ways to do this:

  • Add the fortifications on the outside of the walls. This would require all passages to be at least 3 cells wide beforehand to avoid them becoming disconnected.
  • Cut the fortifications into the walls. This would require all walls to be at least 3 cells wide beforehand to avoid getting holes cut into them.

The basic algorithm to add them outside the walls would be:

  1. Example each floor cell
  2. Check if it has walls in either horizontal direction (left or right) and either vertical direction (up or down). Just one of the two is enough in either case.
    • If there is both a horizontal and a vertical wall and the three corners bordering them (inside corner), add a fortification wall
    • If there is neither (open floor), do not add a fortification wall
    • If there is a horizontal wall but not a vertical one, add a fortification wall if y % 2 == 0.
    • If there is a vertical wall but not a horizontal one, add a fortification wall if x % 2 == 0.

An example fortified room might look as follows:

xxxxxxxxxxxxxx
xcc.c.c.c.c.cx
xc..........cx
x.......c....x
xc....cxxxc.cx
x......xxx...x
xcc...cxxxc.cx
xxxx....c....x
   xc.......cx
   xc.c.c.c.cx
   xxxxxxxxxxx

Where the 'c's signify walls added by fortification.

It is going to have to be a lot more complicated than this. This algorithm only works for axis-aligned rooms where there are no doors. At present it can seal off doors. On non-straight walls, it is not clear how which added walls are even wanted. — infiniplex 2014-10-03 14:36

Advantages:

  • This is a new twist on the narrow corridors vs. open areas map dichotomy. That is to be encouraged, as it changes which playstyles are viable.

Disadvantages:

  • Requires 3-wide corridors in the original map (or 3-wide walls)
  • Does not look so good on non-straight walls.

Pandemonium

Pan is okay as is (the pan lord vaults are pretty much all pretty good, and help give pretty much every level decent flavor). The levels could possibly be smaller overall, to make the pan lord vaults more prominent though.

It just needs to be weird. Lots of variety would be good, although you don't have to spend so long there now the portals have been made a bit more reasonable, and there are also lots of big encompass vaults to mix things up.

One possibility is lots of things involving very geometrical shapes all linked up in strange ways. The current (2014-02-18) Pan entry/traverse/exit tiles are geoemtric, and there are many geometric vaults. This could be similar to Elf, or the pan layouts could be more “city-ish” while the Elf layouts were more “passage-y”.

Pan could also use a few more encompass vaults, such as:

  • An Abyss-y map, where part of the layout has been taken over by the Abyss. One option is to player start in what appears to be a normal-ish Pan map, but then have the Abyss around the edges as if it is devouring Pan. A really-sophisticated variation could actually have the Pan area shrink with time. Another option is to have the Abyss just breaking in. There would be a small area that was fully Abyss, and an corrupted area around it where the map blended into Pan. The corrupted area would have a lot of demons (few '1's) trying to contain the Abyss, while the Abyss area would have Abyssal monsters. Thematically, the demons should be neutral (they have something more important to worry about than mortal intruders), but I doubt that would work well in practice.
  • An example of what a good Pan mash-up (see below) would look like.
  • A concept/test map for Oblivion. I don't know if it would be possible to implement the vacuum effects with LUA, or if this would need significant C++ coding. To be fair to conjurers, we would need a “down” stairs immediately by the entrance(s).

See Pandemonium for gameplay proposals (i.e. not just layout).

Mash-Ups

Pan could sometimes have two distinct layouts combined in some fashion, as though different dimensions are colliding and twisting together.

This shouldn't be everywhere but it could be amusing if occasionally the player got the sense that it's a place where dimensions are twisted together and folding in on each other. We don't have to see it happen to get that impression, and after all you're only on a given level for a relatively short time.

It's not worth getting too caught up in the laws of physics in a place of madness inhabited by demons. So a dimensional collision happened at some point but isn't happening right now, what's the problem with that? The important thing is if a) the layout makes good gameplay and b) has an interesting visual aspect. Explaining it afterwards is the easy part.

This could probably be done as:

  1. Fill the map with all 'A's. Use a subvault with the ”layout” tag to generate the first map.
  2. Use LUA to record everything into a big 2D array
  3. Erase the map, replacing it with 'A's again.
  4. Generate and store the second map.
  5. Use LUA to divide the map into 2 parts, possibly with some border. This could be a simple line or circle, but ideally would be something fancier.
  6. Fill one area with the corresponding portion of the first map and the other are with the second map.
  7. Fill in the disconnected areas with walls. Note that we can get disconnected areas combining maps even if both maps were originally connected.

Notes from gammafunk on IRC on 2014-09-01:

  • Some kind of nice transition from one layout to another (i.e. not an ugly layout division “line” between the two) might work well in some instances but I guess it'd help to seem some examples. It probably wouldn't work well for most.
  • It's a question of finding the right layouts to string together and a way to string them together.
  • If you could more connect them logically in a simple way that isn't a line, it'd work better.

I (infiniplex) will probably leave this until someone makes an example encompass vault. Currently there is only holy_pan which is a kind of organic “adventure” style vault.

Abyss

Some Abyss-specific minivaults could be cool, although would have to make sure they didn't feel too structured (and that seeing the same vault more than once in itself doesn't feel inherently structured - a lot of lua randomization probably needed).

See also Abyss.

Zot

Zot layouts should be weird.

Rooms and corridors. However, most corridors should be at least 2 wide. Larger rooms may also be good.

Convergence:

  • Smaller layouts with depth
  • Wider corridors and larger rooms?

See also Zot.

Orphan Layouts

This section is for layout ideas that do not have an intended branch.

Overlapping City

Proposal originally by duvessa on this forum

This layout would have a set of rooms similar to layout_chaotic_city. However, these rooms could and often would intersect each other and the map edges.

 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 x..................................x
 x...xxxxxxxx.......................x
 x...x::::::x...xxxx.xxxxxx.........x
 x...x::::::x+x.xxxx.x....x...xxxxx.x
 x...x::::::..x.xxxx.x....x...x...x.x
 x...x::::::..x.xxxx.x....x...x...x.x
 x...x::::::..x.xxxx.x....xx+xx...x.x
 x...xxx......x.xxxx.x...:::::::..x.x
 x.....+......x......x...:::::::..x.x
 x.....x......x......x...:::::::xxx.x
 x.....xxxxxxxx......xxxx:::::::x...x
 x......................xxxxxx+xx...x
 x..................................x
 x.xxx+xxxxx....xxxx..............xxxxx
 x.x.......x....x..x..............x:::x
 x.x.......x....+..x...xxxxx......x:::x
 x.x..::...x....x..x...x:::x......x:::x
 x.x..::...x....x..x...x:::xxx+x..x:::x
 x.xxx::xxxx....xxxx...x:::....x..x+xxx
 x...x::x..............xx......x....x
 x...+::x...............x......x....x
 x...x::x..xxx+xx.......x......x....x
xxxx.xxxx..x::::x.......x......x....x
xxxx.......x::::x.......x......x....x
xxxx.......x::::x.......xxxxxxxx....x
xxxx.......x::::x...................x
xxxxxxxxxxxx::::xxxxxxxxxxxxxxxxxxxxx
xxxx       x::::x
           xxxxxx

All the ':'s are really '.'s; they are just displayed differently here to show where the room shapes came from.

I would guess the basic algorithm would be:

  1. Generate a big open room of '.'s, with 'x's as walls.
  2. Place several non-overlapping solid boxes of 'c's in the room.
  3. Place a few solid boxes of 'c's so that they at least partially intersect the room. Do not check for overlap with anything.
  4. Replace all 'c's that touch an 'x' or an '.' with 'b's.
  5. Replace all remaining 'c's with '.'s and all 'b's with 'x's. We can't do this directly without messing up the checks for other cells.
  6. Add doors at random using connect_adjacent_rooms as in layout_dis.
  7. Fill all unreachable cells with wall using zonify.map_fill_zones(_G, 1, 'x'). This includes rooms without doors, outside areas entirely surrounded with boxes, and box-and-outside combinations that don't connect to the rest of the map.

A more sophisticated version would never place boxes of 'c's overlapping or adjacent (i.e. overlapping plus 1 in each direction) to a primary vault.

I don't think it would be a good idea to combine this with layout_chaotic_city. Despite similarities in theory, almost no code would be in common. layout_chaotic_city generates half hollow boxes, and uses the same glyph for them as the walls. Either of these would foil this approach.

Baffles

Proposal by infiniplex

This layout would have a single large room almost divided into smaller ones by wall crosses that almost touch each other.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x............................x
x.......x....x...x.....x.....x
x.xxxxxxxxxx.x...x.....x.....x
x.......x....x...x.xxxxxxxxx.x
x....x..x....x...x.....x.....x
x.xxxxx.x....x...x..x..x.....x
x....x..x....x...x..x..x.....x
x............x...x.xxx.x.....x
x.xxxxxxxxxxxxxx.x..x..x.....x
x............x...x..x..x.....x
x................x...........x
x.xxxxxxxxxxxxxxxxxxxxxxxxxx.x
x................x...........x
x...x..x.........x...x....x..x
x.xxxx.x.........x...x....x..x
x...x..x.........x.xxxxxx.x..x
x...x..x.........x...x....x..x
x......x.........x........x..x
x.xxxxxxxxxxxxxx.x.xxxxxxxxx.x
x......x.........x........x..x
x......x.........x........x..x
x............................x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The layout would be made by spawning crosses in random cells that had at least two full rows of '.'s around them (possibly excluding the corners). The crosses would then grow along each arm until one cell before they would hit something.

More sophistication:

  • Crosses should treat primary vaults as walls when spawning and growing.
  • Places a few custom-made crosses or a fixed size (and no test for overlap) at the beginning. These are probably just two intersecting very think rectangles. Next, add the other crosses. Then remove the fixed crosses and insert them again using the normal cross insertion approach. this should prevent there being one giant cross across the whole level.
  • Sometimes add doors at the end of baffles instead of leaving just an open space. At the beginning of layout generation, choose a) never a door ( = 0%), b) always a door ( = 100%), or c) sometimes a door (a random percent, perhaps in the range 20% to 80% to avoid the impression that the one exception is an error). Then, each time a door could be added, use that chance for '+' instead of '.' .

I am not sure where this would go. I had originally imagined Pandemonium, but a demon city built entirely of crosses seems just wrong.

Castle

This layout was originally intended for Elf, but was superseded by further discussion (years later) and then re-requested.

There is now a beta version of this available as Mantis issue 8917. It only appears on Elf:$ and builds a castle around the primary vault. It is waiting for work to begin on version 0.16. — infiniplex 2014-09-30 01:59

Elf layouts should feel more “castle-y”, although I don't have any specific ideas for what that means.

One idea for the Elven Halls is to start each generated level out with a base such as:
A-----B
|RRRRR|
|RRRRR|
C--G--D

 -or-

A-----B
|RRRRR|
|RRRRR|
EEEEEEE
 EEGEE 

KEY:
A/B/C/D = circular castle turret
-/| = hallways
R = rooms/hallways or a interior castle courtyard
E = semi circular open space partly or not at all filled with rooms
G = drawbridge/gate

From there, a moat of water/lava would be generated around the castle perimeter. From there, there would be some open cave space where fungus and some dungeon wild life might spawn along with the occasional vault.

Then, rooms would be created adjacent to the hallways or in the semi circular open space. While some would be empty, most rooms would be variable sized vaults such as a statue room, a library, or a room where elven and orcish diplomats are meeting. In addition to or instead of rooms, a large courtyard might fill the interior of the castle with fountains, grass, and plant life. Some places should also have hidden doors to secret rooms/hallways with escape hatches or secret vaults.

For added immersion, stairs in the castle should lead to stairs in the next level's castle, and outside stairs should lead to outside stairs on the next level. For the entry vault and ending vault, there could be two castles on the level. The normal one, and the vault specific one.

An example level would look something like this:

                    XXX          XXX
  XXXXXXXXX XXXXXXXXX.XX  XXXXXXXX.XX
 XXf......XXX....XXX...XXXXX........XXX
XX...LLLL.........X..........LLLLL....XX
X..LLxcxLL..LLLLLLLLLLLL...LLxcxLL.....XX
X..Lxx.xxLLLLLLLLLLLLLLLLLLLxx.xxL......X
XX.Lx...xxxxxxcxxxxxxcxxxxxxx...xL.....XX
X..Lc...+...................+...cL.....X 
XX..Lx...xx=xxx++xxxxxxx+xxxxx...xLL...XX
 X.Lxx+xx..x......x......x..xx+xxLL.....X
 X.LLx.x..<x......x......x...x.xLLL..X.XX
 X.LLx.xxxxxxxxcx+xxxcxxxx...+.cLLL..XXX
 X..Lc.x...xtt......tt...xxxxx.xLLL..X
 X..Lx.x...+t..f.....t..tc...x.xLLL..XX
 XX.L=.x...x......}....ttx...x.cLL...XX
  X.Lx.x...x....}...}f...+...x.xLL.f..XX
 XX.Lx.x...+..P..........x...x.xLLL....XX
 X.LLx.xxxxx....}...}..f.xxxxx.cLLL....X
 X.LLx.x...c.tt...}.....Px...+.xLLL....X
 X.LLc.x...cttt.......PP.c...x.xLLL...XX
 X.XLx.xx=xxxxxx.....xcxxxxxxx.cLL..XXX
XX..Lx.........xx+++xx...x...x.xLL....XX
X...Lx...............x...+...+.xLL.....X
X...Lx...............x+xxxxxxx.xL.....XX
XX..Lxcx.....................xxxL.....X
 X..LLLxcx.................xxxLLL....XX
 XX...LLLxccx...........xxcxLLL......XX
  X.....LLLLxxcxx+++xxccxLLLLL.......X
 XX..f....LLLLLLLBBBLLLLLL..........XX
 X.............LLBBBLLLL..........XXX
 X...............BBB............f..XX
 XX..............................XXX
  XXXXXX......XX.........XXX....XX
     XXXXXX...XXXXXXX..XX..XXXXXX
          XXXXX     XXXXXXXX

I understand it'd be a massive effort to do this, but giving the Elven Halls a design like this would be alot more interesting and aesthetically pleasing then the generic dungeon builder levels it is using right now. — psyshvl 2010-02-01 06:07

I wonder if we could make elf go up instead of down and then have a layout like the last castle one for elf:1 and then have elf:2 and 3 be inside the castle, without the outside part the elf ends already have a kind of throne room feel to them most of them, anyway. The inside would be layout_type_divisions-y. — doy on IRC 2014-08-06

Handy online tool

I've found a very interesting online tool for creating ASCII diagrams. Incidentally, it's pretty good at creating roguelike level mockups. Enjoy:

http://www.asciiflow.com/

b0rsuk 2011-06-14 20:04

Logged in as: Anonymous (VIEWER)
dcss/brainstorm/dungeon/layouts.txt · Last modified: 2014-10-03 22:38 by infiniplex
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki