How hard is it to do pathfinding for creatures that are able to dig, or even construct bridges and ladders? For, like, some really resourceful siegers?
It needs at least modifications to the base pathing[1], if not parallel pathing trees (as previously discussed) which treat solid earth, bridgable gaps or climbable walls as appropriately high-cost travel routes[2] or limited-accumulation[3] pathway management where it's a matter of resource-based resourcefulness.
Some might consider that a whole can of worms, of course.
[1] Possibly arbitrarily finding a tunelling/bridging/laddering point and assessing paths from origin to one side and from other side to destination, and seeing if that produces a better/more possible path than straight pathing. But unless the arbitrariness could be optimised to something rational (smallest gap between the otherwise unjoined 'inside' and 'outside' pathing trees, biased towards the gap-points most accessible to the agents' starting point/least dangerous for them to attempt) I could see high CPU pursuing, and it starts to look more and more like the other solution anyway...
[2] Which may be mitigated if the digging/bridging/laddering creatures are 'responsible' for creatures not of that ilk (e.g. under the command of a squad leader with a number of other subordinates, all of whom are currently sufficiently unable/unwilling to go another way... When such a squad-opinion is triggered, the sappers or other engineer-like units take on leadership role (or at least swap leader/led roles with the usual head honcho) and have their usual non-walking routing difficulties offset smewhat.
[3] Within the pathing algorithm, wall can be climbed (or other appropriate method used) for only nominal cost, but each level of wall that is climbed depletes a counter (on that routing algorithm's particular logical branch) that holds the finite amount relating to 'ladders that can be used'... Routes that run out of ladder (or bridge, or some measure of digging effort) can no longer branch over that kind of obstacle. Of course, one has to define what priority a short but 'effort using' traversal has over an equivalent long-way-round route, and whether one continues both routes onwards beyond the obstacle, in order to cater for later diversions or traversals... i.e.
A B C D E F
#################
>..++_+++++_+++++_++..>
#+#+###+#+###+#+#
#+#+# #+#+# #+#+#
<arbitrary continuation>
#+#+# #+#+# #+#+#
#+#+# #+++# #+#+#
#+#+# ##### #+#+#
#+#+# #+#+#
#+#+#########+#+#
#++++++___++++#+#
#################
G
Given 'x' amount of bridging ability, the routes from start to finish range from completely non-bridging (down A, back B, down C, back D, down E, back F) to bridging any or all of A_B, C_D and E_F or even going via the triple-length G-bridge, which might need one, two or three bridging elements, depending on how much based on the player's own bridging materials requirements it is, but also might involve a hefty diversion southwards as part of the assesment of routing efficiency.
It might even be worthwhile for a suitably staffed unit to consider a route-finding branch which integrates the deployment down towards G with both its bridge engineers and some mining units (ignoring for now the possibility of mining across the other small gaps instead of bridging) in order to mine more bridging material to traverse even longer 'G' gaps, if known/discovered traps are found lying across the BC and DE stretches... But that's getting complicated. As may be the question of whether a bridging unit can bridge across a gap that
has a bridge built upon it[4] but one that is currently retracted? That might need either a modification of the building code or 'temporary' bridging types of some form that can be laid across such gaps.[/3]
[4] Also note possible future 'grappling hook' possibilities, to 'grab' raised bridges (or retracted ones, presumably retracted into the opposite side), as another non-standard routing option. Or at least attempted, with the possibility of breaking the bridges or loosing the hooks...