Ticket #46051

Implement direct connectivity

오픈 날짜: 2022-11-09 09:04 마지막 업데이트: 2024-07-30 20:54

Reporter:
소유자:
(None)
Type:
Status:
Open
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
None
File:
2

Details

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:

  • minimal dipl.rel. with a unit to pass through a tile,
  • minimal dipl.rel. with a city to pass through a tile,
  • minimal dipl.rel. with a tile owner to pass through a tile,
  • may we pass through cities/bases lacking native terrain or road,
  • unit class maximal connecting distance.

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.

Ticket History (3/10 Histories)

2022-11-09 09:04 Updated by: ihnatus
  • New Ticket "Implement direct connectivity" created
2022-11-09 09:06 Updated by: ihnatus
  • Details Updated
2022-11-09 09:11 Updated by: ihnatus
  • Details Updated
2022-11-09 21:08 Updated by: ihnatus
댓글 올리기

CivII rules of connectivity (for caravan/freight bonuses, traderoute outputs and waste):

  • non-allied military units block paths;
  • cities without rail are not included in the path;
  • (at least for traderoute annual) path is determined destination to source;
  • maximal road/rail distance checked is 22;
  • (a bug not to reproduce) any city of source civ met in the path is counted as reaching the end.
2022-11-12 07:15 Updated by: ihnatus
댓글 올리기

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.

(Edited, 2022-11-12 07:17 Updated by: ihnatus)
2024-05-12 07:19 Updated by: cazfi
댓글 올리기

Attached a patch rebased against current main branch.

2024-05-12 07:35 Updated by: cazfi
  • Type Update from Bugs to Patches
2024-07-30 20:54 Updated by: cazfi
댓글 올리기

These features would require too much work to make it to 3.2 at this point.

Attachment File List

Edit

Please login to add comment to this ticket » Login