|
|
|
|
|
by emadehsan
1426 days ago
|
|
Captivating! So, while generating the puzzle, you are essentially creating a random Spanning Tree for the given nodes (hexagon) arrangement? Then you randomize each pipe piece's direction within a hexagon? What algorithm are you using for it Spanning Tree? I have been working on Maze Generation[0] and found randomized Prim's, Kruskal's to be useful for Spanning Tree creation but the good old Depth First Search increases the difficulty of solving a Maze. [0] https://github.com/emadehsan/maze/blob/main/media/hexagonal.... |
|
The generator basically does the same but every tile starts out with a full set of possible orientations - every rotation of every tile shape (there are 62 I think). I remove some orientations due to border conditions, then pick a random possible orientation for some tile and so on till the board is filled. There usually is some backtracking involved.
This isn't terribly efficient and can get stuck for quite long when generating large puzzles. I actually want to look into adapting maze generation algorithms for creating these puzzles, so thanks for the link, I'll check it out.