Summary: Consider nativity for is_square_threatened()
Submitted by: persia
Submitted on: Sat 20 Apr 2013 06:32:27 AM JST
Priority: 5 - Normal
Assigned to: None
Discussion Lock: Any
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
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.
Date: Sat 20 Apr 2013 06:32:27 AM JST Name:
square-threatened-consolidation.patch Size: 3kB By: persia
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list