URL:
  <http://gna.org/patch/?3854>

                 Summary: Consider nativity for is_square_threatened()
                 Project: Freeciv
            Submitted by: persia
            Submitted on: Sat 20 Apr 2013 06:32:27 AM JST
                Category: general
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 

    _______________________________________________________

Details:

The current implementation of is_square_threatened() relies on a function
called is_ground_threat() with embedded nativity assumptions (using
is_ground_unit()).  The attached patch removes the is_ground_threat() function
(which has no other callers), replacing it with similar logic inside the
is_square_threatened conditional.

The replacement logic is then extended in three ways:
1) The tile is not considered threatened if the potentially threatening unit
is not considered an attack unit (attack strength == 0).  There is no value in
fearing a unit that cannot cause damage.
2) The tile is not considered threatened if the potentially threatening unit
is either not native to the tile unless that unit can attack non-native tiles
AND there is adjacent native terrain.  There is no value in fearing a unit
that cannot attack the tile in question.
3) The tile is not considered threatened by a diplomat unless that diplomat is
able to pass the nativity test described in (2) above.  There is no value in
fearing a diplomat that cannot attack the tile in question.

    In autogame testing, this change showed behavioural differences: for the
classic and experimental rulesets, autosettlers appeared less likely to choose
to improve coastal tiles.  More generally, it seems autosettlers are more
accurately risk-averse and last longer before dying.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sat 20 Apr 2013 06:32:27 AM JST  Name:
square-threatened-consolidation.patch  Size: 3kB   By: persia

<http://gna.org/patch/download.php?file_id=17774>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?3854>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to