patchFreeciv - Patches: patch #3900, Consolidate UTYF_IGTER logic

 
 
Show feedback again

patch #3900: Consolidate UTYF_IGTER logic

Submitted by:  Emmet Hikory <persia>
Submitted on:  Wed 08 May 2013 07:18:26 AM UTC  
 
Category: aiPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: pepeto <pepeto>Open/Closed: Closed
Planned Release: 2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Thu 23 Jan 2014 09:14:12 PM UTC, SVN revision 24222:

Consolidate UTYF_IGTER logic in pathfinding.

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

See gna patch #3900

(Browse SVN revision 24222)

pepeto <pepeto>
Project MemberIn charge of this item.
Tue 14 Jan 2014 11:29:59 PM UTC, comment #1:

Patch updated against current trunk. It also removes unused function in pf_tools.c which have been added very long time ago (when the module was created), never used, will never be used, and that don't compile for ages.

(file #19750)

pepeto <pepeto>
Project MemberIn charge of this item.
Wed 08 May 2013 07:18:26 AM UTC, original submission:

UTYF_IGTER movement for pathfinding is handled in three different ways in three different places, and entirely ignored in other places. Precisely which sorts of movement receive IgTer benefits, which sorts have costs independent of IgTer, and which may benefit from IgTer depending on other conditions is somewhat complex, and so best handled in a single place with a single function to ensure consistency.

This patch does just that, moving all movement-cost related handling of UTYF_IGTER to tile_move_cost_ptrs(). Other uses (e.g. establishing relative desire for a unit based on the IgTer flag in the AI) are unchanged. Behaviour changes are all attributable to differences in pathfinding results: prior handling sometimes assigned MOVE_COST_IGTER in cases where SINGLE_MOVE would have been charged for actual unit attack/movement, sometimes the precise opposite, and often entirely ignored the possibility of differences between UTYF_IGTER units and other units (e.g. ferry passerger handling, attack planning, etc.).

Any remaining issues with incorrect pathfinding move costs for UTYF_IGTER units are likely to either represent intended behaviour changes (and be confined to tile_move_cost_ptrs()), or indicate more general problems with move cost calculation in the relevant get_MC callbacks. Nothing should change for callers of map_move_cost_unit() other than the ordering of calls (the presence of the flag is checked a bit earlier in the execution path).

The patch attached depends on patch #3886, patch #3837, and patch #3897 , but mostly for syntactical reasons. #3886 introduces the "igter" boolean to tile_move_cost_ptrs(): without this the current patch would need to use the argument rather than checking the unit flag in the relevant conditional. #3837 changes the logic for some unit class and unit type flags without which this patch cannot delete the removed functions. #3897 introduces slow_invasions handling for igter_move_unit(), which is identified for deletion. If this is considered more useful than any of those, I would be happy to change the dependency order.

Emmet Hikory <persia>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #19750:  pf_igter.diff added by pepeto (10kB - text/x-diff)
file #17924:  consolidate-UTYF_IGTER-logic.patch added by persia (10kB - application/octet-stream)

 

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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 23 Jan 2014 09:15:07 PM UTCpepetoStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Tue 14 Jan 2014 11:29:59 PM UTCpepetoAttached File-=>Added pf_igter.diff, #19750
      StatusNone=>Ready For Test
      Planned Release=>2.6.0
    Wed 08 Jan 2014 12:38:43 PM UTCpepetoAssigned toNone=>pepeto
    Wed 08 May 2013 07:18:26 AM UTCpersiaAttached File-=>Added consolidate-UTYF_IGTER-logic.patch, #17924
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup