3 ms·
So you only want dead ends to have loops? You might try computing the depth of each node, marking the solution, and then assigning each branch off of the soluti
by fc417fc802 7mo ago
So you only want dead ends to have loops? You might try computing the depth of each node, marking the solution, and then assigning each branch off of the solution a unique color.
At that point knocking out walls only within the same color won't interfere with the solution.
Alternatively you could take care to track depth and knock out walls between different colors only when the total resulting path length would be greater than the existing solution.
Just go try stuff! All of the examples on Bostock's page that I linked earlier link to JS implementations that you could fork.
- tasuki 7mo agoWell, I don't have "walls" - my maze is sort of 2.5 dimensions - so that complicates things somewhat. I wonder whether there's an algorithm to "lift" a 2d maze with walls into my 2.5d maze, and I think if it's possible it's WFC or model synthesis. I will go try stuff, just haven't gotten around to it yet :)
- fc417fc802 7mo agoYou do have walls, they're just implicit. There obviously must be a way for someone looking at it to tell which directions they are permitted to move in. Don't think of it as an image but rather as a graph of the passable tiles. You can render the nodes and vertices in various different ways.
- tasuki 7mo ago> You do have walls, they're just implicit. Yes but not each constellation of walls can be lifted into the 2.5 dimensions: it's important that two neighboring flat cells which are separated be at different heights. Also I do not want the path to be occluded.