bugFreeciv - Bugs: bug #21871, Pathfinding handles pontoon...

Show feedback again

bug #21871: Pathfinding handles pontoon bridges poorly

Submitted by:  Emmet Hikory <persia>
Submitted on:  Fri 28 Mar 2014 10:12:49 AM UTC  
Category: aiSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: pepeto <pepeto>Open/Closed: Closed
Release: Operating System: Any
Planned Release: 2.5.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Thu 15 May 2014 02:56:06 PM UTC, SVN revision 24889:

Improves how pathfinding handles pontoon bridges:

  • Check transport only of they don't have orders (else, they would move and the

paths wouldn't be right) ;

  • Check transport potential capacity instead of real one.

Patch by Emmet Hikory (persia@gna) with changes by me

See gna bug #21871

(Browse SVN revision 24889)

pepeto <pepeto>
Project MemberIn charge of this item.
Mon 12 May 2014 12:17:07 PM UTC, comment #4:

New version of the patch: remove unnecessary check for unit_owner() = param->owner (duplicate of pplayers_allied()).

(file #20728)

pepeto <pepeto>
Project MemberIn charge of this item.
Wed 16 Apr 2014 10:39:13 PM UTC, comment #3:

During review of patch #3901, pepeto and I decided to only fix this in S2_5, and address this issue in a different manner in that patch.

Emmet Hikory <persia>
Project Member
Wed 16 Apr 2014 10:23:00 AM UTC, comment #2:

The improved patch works for me on trunk, and should be significantly faster when handling tiles with many units. Thanks for the improvements.

Emmet Hikory <persia>
Project Member
Wed 16 Apr 2014 08:17:13 AM UTC, comment #1:

Improved patch:

  • Stops iteration if a potential transporter is found ;
  • Cosmetic changes such as spacing, indenting and new lines.

(file #20516, file #20517)

pepeto <pepeto>
Project MemberIn charge of this item.
Fri 28 Mar 2014 10:12:49 AM UTC, original submission:

When determining if a pontoon bridge will be available for use for a future move in pathfinding, the current capacity is checked, without regard to the expected future capacity based on the current orders of units using the bridge. Further, there is no confirmation that the transport apparently providing a pontoon bridge is expected to remain at the target location in the future.

Due to discrepancies between the current conditions and the conditions that will apply at the time the path is actually used, there are two possible situations: either a path is calculated, and the unit stops being able to continue on the path at some point (circumstances have changed), or the path is asserted to be invalid, even when the unit would be able to continue on the path were it started.

Attached is an artificial one-player savegame demonstrating the issue. Ordering the Explorer to GoTo either of the Ruins in the client will expose the two behaviour issues (progress the game by a couple turns to watch). Also attached is a patch tested with r24736 that permits the path in the case where there is an expectation of success, and blocks the path in the case where there is an expectation of failure.

Emmet Hikory <persia>
Project Member


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by pepeto (Updated the item)
  • -unavailable- added by persia (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 15 May 2014 02:56:17 PM UTCpepetoStatusReady For Test=>Fixed
    Mon 12 May 2014 12:17:07 PM UTCpepetoAttached File-=>Added S2_5-improve-pontoon-bridge-handling-in-patchfinding2.patch, #20728
    Wed 16 Apr 2014 10:39:13 PM UTCpersiaPlanned Release2.5.0,2.6.0=>2.5.0
    Wed 16 Apr 2014 08:17:13 AM UTCpepetoAttached File-=>Added trunk-improve-pontoon-bridge-handling-in-patchfinding.patch, #20516
      Attached File-=>Added S2_5-improve-pontoon-bridge-handling-in-patchfinding.patch, #20517
      StatusNone=>Ready For Test
      Planned Release=>2.5.0,2.6.0
    Thu 03 Apr 2014 03:30:30 PM UTCpepetoAssigned toNone=>pepeto
    Fri 28 Mar 2014 10:12:49 AM UTCpersiaAttached File-=>Added transport-capacity-demo.sav.gz, #20447
      Attached File-=>Added improve-pontoon-bridge-handling-in-patchfinding.patch, #20448
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup