Hi.
I'm wondering about this. I've been trying to make a tunnel generator, but am not sure if my current solution is really the best.
The goal is to make a tunneler that avoids this:
.
.
..................
.....................
.
.
That is two tunnels which have a stretch where they parallel each other so closely that no wall can be made between them, yet do not overlap, forming a 2x11 "pseudo-room" that is not an "actual" room. A similar phenomenon can also occur between rooms and tunnels. Both kinds are undesirable.
The current method I've got works by putting special "cue" tags on the "borders" of rooms and tunnels which then provide cues to an A* pathfinding system that is then used to form the tunnels. This method is very powerful, since we can create many different kinds of constraints and even tunnel shapes simply by varying the cost function. But the problem is that the A* part is slow. Though not really noticeable on a modern machine, on some really old stuff it might be a problem (10 seconds to generate a level on an old old old Pentium or 486 thingy, though I don't know if that should matter, and I haven't tested it on any, I'm just guesstimating -- it takes 20 milliseconds to generate an 80x80 level on my few-years-old Core 2 system with optimization turned on with the compiler, and imagining a 486 to be 500 times slower, which may be too high or low, I don't know as I don't have access to one to test with. It's much slower than even Angband's level generator though...). Is that bad? If so, what alternatives may there be, that are faster _and_ also give more diversity?
Another level generation algorithm I've considered is one I call as "KISS" (since it's "simple and stupid" but produces fair results (though not quite what I want)) or "ADOMian" (as it looks like something very similar is probably used in the game ADOM, though without the sources one cannot be totally sure). This method works as follows:
1. Place rooms at randomized positions in a grid dividing up the level. This gives a fairly uniform distribution of rooms. But all room sizes must be constrained to be odd numbers, as must be their coordinates.
2. Connect room edge points with tunnels. All edge points and tunnel corners must have odd-number coordinates. Tunnels can be L-shaped or have zig-zags.
It produces fairly decent results (see ADOM), but to me is not as nice as the A*-based approach in terms of output and also it's ability to produce diversity. Namely, zig-zags must be "bulky" (with length-3 minimum zigzags instead of length-2), which means highly irregular ("cave-like") tunnels may be a problem (though perhaps with those we may not care so much about "pseudo-rooms" and all that anyway).
So what would be a good approach to this problem?
Is there a third option here which I have not considered?