Skip to content

Commit 213b3f1

Browse files
committed
MultiHeaded models
1 parent 5cd4019 commit 213b3f1

File tree

6 files changed

+45
-5
lines changed

6 files changed

+45
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ Sources of examples:
220220
1. [SmoothTrail](models/SmoothTrail.xml) is adapted from [128_mhz's tweet](https://twitter.com/128_mhz/status/953847394403205120).
221221
1. [SokobanLevel1](models/SokobanLevel1.xml) seems to be the first level from Hiroyuki Imabayashi's Sokoban puzzle. [SokobanLevel2](models/SokobanLevel2.xml) is the [level 452](https://www.sokobanonline.com/play/web-archive/razorflame/ionic-catalysts-xi/58022_ionic-catalysts-xi-452) from Ionic Catalysts XI set.
222222
1. [RainbowGrowth](models/RainbowGrowth.xml) was [proposed](https://github.com/mxgmn/MarkovJunior/discussions/25) by [mure](https://github.com/mure).
223+
1. [MultiHeadedWalk](models/MultiHeadedWalk.xml), [MultiHeadedDungeon](models/MultiHeadedDungeon.xml) and [MultiHeadedWalkDungeon](models/MultiHeadedWalkDungeon.xml) are [based](https://github.com/mxgmn/MarkovJunior/discussions/38) on the idea by [Ilya Kudritsky](https://github.com/Inferdy).
223224

224225
Voxel scenes were rendered in [MagicaVoxel](https://ephtracy.github.io/) by [ephtracy](https://github.com/ephtracy). Special thanks to [Brian Bucklew](https://github.com/unormal) for demonstrating the power of Dijkstra fields to me in roguelike level generation and [Kevin Chapelier](https://github.com/kchapelier) for a number of good suggestions. The font used in GUI is [Tamzen](https://github.com/sunaku/tamzen-font).
225226

models.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
<model name="MazeMap" size="30"/>
8686
<model name="MazeTrail" size="59" steps="1000"/>
8787
<model name="MazeTrail" size="27" d="3" steps="1000"/>
88+
<model name="MultiHeadedDungeon" size="55"/>
89+
<model name="MultiHeadedWalk" size="99"/>
90+
<model name="MultiHeadedWalkDungeon" size="59"/>
8891
<model name="NestedGrowth" size="80" steps="100"/>
8992
<model name="NoDeadEnds" size="39"/>
9093
<model name="NoDeadEnds" size="19" d="3"/>

models/MultiHeadedDungeon.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<sequence values="BRWGO" origin="True">
2+
<markov>
3+
<sequence>
4+
<one in="R***B" out="*WWWG" steps="3"/>
5+
<all in="R" out="O"/>
6+
<all in="G" out="R"/>
7+
</sequence>
8+
</markov>
9+
<all in="BBB/BOB" out="***/*R*"/>
10+
<all in="RBBBR" out="OWWWO"/>
11+
<all in="R" out="O"/>
12+
<all in="BBBBB/BOWWW/BBBBB" out="*****/*BBBB/*****"/>
13+
<all in="OWWWO/W***W/W***W/W***W/OBBBO" out="*****/*****/*****/*****/*WWW*"/>
14+
<all in="*******/*OWWWO*/*W***W*/*W*B*W*/*W***W*/*OWWWO*/*******" out="WWWWWWW/W*****W/W*WWW*W/W*WGW*W/W*WWW*W/W*****W/WWWWWWW"/>
15+
<all in="O" out="W"/>
16+
<prl in="GWWWG/WWWWW/WWWWW/WWWWW/GWWWG" out="BBBBB/BBBBB/BBBBB/BBBBB/BBBBB"/>
17+
<all in="G" out="W"/>
18+
</sequence>

models/MultiHeadedWalk.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<markov values="BRGW" origin="True">
2+
<sequence>
3+
<one in="RB" out="*G" steps="3"/>
4+
<all in="R" out="W"/>
5+
<all in="G" out="R"/>
6+
</sequence>
7+
</markov>

models/MultiHeadedWalkDungeon.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<sequence values="BRGW" origin="True">
2+
<markov>
3+
<sequence>
4+
<one in="RBB" out="*WG" steps="3"/>
5+
<all in="R" out="W"/>
6+
<all in="G" out="R"/>
7+
</sequence>
8+
</markov>
9+
<all in="BBB/BWB" out="***/*R*"/>
10+
<all in="RBR" out="WWW"/>
11+
<all in="R" out="W"/>
12+
<all in="BBB/BWB" out="***/*B*"/>
13+
<all in="WWW/WBW" out="***/*W*"/>
14+
</sequence>

syntax.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ See examples of union use in [DungeonGrowth](models/DungeonGrowth.xml).
4848
## Inference
4949
Inference in MarkovJunior allows to impose constraints on the future state, and generate only those runs that lead to the constrained future. Inference is triggered by putting `observe` elements inside rulenodes (inside `one` or `all` nodes, to be precise). Observe elements have 3 attributes: `value`, `from`, `to`.
5050

51-
For example, `<observe value="W" to="BR"/>` means that squares that are currently white should become black or red after a chain of rule applications.
52-
53-
`<observe value="I" from="B" to="W"/>` means that squares that are currently indigo are turned black immediately, and then should become white after a chain of rule applications.
51+
For example, `<observe value="W" to="BR"/>` means that squares that are currently white should become black or red after a chain of rule applications. `<observe value="I" from="B" to="W"/>` means that squares that are currently indigo are turned black immediately, and then should become white after a chain of rule applications.
5452

5553
In [SokobanLevel1](models/SokobanLevel1.xml) we say that the goal `I`-squares should become white - this would mean that the puzzle is solved. We also help the inference engine by explicitly saying that the current black, white and red squares should *not* be white in the end. Since we don't have `I` in the ruleset, we say that current indigo squares should be treated as black by setting `from="B"`.
5654

@@ -92,6 +90,5 @@ See examples of `convchain` node use in [ChainMaze](models/ChainMaze.xml), [Chai
9290

9391

9492
## Questions and Answers
95-
**Q:** How to make a loop? How to make a sequence repeat?
96-
93+
**Q:** How to make a loop? How to make a sequence repeat?<br/>
9794
**A:** To make a sequence repeat, put a `sequence` node inside a `markov` node. Examples of this: [HamiltonianPath](models/HamiltonianPath.xml), [SelectLargeCaves](models/SelectLargeCaves.xml), [SelectLongKnots](models/SelectLongKnots.xml), [FireNoise](models/FireNoise.xml), [SmartSAW](models/SmartSAW.xml), [FindLongCycle](models/FindLongCycle.xml). Counters in markov/sequence nodes are not supported right now. Instead, you may want to repeat the sequence until some node is matched.

0 commit comments

Comments
 (0)