Baughn and Kardos, those are really good suggestions and similar to something I had in mind:
Toady mentioned that the map is broken down into 16 x 16 x 1 sections of tiles. If each section could keep track of what other section it is linked to through open tiles, ramps, or stairs it would be possible to calculate which sections creature must go through before it worries about what tiles to go through. The only issue I can see with this is that though section X might be linked to section Y and Z, it may not be able to go from section Y to section Z through section X on the tile scale, if that makes sense.
Another optimization I had in mind is breaking the fort down into a tree, which is pretty much the same as the node idea. Most forts are subdivided into smaller sections (rooms, halls, burial grounds filled with noble warriors struck down by the HFS). Still thinking about the best way to do that, though.
Anyways, I've begun coding a little benchmark I'm calling "Cat Fortress." (Why cats? If you're asking this question, go allow cats to breed in your fort a while and come back to this thread when you're frustrated

) It will allow you to place tons of cats and have them path to random points or points you select. You will be able to manipulate the walls, floors, and stairs of various z-levels... basically a really, really, really, really, really, really, REALLY primitive DF. The map will be adjustable and size, and will pretty much present the basic problem of pathing in DF minus flows, enemies, etc. The hope is that I will be able to implement multi-threaded CPU pathfinding and CUDA pathfinding, which would pretty much eliminate the problem of pathfinding lag for GeForce 8, 9, and 200 card owners.
Hopefully I'll finish by the end of next week. After that, I might
flow on over to optimizing something else
