patchFreeciv - Patches: patch #3837, Unify UCF_ATT*NON_NATIVE and...

 
 
Show feedback again

patch #3837: Unify UCF_ATT*NON_NATIVE and relevant type flags

Submitted by:  Emmet Hikory <persia>
Submitted on:  Sun 07 Apr 2013 12:27:23 PM UTC  
 
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.3.5, 2.4.0, 2.5.0, 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.

 

(Jump to the original submission Jump to the original submission)

Sun 26 May 2013 08:52:53 AM UTC, SVN revision 22899:

Fixes to hardcoded assumptions about attack capability in relation to
tile nativity.

Patch by Emmet Hikory

See patch #3837

(Browse SVN revision 22899)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 26 May 2013 08:52:47 AM UTC, SVN revision 22898:

Fixes to hardcoded assumptions about attack capability in relation to
tile nativity.

Patch by Emmet Hikory

See patch #3837

(Browse SVN revision 22898)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 26 May 2013 08:52:41 AM UTC, SVN revision 22897:

Fixes to hardcoded assumptions about attack capability in relation to
tile nativity.

Patch by Emmet Hikory

See patch #3837

(Browse SVN revision 22897)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 26 May 2013 08:52:34 AM UTC, SVN revision 22896:

Fixes to hardcoded assumptions about attack capability in relation to
tile nativity.

Patch by Emmet Hikory

See patch #3837

(Browse SVN revision 22896)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 19 Apr 2013 09:34:03 AM UTC, comment #7:

Then I'm just confused, and this should work for S2_4.

(file #17769)

Emmet Hikory <persia>
Project Member
Fri 19 Apr 2013 07:41:21 AM UTC, comment #6:

S2_4: Umh, but before 2.5 city tile always had road, no matter the terrain.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 19 Apr 2013 05:50:58 AM UTC, comment #5:

Patch attached for S2_3. The pf_tools functions are not adjusted, as the nature of the flags in question don't have much meaning for UMT_LAND units (which restriction is imposed by pft_fill_parameter()).

For S2_4, I'm much less certain of the correct solution. It seems to be possible to build a "Big Land" unit on non-native terrain (e.g. forest/river), which unit then cannot move until the Bridge Building technology is known (at which point the city gets a road, which makes it native, so that the check is irrelevant). In the absence of UCF_ATT_FROM_NON_NATIVE, I'm unsure of the correct logic to use for the pf_tools checks to allow an e.g. Catapult to attack an adjacent square when there is yet no road available in the city to make the tile native, even if the adjacent square is native to Catapults. Suggestions welcome.

(file #17767)

Emmet Hikory <persia>
Project Member
Sat 13 Apr 2013 01:21:43 AM UTC, comment #4:

Makes sense. I'll prepare some similar branches for S2_4 and S2_3, with less focus on "nativity", but rather focusing on ensuring that there aren't too many assumptions preventing defining e.g. ships with embedded marine components or similar on the part of ruleset authors.

Emmet Hikory <persia>
Project Member
Thu 11 Apr 2013 12:30:18 AM UTC, comment #3:

I think lack of some of the checks you add here are actually bugs in stable brances too. Where you now check for UCF_ATTACK_FROM_NON_NATIVE, old versions should check for sea moving units (attack out from harbour city) etc.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 07 Apr 2013 01:21:46 PM UTC, comment #2:

And excitingly, the files matched precisely before and after the patch. I'll be sure to also check this way when I do not expect a behavioural difference.

Emmet Hikory <persia>
Project Member
Sun 07 Apr 2013 12:42:43 PM UTC, comment #1:

Just a note that if you expect there to be no changes in autogames for some ruleset with some patch, check just that. Run autogame with same gameseed and mapseed before and after the patch and compare md5sums of their final savegames. With current versions you need to set also "ec_turns" to 0 to avoid savegames having message caches with different timestamps.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 07 Apr 2013 12:27:23 PM UTC, original submission:

There were a few places in the code that the logic in can_attack_non_native() and can_attack_from_non_native() were duplicated. There were a couple cases in helpdata.c where the helper functions would be wrong (need to differentiate the class flag from the unit flag). Also, the AI seemed to assume that no unit capable of being on land would ever have UCF_ATTACK_FROM_NON_NATIVE, so relied exclusively on UTYF_MARINES. Unfortunately, in pf_tools.c it proved impossible to fix these without major surgery, so I just reviewed the usage, and ensured that both the class flags and type flags were checked in every case. In watching autogames, I didn't see any pronounced increase in the AI's usage of boats when it ought to have selected Marines, so I don't believe this has a negative impact for rulesets with classical nativity.

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 #17702:  unify-ATT*NON_NATIVE.patch added by persia (6kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by cazfi (Posted a comment)
  • -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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 26 May 2013 08:53:02 AM UTCcazfiStatusReady For Test=>Done
      Open/ClosedOpen=>Closed
    Wed 08 May 2013 10:16:09 PM UTCcazfiStatusNone=>Ready For Test
      Assigned toNone=>cazfi
      Planned Release=>2.3.5, 2.4.0, 2.5.0, 2.6.0
    Fri 19 Apr 2013 09:34:03 AM UTCpersiaAttached File-=>Added S2_4-use-can_attack-foo-functions-more.patch, #17769
    Fri 19 Apr 2013 05:50:58 AM UTCpersiaAttached File-=>Added S2_3-use-can_attack-foo-functions-more.patch, #17767
    Sun 07 Apr 2013 12:27:23 PM UTCpersiaAttached File-=>Added unify-ATT*NON_NATIVE.patch, #17702
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup