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 Mar 28 10:12:49 2014  
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 May 15 14:56:06 2014, 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 May 12 12:17:07 2014, 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 Apr 16 22:39:13 2014, 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 Apr 16 10:23:00 2014, 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 Apr 16 08:17:13 2014, 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 Mar 28 10:12:49 2014, 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 May 15 14:56:17 2014pepetoStatusReady For Test=>Fixed
    Mon May 12 12:17:07 2014pepetoAttached File-=>Added S2_5-improve-pontoon-bridge-handling-in-patchfinding2.patch, #20728
    Wed Apr 16 22:39:13 2014persiaPlanned Release2.5.0,2.6.0=>2.5.0
    Wed Apr 16 08:17:13 2014pepetoAttached 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 Apr 3 15:30:30 2014pepetoAssigned toNone=>pepeto
    Fri Mar 28 10:12:49 2014persiaAttached 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