-
-
Notifications
You must be signed in to change notification settings - Fork 317
/
NystromDungeon.xml
28 lines (25 loc) · 1.22 KB
/
NystromDungeon.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<sequence values="BPWRG" origin="True">
<all in="PBB" out="**P" comment="draw a grid"/>
<one in="PBPBPBPBP/BBBBBBBBB/PBPBPBPBP/BBBBBBBBB/PBPBPBPBP/BBBBBBBBB/PBPBPBPBP" out="WWWWWWWWW/WWWWWWWWW/WWWWWWWWW/WWWWWWWWW/WWWWWWWWW/WWWWWWWWW/WWWWWWWWW"/>
<markov comment="generate corridors with MazeBacktracker">
<one in="RBP" out="GGR"/>
<one in="GGR" out="RWW"/>
<one in="P" out="R"/>
</markov>
<one in="R" out="G" steps="1" comment="leave only one start"/>
<all in="R" out="W" comment="forget other starts"/>
<markov comment="connect components">
<all in="GWW" out="**G"/>
<one in="GBW" out="*WG"/>
</markov>
<one in="GBG" out="*W*" steps="5" comment="insert cycles"/>
<!--<one in="WGBG/WW**" out="**W*/****" steps="5"/>-->
<all in="G" out="W" comment="forget structure"/>
<all in="BBB/BWB" out="BBB/BBB" comment="retract dead ends"/>
</sequence>
<!--
Generates a dungeon with rooms and corridors, containing a fixed amount of cycles.
Adaptation of http://journal.stuffwithstuff.com/2014/12/21/rooms-and-mazes/
Compare to implementations in conventional languages: https://github.com/munificent/rooms-and-mazes
For shorter versions that use connectivity patterns, see NystromKruskal and KruskalNystrom.
-->