Wang Tiles

 

edge and corner matched tilesets

menu

Imperfect Mazes

Imperfect mazes allow loops, formed when dead ends are 'removed' - fused with a neighboring path. This can happen as a maze is generated, or carried out 'post edit' when the maze is fully drawn.

Dead End Fusing

When trapped and fusing is allowed then fuse with an adjacent path. If possible, fuse in the current direction to help prevent a small loop. Even better, fuse in the opposite direction to the previous turn. You can see below that the previous turn was to the left, so fusing to the right forms the largest possible loop. Note if fusing is allowed, the maze will no longer be 'perfect'.

Trapped
tile tile tile
tile tile tile
tile tile tile
Fuse forward
tile tile tile
tile tile tile
tile tile tile
Fuse left
tile tile tile
tile tile tile
tile tile tile
Fuse right
tile tile tile
tile tile tile
tile tile tile

Pass thru allows many cross roads to form.

Trapped
tile tile tile tile
tile tile tile tile
tile tile tile tile
Pass-thru
tile tile tile tile
tile tile tile tile
tile tile tile tile

Dead end fusing can also help to reduce the number of different tiles needed.

Stagecast:

  • If wrapping is on, then wrap around the stage edges. The algorithm should still work when wrapping is turned off without modification.
  • Path tiles with occupied cells on all four sides are trapped. Remove any agents or 'fossilise' to help speed up the algorithm. Add exit information to the tile to allow wandering sprites to exit correctly.
  • If cross roads are not allowed then T-junction (3 way) paths can also be fossilised.
  • Keep a count of cells filled to know when the algorithm is complete. Either continue and add wandering sprites or stop the sim.
  • If dead-end paths are not allowed, then special care needs to be taken with the initial starting cell. It may remain a dead-end and must be fused with another path correctly.

Wang Tiles | cr31.co.uk | 2017