Ticket #42221

AI does not conquer cities back from barbarians

Open Date: 2021-05-11 19:04 Last Update: 2023-03-14 19:37

5 - Medium
5 - Medium


AI nations usually get completely consumed by barbarians, if barbarians are lucky enough to conquer one city as beachhead. Barbarians do conquer further cities, but AI players very rarely conquer them back. Likely this is because barbarians sell buildings from the cities they have conquered, and that makes AI want for those cities too low.

Ticket History (3/12 Histories)

2021-05-11 19:04 Updated by: cazfi
  • New Ticket "AI does not conquer cities back from barbarians" created
2021-05-11 19:07 Updated by: cazfi
  • Type Update from Patches to Bugs
2021-05-13 11:42 Updated by: cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 2.6.5 (closed)
2021-05-13 17:23 Updated by: chippo

I see that the Pirates regularly leave their conquered cities unguarded (easy pickings for me, especially since they are often coastal), whereas the normal AIs don't.

Are the Pirates under-guarding their cities BECAUSE the other AIs leave them alone?

2021-06-02 23:11 Updated by: cazfi
2021-07-13 14:17 Updated by: cazfi
  • Resolution Update from Accepted to None

The patch seems not to resolve the issue with barbarian cities. For some reason AI still does not take those cities back.

I think the patch is a right thing to do in general, though, just not a solution to this particular problem in this ticket -> will open a new ticket for handling this existing patch.

2021-08-31 09:42 Updated by: cazfi

will open a new ticket for handling this existing patch.

-> #42778

2023-02-28 22:26 Updated by: alain_bkr

In 3.0.6 the problem is still here.

I took back several empty (no units) cities from barbarians, but AI had something like 50 or 100 turn to do the same before me. The cities were 4 to 6 in size.

I 'll get a try to the patch to check it.

(Edited, 2023-03-01 00:13 Updated by: alain_bkr)
2023-02-28 22:26 Updated by: alain_bkr
(This comment has been deleted)
2023-03-14 19:37 Updated by: alain_bkr

I don't understand your patch

+/* Size 1 city gets destroyed when conquered. It's still a good thing
+ * stop enemy from having it. */
+#define CITY_CONQUEST_WORTH(_city_, _data_) \
+  (_data_->worth * 0.9 + (city_size_get(_city_) - 0.5) * 10)

1. It can reduces the desire :

 new = old * 0.9 +  10 * size - 5
 new < old   <=> old > 100 size - 50  

so we decrease worth  if :
size = 1 and previous worth > 50
s = 2 ,   w > 150
s = 3 ,  w > 250 

2. Won't it be better to just increase worth = intrinsic value of a city where it is calculated

Here we consider military action, but there are other way to get a city (buy it with spy, exchange it, maybe other )

(Edited, 2023-03-15 23:00 Updated by: alain_bkr)


You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login