Some insight into why AI is so bad?

konokono

Chieftain
Joined
Jan 5, 2020
Messages
41
In my current Egypt game, I was wondering why my conquered Chinese cities had such little production.... and as I tried to look for ways to increase production, I noticed something that might explain why the AI lags so badly in the mid/late game...

If you take a look at the screenshot, you'll notice that the AI's cities barely have any production tiles. And if you look even closer, it's because they had built a number districts on hills, and some on plains. (I was wondering why I couldn't find any hills to build mines on to improve production)

For example, in this one screenshot you can count 2 holy sites built on plains hills, an encampment and a commercial hub built on grasslands hills, a holy site and a commercial hub built on plains, and even an unimproved stone tile. If the AI is going to waste its hills on districts and not prioritize production tiles, it's easy to see why they would start lagging behind! Especially if it looks like they cleared a bunch of their forests to build farms too.

I wonder if a simple AI tweak to let the AI prioritize production improvements and prioritize plain grassland for districts would help them? Of course, doing that is well outside my non-existent modding abilities

civ6.png
 
Just from my general observation, the generic AI has an obsession with pop growth for some reason (perhaps a carryover from civ5.)
They love farming, and they really love housing and amenity policy cards. Often times on high difficulty, I encounter their cities at or near the housing cap. Which is strange - unlike civ5, they don't get the massive growth bonuses they used to get.
And we see that play out in this image. I don't think it's a lack of production focus so much as an overstated growth focus. The policy cards they slot really kill them mid game, because they'll never run Rationalism type stuff (aka, all the good econ cards) over their beloved medina quarter.
 
I have also noticed unimproved resources quite a few times, even in the heart of their empire at their oldest cities.
Actually one of the reasons I'm not a big fan of going for domination is having to fix the mess they make of their cities...
 
I have also noticed unimproved resources quite a few times, even in the heart of their empire at their oldest cities.
Actually one of the reasons I'm not a big fan of going for domination is having to fix the mess they make of their cities...
I try to appreciate the designs of the developers. I prefer vanilla to modded experiences most of the time. But so help me, the things I would do to be able to remove and rebuild districts in the disaster zone that is AI city planning...
 
Just from my general observation, the generic AI has an obsession with pop growth for some reason (perhaps a carryover from civ5.)
They love farming, and they really love housing and amenity policy cards. Often times on high difficulty, I encounter their cities at or near the housing cap. Which is strange - unlike civ5, they don't get the massive growth bonuses they used to get.
And we see that play out in this image. I don't think it's a lack of production focus so much as an overstated growth focus. The policy cards they slot really kill them mid game, because they'll never run Rationalism type stuff (aka, all the good econ cards) over their beloved medina quarter.

Well, the AI likes to do whatever it can do right now. It gives little thought to what it needs to be doing in twenty or fifty or one hundred turns. It likes to farm because it can farm right away. It likes to chop because it can chop right away. They aren't looking to wait for lumber mills or to hold a chop in reserve for a critical district.

And then there's the wonder spam, where they will build damn near any wonder they can build, rather than pursue wonders for any strategic purpose. If you play a game with a large number of AI civ's, they're all trying to build the same wonders, and only one at most gets to have it. So, it seems the devs accept that whenever the AI is not at war it's building wonders simply as a way to mark time.

I try to appreciate the designs of the developers. I prefer vanilla to modded experiences most of the time. But so help me, the things I would do to be able to remove and rebuild districts in the disaster zone that is AI city planning...
I mean....Yeah.

How hard is it to program a bias towards building a commercial hub next to a river?
 
Last edited by a moderator:
So the thing that surprised me most and made me make this thread isn't just the abundance of farms or poor district placement.

But it's their specific choice to build districts on hills, and some of the most productive hills for that matter! I mean, most experienced players know how valuable a plains-hill is, and yet the AI chose to put holy sites there when many other tiles would have served fine.

Does anyone else notice a tendency for AIs to put districts on hills? Or is this a sample size of 1? Because I never really looked before this game
 
So the thing that surprised me most and made me make this thread isn't just the abundance of farms or poor district placement.

But it's their specific choice to build districts on hills, and some of the most productive hills for that matter! I mean, most experienced players know how valuable a plains-hill is, and yet the AI chose to put holy sites there when many other tiles would have served fine.

Does anyone else notice a tendency for AIs to put districts on hills? Or is this a sample size of 1? Because I never really looked before this game
I have not noticed such a tendency, and the thing about the screenshot that makes it not such a good example is that it is on the whole a very poor hand to play with. No mountains, no rivers, no lakes, no natural wonders--nothing to build adjacency bonuses around, nothing to hook an aqueduct up to. I mean, if it had a bunch of terrain like that, it would be a good candidate for a re-roll. China doesn't even show that many districts at all, mostly some holy sites. Off-hand, I'd tend to think it was just trying to avoid removing terrain features or improvements.
 
I think a bigger problem is that the logic for settling cities regressed quite a bit when the improved city location suggestions were added. And, I think the AI just picks one of those bad suggestions most of the time. They'll frequently settle where they can't get fresh water or an aqueduct, for instance. Then, they have no choice but to increase housing through other means (farms), which means less production, and so on. Fix the settling logic first, then worry about the rest.
 
