From 213b3f1f7ce1a97665587804080230f3e7d8ff43 Mon Sep 17 00:00:00 2001 From: mxgmn Date: Fri, 17 Jun 2022 18:41:17 +0300 Subject: [PATCH] MultiHeaded models --- README.md | 1 + models.xml | 3 +++ models/MultiHeadedDungeon.xml | 18 ++++++++++++++++++ models/MultiHeadedWalk.xml | 7 +++++++ models/MultiHeadedWalkDungeon.xml | 14 ++++++++++++++ syntax.md | 7 ++----- 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 models/MultiHeadedDungeon.xml create mode 100644 models/MultiHeadedWalk.xml create mode 100644 models/MultiHeadedWalkDungeon.xml diff --git a/README.md b/README.md index 32ae2a0..3998d65 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,7 @@ Sources of examples: 1. [SmoothTrail](models/SmoothTrail.xml) is adapted from [128_mhz's tweet](https://twitter.com/128_mhz/status/953847394403205120). 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. 1. [RainbowGrowth](models/RainbowGrowth.xml) was [proposed](https://github.com/mxgmn/MarkovJunior/discussions/25) by [mure](https://github.com/mure). +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). 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). diff --git a/models.xml b/models.xml index b0b5c8a..b383cd8 100644 --- a/models.xml +++ b/models.xml @@ -85,6 +85,9 @@ + + + diff --git a/models/MultiHeadedDungeon.xml b/models/MultiHeadedDungeon.xml new file mode 100644 index 0000000..0c4ba4d --- /dev/null +++ b/models/MultiHeadedDungeon.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/models/MultiHeadedWalk.xml b/models/MultiHeadedWalk.xml new file mode 100644 index 0000000..c8c3c61 --- /dev/null +++ b/models/MultiHeadedWalk.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/models/MultiHeadedWalkDungeon.xml b/models/MultiHeadedWalkDungeon.xml new file mode 100644 index 0000000..5f1eed4 --- /dev/null +++ b/models/MultiHeadedWalkDungeon.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/syntax.md b/syntax.md index f6b1a33..2926ddd 100644 --- a/syntax.md +++ b/syntax.md @@ -48,9 +48,7 @@ See examples of union use in [DungeonGrowth](models/DungeonGrowth.xml). ## Inference 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`. -For example, `` means that squares that are currently white should become black or red after a chain of rule applications. - -`` means that squares that are currently indigo are turned black immediately, and then should become white after a chain of rule applications. +For example, `` means that squares that are currently white should become black or red after a chain of rule applications. `` means that squares that are currently indigo are turned black immediately, and then should become white after a chain of rule applications. 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"`. @@ -92,6 +90,5 @@ See examples of `convchain` node use in [ChainMaze](models/ChainMaze.xml), [Chai ## Questions and Answers -**Q:** How to make a loop? How to make a sequence repeat? - +**Q:** How to make a loop? How to make a sequence repeat?
**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.