# [Freeciv-Dev] [bug #21437] Autosettlers ignoring special resources (mining hills without coal when coal is available)

Follow-up Comment #8, bug #21437 (project freeciv):

This is caused by the benefit given for tiles that produce at least one of
something in city_tile_value().

Under Despotism with no techs in classic ruleset, tiles have the following
values:

Hills: 1/0/0  == weighted score 37 (25+12)
Hills/Mine: 1/2/0 == weighted score 107 (25+12+56+14)
Hills/Coal: 1/2/0 == weighted score 107 (25+12+56+14)
Hills/Coal/Mine: 1/4/0 == weighted score 163 (25+12+112+14)

So, the autosettler sees the improvement from Hills to Hills/Mine as
providing 70 points of goodness, and the improvement of Hills/Coal to
Hills/Coal/Mine only providing 56 points of goodness.  Unless there is a
significant time difference involved that affects the amortization of the
goodness, then the worker thinks it is obviously better to improve the
non-coal hills, because this makes the shield value greater than 0, while
providing the same total benefit otherwise.

Note that this isn't quite enough to override the working flag.  If the
city isn't working the tiles, the points are halved, so 35 and 28.  Since 35
is less than 56, a worked coal tile would get mined before an unworked
non-coal Hills.

For comparison, irrigation of grassland goes from 2/0/0 to 3/0/0 under the
same conditions, so 62->87 (25 points), so won't be done until all the hills
are mined (even if they remain unworked).  Adding a road to grassland is
similarly unappealing (2/0/0 to 2/0/1 is 62->84 (22 points), and would happen
only after all the mines are in place, and irrigation done for all worked
tiles (preference is mine(non-coal), mine(coal), irrigation(worked),

As a result, given a city with the classic ruleset given a mix of
grassland and hills, autosettlers would always choose to work the hills,
regardless of whether they were used, and prefer to work the non-coal hills to
the coal hills, except in the event that the city governor happened to decide
to work a coal hill before all the non-coal hills were mined, in which case
that coal hill would be mined before continuing to other non-coal hills.  That
said, if at least one non-coal hill has been mined before the city governor
decides it needs shields, the city governor won't see any difference between
the mined non-coal hills and the unmined coal hills, so there's even chances
of selecting either.

To address this, the weightings can be adjusted more again, the benefit of
giving at least one of something to a tile can be reduced, or the city
governor can be hinted to prefer tiles with greater future capacity to tiles
without (so in this contrived case, the governor would always choose unmined
Coal over mined non-Coal).  My thought is that it would be good to reduce the
benefit of having at least one point enough to encourage autosettlers to
irrigate worked grassland before mining unworked hills, and to adjust the city
governor to consider the future potential benefit of tiles when they are
otherwise equivalent when selecting which tiles to work, while leaving
weighting the same.

_______________________________________________________

<http://gna.org/bugs/?21437>

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

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