But the game can currently be inadmissible when you consider the misuses of Manhattan heuristics in a game with diagonal movement. Optimal paths can be missed by the engine due to that.
True, diagonal movement needs both cost and heuristic of ~sqrt(2) (can be simplified to 1.4, or even lateral 5 / diagonal 7 if you want to keep integer math), else your diagram happens.
Thinking out loud though... Is that missed path even a non-optimal one, if movement costs the same in every direction? Sure, it may look idiotic if the dwarf walks straight-line NE first, then straight SE, only to arrive on the same y-coordinate as he started from. But if it takes him the same time and number of steps... ? (The path, not the search!)
Those missed paths could be optimal, movement cost wise, if it managed to connect with a direct path of High traffic (1 cost) tiles to the destination. Very uncommon, and suboptimal step wise.
The colors represent time in the pathfinding algorithm. The tiles in the back have an heuristic value of 27-29, if they manage to find a path of high traffic to the destination they will keep that heuristic value up to the destination and beat the direct normal cost paths (which will end with a cost of 30).
Heuristics for diagonals and ramps = 2. Heuristics for diagonal ramps = 3. Movement cost (High Traffic) for those is 1.
Did you experiment with the traffic costs? I'd be interested in the !science!.
I did a few tunnels with levers, I calculated the heuristic values that way.
One of my first test that left me puzzled was an obstacle course with tunnels.
Strangely enough, the dwarves usually prefer to move through the underground tunnels. The tunnels have exact same traffic settings as overground tiles.
Somehow the dwarves prefer the path that's moving away both horizontally and vertically from the destination.
That only made some kind of sense after I figured the path cost debt caused by the D = 1 heuristic vs. 2 cost normal traffic. Even then that behavior is, even if explainable, still somewhat abnormal as the overland cost should be traced first. It's possible the engine is actually pathfinding several times over the same time (if the second pass has equal or better heuristic estimate), or at least overwriting early tracebacks with later ones of equal travel cost.
But, are optimal paths really that necessary?
Not in my humble opinion...
I agree with the sentiment about dwarves needing to think.
But delayed pathfinding (unless there's some techniques I do not know) will incur large memory penalties and will most likely lower performance even further due to cache hits.
I can only agree with DF needing search algorithms that scale better.
Especially for history, material and item lists.
No, as I explained, it is you that does not understand that the game has a concept called 'floors', which is not present on the horizontal version as walls need a whole tile. Those 'floors' are everywhere under and over your workshops and rooms, and they are a serious impairment to pathfinding.
If floors did not exist, if dwarves could fly and if buildings could float, then your argument would be valid, but it is not so.
Floors/Z-levels are the primary pathfinding obstacle in the game. By far.
No, as I explained, this needs to be capable of handling flying and swimming creatures, and there is no real benefit to having a pathfinding structure that penalizes vertical travel and makes the game incapable of pathfinding for two modes of travel for a minor optimization under a certain set of circumstances that you are just assuming will be more common.
The gains you are making are trivial, and the costs are serious. It's just not worth it.
Must the game only use a single pathfinding algorithm for all creatures?
(That's a rhetorical question.)
This is the whole point around my argument. The current pathfinding algorithm has been broken to solve problems that it can't really solve. As you put it, serious costs for trivial gains.
The goal of fixing A* is not to fix the pathfinding problem (which it can't), the goal of fixing A* is to have a A* that does it's job, and then let other solutions take care of what A* can't handle.
A solution example that would improve things without breaking A* wouble be to have a different A* heuristics for creatures with different mode of travel.
This is not even some mind-blowing idea, that's just how heuristics are supposed to work.
It's also the reason why I proposed configurable A* settings options, because different fort design have different pathfinding expectancies. While those options will have minor benefits, they are also cheap to implement and have no actual costs as they are options.