Edit:
According to Rafal99s post later in this thread (
http://www.bay12forums.com/smf/index.php?topic=56041.msg1224791#msg1224791) an improved A* ist used, so the following examples are not important for fortress planning.
I think I do remember 'newest first' being something I saw in 40d. It's been a long time though, and I don't know if it's in v31, since I've hardly touched that.
Do you maybe mean best first? That is a pretty old method from the late seventies. A* is a mixture of Dijsktra and best first (which is also called B*).
I dismissed the thought that he might be using such an inefficient method, assuming that he wrote the pathfinding some time in the last decade. But on the other hand it might not be that improbable, maybe he uses the pathfinding code from an older game and never had another look at it. It is of course more fun enabling more content, like 1000 year old puke monsters from the depths, than working on pathfinding...
So, lets have a look at B* (even if your post was not about it and I got that wrong) and what this would mean for fortress layout then:
I currently don't have the time to read up on the details of the algorithm, it's hard to find something on the net and visiting the library might be the better approach. But lets have a look at some examples, as the website linked in the op has that implemented, too.
Finding the path to a target in open space:
This is worse than Dijsktra, and much worse than A*. All surrounding tiles are checked iteratively until the target is found. So obviously open spaces are definitely not our friend then. High pathing costs would not stop the method from checking all those tiles, they would just influence which path is chosen afterwards, afaik. So setting traffic zones would probably not improve pathfinding speed.
Finding a path inside:
Much better, as there are less tiles that have to be checked...
And some obstacles:
Even better, as we have more walls there are even less tiles that have to be checked.
With unreachable items the situation doesn't change, it's just as bad:
So if this method is used I think your best fortress design would be quite different:
- Mine as little space as possible.
- Build as many walls and other obstacles as possible.
- Keep all ways short.
- Don't spend too much time on setting traffic zones.
If toady is using this method there are good news: Changing the algorithm should not take him too much time, a few hours in the best case or probably a few days in the worst. The speed improvements would be immense. Of course he has a lot on his hands for now, but if the method is this outdated he might have a look at it much sooner.
Actually, restricted zones are checked. They just have a very high path cost. The low/normal/high/restricted path costs default to 1/2/5/25. It's explained in data\init\init.txt.
Yes, you are right, what I wrote is misleading (so let me change that). What I meant with that was that the high pathing costs of restricted tiles should result in many other tiles being checked first. So if there is another way (thats not too long) it will probably be found before a row of resticted tiles has even been looked at.
Edit:
I had a short look at the kobold quest source code, and to my understanding he is using a variant of B* there. But the existence of traffic zones in df shows that he did change his method and having different pathing costs would point towards A* (ruling out Dijkstra due to target selection). So the examples and conclusions in this post should be of little importance.