4 comments

  • tasuki2 hours ago
    Yes, this page is a good overview of the sorry state of maze generation. The maze-creating algorithms might be interesting for computer scientists, but they&#x27;re <i>terrible</i> at creating mazes interesting for humans!<p>First, I&#x27;m not sure &quot;perfect maze&quot; is a good requirement - well placed loops make mazes more interesting. Second, &quot;uniform&quot; is a useless metric: generating all mazes with equal probability leads to the mazes being visibly uninteresting, with many short dead ends. Same goes for the other metrics.<p>Sean C Jackson makes some good mazes: <a href="https:&#x2F;&#x2F;www.seancjackson.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.seancjackson.com&#x2F;</a><p>---<p>Inspired by the above, I&#x27;m in the process of creating a maze game for my kid: <a href="https:&#x2F;&#x2F;maze.tasuki.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;maze.tasuki.org&#x2F;</a><p>So far I hand-crafted the mazes. The initial idea was to generate them, but I quickly found out that generating interesting mazes was hard. And generating interesting mazes in 2.5D with with weave and without walls is even harder.<p>So I&#x27;m practicing maze creation. My newer mazes are much better (and take me less time to create) than the first attempts. I think eventually I&#x27;ll be able to write down the algorithm I use for maze creation.
    • fc417fc8021 hour ago
      &gt; The maze-creating algorithms might be interesting for computer scientists, but they&#x27;re terrible at creating mazes interesting for humans!<p>Not sure what would lead you to that conclusion. There&#x27;s only so much you can do with (for example) a two color palette and no lawn art but it goes without saying that there&#x27;s nothing restricting an implementation to the sort of minimalist methodology that&#x27;s so useful for demonstrating an algorithm for the reader.<p>The last time this was posted [0] someone linked this article [1] which provides a nice visual demonstration of the structural differences between a few of the algorithms (scroll down for the color floods I&#x27;m referring to). Of course this can all be implemented as a graph (ie nodes that have coordinates) rather than as a grid, empty space expanded (ie coordinates subjected to an arbitrary series of affine transformations), branches of the tree overlaid after the fact to add weave (ie rotating and translating the coordinates of subtrees), nodes expanded to represent larger areas instead of single grid cells, whatever you&#x27;d like.<p>Also see the modifying in blocks algorithm applied to an escheresque tileset [2] (from this article [3]) which will produce a solvable 3D maze (multi-path and multi-solution) if given an appropriate tileset.<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10101728">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10101728</a> [1] <a href="https:&#x2F;&#x2F;bost.ocks.org&#x2F;mike&#x2F;algorithms&#x2F;#maze-generation" rel="nofollow">https:&#x2F;&#x2F;bost.ocks.org&#x2F;mike&#x2F;algorithms&#x2F;#maze-generation</a> [2] <a href="https:&#x2F;&#x2F;www.boristhebrave.com&#x2F;wp-content&#x2F;uploads&#x2F;2021&#x2F;10&#x2F;escher_lns_anim_trimmed.mp4" rel="nofollow">https:&#x2F;&#x2F;www.boristhebrave.com&#x2F;wp-content&#x2F;uploads&#x2F;2021&#x2F;10&#x2F;esc...</a> [3] <a href="https:&#x2F;&#x2F;www.boristhebrave.com&#x2F;2021&#x2F;10&#x2F;26&#x2F;model-synthesis-and-modifying-in-blocks&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.boristhebrave.com&#x2F;2021&#x2F;10&#x2F;26&#x2F;model-synthesis-and...</a>
      • tasuki54 minutes ago
        The WFC&#x2F;model synthesis article is very interesting, thanks.<p>Yes the color floods are stunning, but these are exactly the algorithms which do not produce very interesting mazes. In particular, I don&#x27;t think the &quot;no loops&quot; is a good maze property - the loops just have to be interesting.
    • potro1 hour ago
      Nice game. Thank you for sharing it. It brought some joy to my morning.
      • tasuki1 hour ago
        Thanks! I haven&#x27;t really shared it with many people yet - if you have any feedback I&#x27;d be happy to hear.
  • GavinAnderegg9 hours ago
    This is a great list! A while back I also enjoyed reading “Mazes for Programers” and playing around with different maze generation algorithms from that book over a holiday break. The book isn’t super deep, but it has a fun set of projects and further ideas&#x2F;reading as well. <a href="https:&#x2F;&#x2F;pragprog.com&#x2F;titles&#x2F;jbmaze&#x2F;mazes-for-programmers&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pragprog.com&#x2F;titles&#x2F;jbmaze&#x2F;mazes-for-programmers&#x2F;</a>
    • tasuki2 hours ago
      &gt; The book isn’t super deep, but it has a fun set of projects and further ideas&#x2F;reading as well.<p>Does it just regurgitate the well known maze generating algorithms? These generally do not lead to mazes interesting for humans...
      • GavinAnderegg1 hour ago
        The book starts with generating fairly standard mazes, but transitions to making more interesting ones in later chapters. There are 12 algorithms explained in the book (listed in the link above), and the author does care about making pleasant mazes.
    • signa114 hours ago
      couple that with the &quot;the ray tracer challenge&quot; book, and you can generate some pretty cool images :o)
  • tomhow9 hours ago
    Previously:<p><i>Maze Algorithms (1997)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10101728">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10101728</a> - Aug 2015 (10 comments)
  • fjfaase9 hours ago
    Are there also algorithms for (incremental) generation of infinite mazes?
    • tromp2 hours ago
      The linked-to page mentions:<p>&gt; Infinite length Mazes: It&#x27;s possible to create an infinitely long Maze (a finite number of columns by as many rows as you like) by only keeping part of the Maze in memory at a time and &quot;scrolling&quot; from one end to the other, discarding earlier rows while creating later rows.<p>&gt; An easier way to make an infinite Maze is with Eller&#x27;s or the Sidewinder algorithms, as they already make Mazes one row at time, so simply keep letting them add rows to the Maze forever.<p>My tiny obfuscated maze program at <a href="https:&#x2F;&#x2F;tromp.github.io&#x2F;pearls.html#maze" rel="nofollow">https:&#x2F;&#x2F;tromp.github.io&#x2F;pearls.html#maze</a> will print an infinitely long maze if you enter a negative height.
    • contravariant1 hour ago
      I&#x27;d probably go with something like the wave function collapse algorithm. It should be possible to make it generate trees with <i>somewhat</i> uniform probability.
    • fc417fc8028 hours ago
      What would it mean for a maze to be infinite? It seems to me that a key part of the concept is having a goal to reach.<p>Although I guess you could have an infinitely large map and an algorithm that guaranteed connectivity. Infinite ways to fail to reach the goal. But I doubt there would be much practical benefit.<p>To actually answer your question it should be fairly easy to convert nearly any existing algorithm to cover an infinite area by simply tiling it. A common method to avoid boundary issues is to overlap the tiles slightly.
      • tasuki2 hours ago
        I&#x27;m looking for such an algorithm, with intermediate goals: you start at the bottom, go up, and as you reach the goal, more maze appears. I left out some unimportant details :)
      • fjfaase1 hour ago
        Please explain how to deal with slightly overlapping tiles and still create a maze that has no cycles and locations that cannot be reached from any other location. These are properties that go tiles.<p>I do know of an algorithm with &#x27;nesting&#x27; that generate mazes but results in very long walls and thus does not feel random.