CivII rules of connectivity (for caravan/freight bonuses, traderoute outputs and waste):
First, yet untested, patch. While I have started a topic on what should "direct path" look alike, I have done it with the simplest realization. It yet works with mostly hardcoded CivII rules (e.g. 22 tiles distance max) that should be unhardcoded later.
Maybe something should be done with const modifiers around step_towards() function, I got lost in them.
Attached a patch rebased against current main branch.
These features would require too much work to make it to 3.2 at this point.
A sidekick of #45946, to test some things on a simpler case (no need of caching or iterative pathfinding). Make a requirement for CivII style connectivity, i.e., that a given unit class may walk from target city to target tile by a crow flight trajectory (FYI, CivII path pattern diagram may be seen here but we'll hardly reproduce it precisely). Additionally to this requirement, we introduce ruleset parameters:
We'll need to include tile (of the nearest gov center) parameter into Output_Waste_Pct effect and introduce Surplus_Waste effect (see #42246) to actually remake CivII rules (-2/3 of shields waste if a direct road to gc ~applied over halving by Courthouse~ but only surplus shields are subject to waste). That all is for another tickets.