I have not noticed such a tendency, and the thing about the screenshot that makes it not such a good example is that it is on the whole a very poor hand to play with. No mountains, no rivers, no lakes, no natural wonders--nothing to build adjacency bonuses around, nothing to hook an aqueduct up to. I mean, if it had a bunch of terrain like that, it would be a good candidate for a re-roll. China doesn't even show that many districts at all, mostly some holy sites. Off-hand, I'd tend to think it was just trying to avoid removing terrain features or improvements.

Yes, I wonder if it is inadvertently due to them spamming farms, and then not wanting to remove them, and thus placing districts on hills. I may want to experiment a little and watch AI behavior and see how they choose improvements / district placement / settler location.
 
I think a bigger problem is that the logic for settling cities regressed quite a bit when the improved city location suggestions were added. And, I think the AI just picks one of those bad suggestions most of the time. They'll frequently settle where they can't get fresh water or an aqueduct, for instance. Then, they have no choice but to increase housing through other means (farms), which means less production, and so on. Fix the settling logic first, then worry about the rest.
Well, the AI is clearly fixated on tight three-apart ICS-style settles more than it is with fresh water or other helpful terrain features. It's a quantity-over-quality approach, which can actually help with maximizing adjacency bonuses because all your districts should be squashed together. But instead, the AI settles tightly, then scatters its districts.
 
see how they choose improvements / district placement / settler location.
What may seem simple enough with a practised eye is often much harder to code well and if the decision tree says they need more food they will build a farm regardless of the suitability of the city.
You may disagree but so many starts are posted where we humans chose a different location from each other, what hope to the coders have?
 
I really appreciate your insight and effort to make a thread out of it. From the looks of it, it really looks like you ara correct. I hope that some dev give a closer look to this, and if we get a final patch for Civ 6, that this very questionable coincidence gets fixed.
 
I mean....Yeah.

How hard is it to program a bias towards building a commercial hub next to a river?

I'm pretty sure the AI does that. The AI seems to build on whatever "best" tile is available without purchasing a tile, like a casual player that plays with zero planning and just put the district in whatever tile that shows a bigger number, always considering only the adjacency of the district being currently built. You will find a lot of Commercial Hubs near rivers in AI cities, since it's common to have river adjacent or near the city center, guaranteeing that it will be available when the AI decide to build a commercial hub. It's harder to find campus and holy sites in good positions, since it's common for the good tiles to be unavailable when the AI decide to build it.

Notice that every holy site in this image is adjacent to woods and the commercial hubs are adjacent to districts (there's no rivers). The AI seems to look for minor adjacency even when they can't close a pair, which helps them when they go for district adjacency since they can close a triangle later, as they did in this image, but lead to some pretty bad positioning when it's other minor adjacency, like the woods in this image, which seems to take priority over districts. The Holy sites are all over the place because the woods are all over the place and there's no mountains. The Theater Square is near a wonder, which would be the "best" tile available.

I don't know how much the AI affects performance, but I assume the AI doesn't do more complex planning because it would make the turns take longer, so they just look for the "best" adjacency, which seems like a relatively simple task for the AI that doesn't take a lot of processing and can achieve good results often enough. The way I see it, as someone who has no idea how AI programming works, it isn't a matter of being easy or hard to program, it's a matter of how long the player is willing to wait for the AI to "think", and that isn't long, so they need to compromise.
 
This is certainly just dumb luck, but here is an example of the AI actually being quite awesome on their district positioning:

289070_screenshots_20191103020953_1.jpg


You can see in Mbanza Kongo:

- Commercial hub adjacent to river and 3 districts;
- Campus adjacent to 3 mountains and a Geothermal Fissure in a third ring tile;
- One Theater square adjacent to 2 wonders and 2 districts, and another adjacent to 1 wonder and 2 districts
- Both wonders have fairly complicate placement rules. Alhambra must be built on a hill adjacent to an encampment and Oxford must be build on flat Grasslands or Plains adjacent to a Campus district with a University.

Somehow the AI managed to fit it all together, but just notice how fragile the whole thing is. If the AI had prioritized a campus in early game, you can bet they would build it near that jungle and waste that +5 adjacency tile. If it was a Civ that can build holy sites, they could just as easily have built a holy site there.
 
With every iteration of Civ, the AI seems to get worse.

At the same time, every iteration has more features and more complex gameplay mechanics.

So maybe the AI is getting worse simply because it's harder to program when the complexity of the game increases.

Which makes me wonder if it's worthwhile adding more and more features with every new game, if that implies a poor AI. I don't think it pays off, because the quality of AI is crucial to have an enjoyable and interesting gameplay, and if you feel like your opponents act dumb all the time, I'd rather have a simpler gameplay but with more challenging opponents.
 
Which makes me wonder if it's worthwhile adding more and more features with every new game, if that implies a poor AI.
I think iirc FXS doesn't maintain a deep bench of AI talent - they have 1 or 2 actual AI guys - because honestly the payoff isn't very high to invest more resources into it for most games. (This is because not many players as a % of all players actually play higher difficulty, and they already buy the game.)

But there's a ton of headroom available if they were to sit down and tune the AI to actually be more competitive. This is basically just taking the time to look at the meta and having the AI roughly follow parts of it. IE - these units or policy cards or wonders suck, don't build them. This tech path is very good, pre program that in. Even something like "Always farm open flat land and always mine hills" can get them great mileage. It's not really too dumb, it's just ineffective at some things - and possibly because they tried to make it smart.
 
Top Bottom