From 1a90586f0820e65161fee1133e90d6bc169208b4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 6 May 2021 15:09:46 +0300 Subject: [PATCH 51/51] AI: Increase want for improvement provided gold when tax rate high Improvement provided gold is often negative as maintenance cost is included. The high tax rate indicates that there's gold shortage that runs it high, and we should avoid making situation worse. Ideally we even improve the situation and make it possible to lower the tax rate in the future. Especially with civ2civ3 ruleset AI has often ended to permanent 100% tax rate with no attempt to resolve the situation. Reported by chippo See osdn #42191 Signed-off-by: Marko Lindqvist --- ai/default/daicity.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ai/default/daicity.c b/ai/default/daicity.c index 260c0b9e33..fd957c5278 100644 --- a/ai/default/daicity.c +++ b/ai/default/daicity.c @@ -1412,7 +1412,7 @@ adv_want dai_city_want(struct player *pplayer, struct city *acity, memset(prod, 0, O_LAST * sizeof(*prod)); if (NULL != pimprove - && adv->impr_calc[improvement_index(pimprove)] == ADV_IMPR_CALCULATE_FULL) { + && adv->impr_calc[improvement_index(pimprove)] == ADV_IMPR_CALCULATE_FULL) { struct tile *acenter = city_tile(acity); bool celebrating = base_city_celebrating(acity); @@ -1461,7 +1461,15 @@ adv_want dai_city_want(struct player *pplayer, struct city *acity, } want += prod[O_LUXURY] * adv->luxury_priority; want += prod[O_SCIENCE] * adv->science_priority; - want += prod[O_GOLD] * adv->gold_priority; + if (pplayer->economic.tax > 50) { + /* Increased tax rate indicates that we've had gold shortage which + * we are trying to fill with taxes. Consider gold more critical + * than usually. + * Smallest tax rate we can have here is 60% -> factor (60 - 40) / 14.0 = 1.43 */ + want += prod[O_GOLD] * adv->gold_priority * (pplayer->economic.tax - 40) / 14.0; + } else { + want += prod[O_GOLD] * adv->gold_priority; + } return want; } -- 2.30.2