patchFreeciv - Patches: patch #4889, Pathfinding refactoring

 
 
Show feedback again

patch #4889: Pathfinding refactoring

Submitted by:  pepeto <pepeto>
Submitted on:  Wed 02 Jul 2014 01:24:47 PM 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.

 

Wed 09 Jul 2014 12:58:35 PM UTC, SVN revision 25467:

Pathfinding refactoring. Main changes are that "can_invade" is now hard-coded,
more calculated values are cached, action handling (for attack, diplomat
actions and trade route establishing) is now open for more control.

See gna patch #4889

(Browse SVN revision 25467)

pepeto <pepeto>
Project MemberIn charge of this item.
Sun 06 Jul 2014 11:39:01 AM UTC, comment #2:

New version:

  • clarify the usage of paranthesizes in pf_get_action() ;
  • split 'enum pf_action' and 'enum pf_action_account' ;
  • fixed node behavior overwrite ;
  • added some comments.

(file #21297)

pepeto <pepeto>
Project MemberIn charge of this item.
Thu 03 Jul 2014 12:10:55 AM UTC, comment #1:

In pf_get_action(), could parentheses be added to the assignment of non_allied_city_tile? I found it surprising to read (also, when assigning as the first call in a function, I prefer assigning in declaration, but not doing that isn't unclear).

Emmet Hikory <persia>
Project Member
Wed 02 Jul 2014 01:24:47 PM UTC, original submission:
  • can_invade() is now hard-coded ;
  • better handling of cached values when the tile is not known (notably at server side without omniscience) ;
  • better action handling, including attacks, diplomat actions and trade route establishing ;
  • cache values previously calculated in pf_is_ok_move_tile() ;
  • handle correctly the case we would want to ignore start tile (then the former behavior is restored) ;
  • handle correctly the case the unit is transported initially and would not return to transported (if it has orders) if returning at start tile.

It speeds up the algorithm considerably. Amphibious moves are not perfectly handled, but it wasn't the case before (not a regression).

pepeto <pepeto>
Project MemberIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #21297:  pf_refactoring2.patch.gz added by pepeto (11kB - application/gzip)
file #21239:  pf_refactoring.patch.gz added by pepeto (11kB - application/gzip)

 

Depends on the following items: None found

Digest:
   patch dependencies.

 

Carbon-Copy List
  • -unavailable- added by persia (Posted a comment)
  • -unavailable- added by pepeto (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
    Wed 09 Jul 2014 12:58:49 PM UTCpepetoStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Sun 06 Jul 2014 06:32:58 PM UTCpepetoDependencies-=>patch #4910 is dependent
    Sun 06 Jul 2014 11:39:01 AM UTCpepetoAttached File-=>Added pf_refactoring2.patch.gz, #21297
      StatusIn Progress=>Ready For Test
    Sun 06 Jul 2014 09:39:43 AM UTCpepetoStatusReady For Test=>In Progress
    Wed 02 Jul 2014 01:24:47 PM UTCpepetoAttached File-=>Added pf_refactoring.patch.gz, #21239
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup