I wanted to have a base provide an Output_Bonus effect, but unfortunately
the AI can't deal with that, mostly because we don't have enough context in
city_tile_output() to do anything useful with EFT_OUTPUT_BONUS, and there isn't
any other good place in the base-value calculation codepath to put this.  In
the absence of such handling, I have seen autosettlers transform a tile to
gain a +1 in production in such a way that it removed a base that was causing
the city to gain +8 (for a total benefit of -7).

    Since it is perfectly possible to define this class of infrastructure in
the ruleset, it would be nice if, as the design for extras develops, it
could include some means to usefully consider this type of effect also as
part of autosettlers value calculations.

    The main issue being that while we can determine the total value being
gained from the presence of such a base, we cannot determine if that base
would be better placed on a different tile (such effects must be defined
using a range of "City", so the application is boolean, rather than related
to the number of bases used), or if building a base would add/remove the
effect from the city (there may already be another, so it is safe to
remove this one, or not to build one).  It may be possible to perform such
activities using iterators to determine count, or some algorithm to pick
the best tile for that sort of infrastructure (considering the potential
conflicts and where we don't care if we place something else, or where
multiple cities may use it, or where it is unlikely to be pillaged), but
as I thought about it more, it seemed fairly invasive to try to implement,
and the temptation to mirror for roads large enough that it ought be
postponed for extras.

    There is an exceptional case that could be easily coded, if one defines
the effect with a range of "Local", verifies that one is on the city center
in city_tile_output(), and if so applies the total value, but in that case
it is probably easier to set the base to AutoCityCenter and nobuild, and
have it become enabled when some improvement is completed, rather than as
a settler action.  For that matter, the ruleset is easier to write if one
chooses to apply the effect directly from the improvement, which already just
works, so the exceptional case isn't very interesting, despite being easy
to code.

    Note that one can similarly use combinations of bases/roads and
improvements to cause the farmland/supermarket problem to occur, so if
a good solution to that deadlock is found, it may also be applicable here
(where good is defined as better than forcing discovery through tech
tree alterations, and autogenerating farmland on city centers such that
the AI then notices the improvement will give a bit more food, prompting
the building, which then prompts the AI to generate farmland, which just
feels way too heavy-handed to me).

-- 
Emmet HIKORY

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

Reply via email to