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 Apr 7 12:27:23 2013  
 
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.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.

 

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

Sun May 26 08:52:53 2013, 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 May 26 08:52:47 2013, 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 May 26 08:52:41 2013, 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 May 26 08:52:34 2013, 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 Apr 19 09:34:03 2013, comment #7:

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

(file #17769)

Emmet Hikory <persia>
Project Member
Fri Apr 19 07:41:21 2013, 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 Apr 19 05:50:58 2013, 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 Apr 13 01:21:43 2013, 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 Apr 11 00:30:18 2013, 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 Apr 7 13:21:46 2013, 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 Apr 7 12:42:43 2013, 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 Apr 7 12:27:23 2013, 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.

     

    Error: not logged in

     

     

    Follow 8 latest changes.

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

    Back to the top


    Powered by Savane 3.1-cleanup