More specific heuristics?
I must say that I remain a bit wary about "Well, we know there'll be corridors and rooms..." coming into discussions about how to make a better A*, or why to swap to a 'better'-than-A*-when-it-comes-to-corridors-and-rooms system.
Not to say that I don't like the various solutions being brought forward, but just because one player uses a basic 3x3-grid-and-doorways[1] doesn't mean that another player doesn't do 3x3-grid-with-columns[2] or 3x3-grid-with-nothing![3], among others (I didn't even bother to draw diagonal doorways, but I know they're popular) not even taking into account stairwell placement issues. And there are players who do more aesthetic (less grid-like) layouts with diagonals, even approximations of curves, or are almost entirely open-plan or opportunistic within dug-out veins and other deposit minings. Some will go for closed-path systems[6] that should be a pathing algorithm's dream. Certain pathing algorithms, anyway, but others might struggle.
Personally, I
tend to go for a variety of "filled 11-blocks"[4] within a corridor framework, according to need, and even my corridors might be simple or fancy[5].
Combined with the (near-)open nature of the surface topology and the different ways the various cavern setups might appear, I can only suggest that anyone suggesting a solution optimised for a typical playing-style/fort-layout should look at least at the 'natural' environment, and probably into other layout designs being used (even intermingled in the same fort!) and do a sanity check to see if they're in danger of
de-optimising those areas.
Which is not to say that A* is the best-all-rounder, even, I hesitate to add. And I know people already design their forts according to the vagaries of A* (e.g. walling off unused areas of the fort as a nod towards helping the A* from not investigating that easily-taken dead-end), even while others just ignore it all. Under a different scheme the former can change styles again, if necessary, while the latter keeps on ignoring the issue (for better or worse).
A long, long time ago, though, in a completely different thread, I mentioned one improvement to pathing that might help (and might easily help immediately, with a suitably annotated A* scheme). When going to dig out a tile (or otherwise make passable one that's currently impassible), give that destination tile an "honorary passable" status for the purpose of that particular path-finding search and then cut the found path short by one tile to find the actual work-spot. This way you don't get dwarves standing directly SE of this block, now seeking to cut it out, finding that the westerly tile is a viable dig-spot and then seeking the long path around a mountain to make that dig. Nor do you get dwarves checking the westerly-tile path, then various other paths to any other access points until they finally get to checking the path to the SE tile, which trumps it and throws all the other pathing effort in the bin, which would be the other solution (saving on dwarf-time, but wasteful of pathing-time).
Instead: Let pathing algorithm know that dig-block is valid destination for this journey; Pathing algorithm (of most sensible types) almost immediately determines that the best path to dig block would be to go NW, and no further; Because it's a dig-job, pop the NW off of the stack; Travel instructions = stop here; Commence to dig to NW.
(If relevant to instances where only orthogonal working is actually legal, would need slight modification to prevent 'illegal' last-steps, but minimally so.)
Should an alternate method be implemented, I'd very much like the above to become a realistic possibility, in some form that does not require a complete tree-graph overhaul, of course, or risks sending other nearby dwarves towards the not-yet-passable tile in advance of its removal. (If they're far enough away, already, they
could anticipate, but I think keeping the passability-in-potentia local to the specific miner's path-search data would be wiser and
might be simpler.)
[1] [2] [3]
##.###.###.## #...#...#...# .............
#+++#+++#+++# .+++.+++.+++. .+++.+++.+++.
.+++.+++.+++. .+++.+++.+++. .+++.+++.+++.
#+++#+++#+++# .+++.+++.+++. .+++.+++.+++.
##.###.###.## #...#...#...# .............
#+++#+++#+++# .+++.+++.+++. .+++.+++.+++.
.+++.+++.+++. .+++.+++.+++. .+++.+++.+++.
#+++#+++#+++# .+++.+++.+++. .+++.+++.+++.
##.###.###.## #...#...#...# .............
#+++#+++#+++# .+++.+++.+++. .+++.+++.+++.
.+++.+++.+++. .+++.+++.+++. .+++.+++.+++.
#+++#+++#+++# .+++.+++.+++. .+++.+++.+++.
##.###.###.## #...#...#...# .............
[4] Open 3x3 Open 5x5 Opener 5x5 Closed 5x5 Closed 3x5 Maximal (wall styles vary!)
#.#############.#############.#############.#############.#############.#############.#
.X.............X.............X.............X.............X.............X.............X.
#.##.###.###.##.###.#####.###.##...###...##.###.#########.##.###.###.##.##.#.#.#.#.##.#
#.#+++#+++#+++#.#+++++#+++++#.#+++++#+++++#.#+++++#+++++#.#+++#+++#+++#.#+++++++++++#.#
#..+++.+++.+++..#+++++#+++++#..+++++.+++++..#+++++#+++++#.#+++#+++#+++#..+++++++++++..#
#.#+++#+++#+++#..+++++.+++++...+++++.+++++..#+++++#+++++..#+++#+++#+++#.#+++++++++++#.#
#.##.###.###.##.#+++++#+++++#..+++++.+++++..#+++++#+++++#.#+++#+++#+++#..+++++++++++..#
#.#+++#+++#+++#.#+++++#+++++#.#+++++#+++++#.#+++++#+++++#.#+++#+++#+++#.#+++++++++++#.#
#..+++.+++.+++..###.#####.###.##...###...##.#############.#############..+++++++++++..#
#.#+++#+++#+++#.#+++++#+++++#.#+++++#+++++#.#+++++#+++++#.#+++#+++#+++#.#+++++++++++#.#
#.##.###.###.##.#+++++#+++++#..+++++.+++++..#+++++#+++++#.#+++#+++#+++#..+++++++++++..#
#.#+++#+++#+++#..+++++.+++++...+++++.+++++...+++++#+++++#.#+++#+++#+++#.#+++++++++++#.#
#..+++.+++.+++..#+++++#+++++#..+++++.+++++..#+++++#+++++#.#+++#+++#+++#..+++++++++++..#
#.#+++#+++#+++#.#+++++#+++++#.#+++++#+++++#.#+++++#+++++#.#+++#+++#+++#.#+++++++++++#.#
#.##.###.###.##.###.#####.###.##...###...##.#########.###.##.###.###.##.##.#.#.#.#.##.#
.X.............X.............X.............X.............X.............X.............X.
#.#############.#############.#############.#############.#############.#############.#
[5]
Limited top view of one slice:
#...# #...# #...#
#...# #.#.# #...#
#.v.# #.^.# #.v.#
#...###########...###########...####
....................................
..X..v......#^..X..^#......v..X..v..
....................................
#...###########...###########...####
#.v.# #.^.# #.v.#
#...# #.#.# #...#
#...# #...# #...#
Side cross-section through the main gubbins:
__X__ ______#\ _X_ /#______ __X__ __
__X_#\ ______#\_X_/#______ /#_X_#\ _
__X__#\ ________X________ /#__X__#\
__X___#\ _______X_______ /#___X___#\
__X____#\ ______X______ /#____X____#
__X_____#\ _____X_____ /#_____X_____
__X______#\ ____X____ /#______X_____
__X_______#\ ___X___ /#_______X_____
__X________#\ __X__ /#________X_____
__X__ ______#\ _X_ /#______ __X__ __
__X_#\ ______#\_X_/#______ /#_X_#\ _
__X__#\ ________X________ /#__X__#\
Continued (in X and Y) through a whole fort layout,
this give both long-distance and local travel advantages
(I sometimes add strategic "diagonal access" blocks with
diagonal ramps running through open areas.)
((Needless to say, this is not a design easily
defended, once an enemy gets inside, so instead I do
my utmost to not /let/ them get inside!))
[6] Main marble rock-race opens only into stone workshop opens only onto various stockpiles clumped together opens onto Trade Depot, tree-farm only leads to wood stockpile only leads to carpenter only leads into various furniture stockpiles leads to central stairwell for distribution, ore-vein is mediated by ore stockpile, smelter, metal stockpile (maybe others along those lines) and forge then metal goods/weapons/armour/etc stockpiles, etc, and I won't even describe such a farming layout, although I've got a nice one planned that one day I'll actually establish properly!)