Unbelievable Settling by the AI

sherbz

Deity
Joined
Mar 27, 2009
Messages
2,532
Location
London
Ok this is just a bit ridiculous. But just how or why has Denmark settled like this. Settings are deity so i assume this is his 3rd city. And i am Korea.

:confused:

Spoiler :
 
It is Denmark's 3rd city and the AI forward settled you because it can. The why can be split into 2 theories:
1.) Denmark intends on invading you and/or Polynesia.
2.) They wanted the marble and cocoa.
 
20 Tiles away from his capital! And its not as though he didnt have anywhere to go nearby.
 
This is exactly why you should delay allowing the AI to establish an embassy instead of immediately allowing them.

The area in question is extremely fertile. (2 bonus + 1 luxury all adjoin). And in the Ivory 3 tiles NE of where it settled and the Coca 3 tiles SE of where it settled and it was probably by far the highest fertility score it saw.
 
To add to joncnunn's note, if a city plot is 8 or more tiles away from their closest city, the AI does not care how far the tile actually is from their closest city (be it 20 or be it 8), they will multiply the tile's fertility rating by 2/3. If the AI civ is marked as coastal (Denmark is, IIRC), they will increase the fertility rating of tiles with a positive fertility rating by 25 (roughly equivalent to one extra production in the first tile ring), and then multiply the overall fertility by 2; this means that coastal civs will prefer coastal tiles 20 tiles away to non-coastal tiles 6 tiles away (4/3 multiplier + 33 added fertility vs. multiplier of 1 with no added fertility). Also, the AI will only avoid other player's cities if it has a boldness of 3 or less, and because Denmark's boldness is fairly high, it did not care that Seoul was 5 tiles away from that spot.

phillipwyllie: The AI does not actually settle cities based on who they want to attack; the only bit of their settling algorithm that is close is the bit where AI leader with boldness 8 or higher will multiply the fertility score of tiles within 5 distance of an opponent's city and within 7 distance of their closest city by 3/2. The AI also does not actually consider the types of luxury resources they want when settling a city (eg. they value wine and salt equally, assuming the same base yields), they only care that the tiles contain luxury resources.

If anyone's ever curious about the actual calculations that go into finding a settle plot (both recommended plots and the AI's settlers), CvSiteEvaluationClasses.cpp in the Civ5 DLL source code (included in the SDK) has all the info you need (Init() and PlotFoundValue() are the two main functions). It's also one of the clearest and well-organized bits of the source code, to the point where even someone who doesn't know C++ could read it and understand it (provided they have some programming experience).
 
Just raze it. You can take that city with a few archers and a scout tbh. Better yet, pay Polynesia to war him, and then declare war on him same turn. You'll get a positive diplo boost with Poly, and after capturing/razing that city, be free to get your ~3 expands out freely while Poly is busy at war.
 
Denmark is a coastal civilization
Huge mountain range near Danish capital

These are a few possible reasons why Denmark settled this way.
 
This is exactly why you should delay allowing the AI to establish an embassy instead of immediately allowing them.

The area in question is extremely fertile. (2 bonus + 1 luxury all adjoin). And in the Ivory 3 tiles NE of where it settled and the Coca 3 tiles SE of where it settled and it was probably by far the highest fertility score it saw.

I didnt give embassies. I only gave them once he settled there because i couldnt believe that he was any closer closer than polynesia and i wanted to know where his cap was.
 
By the way, personally I'd be pleased to see that. You ought to be able to take it with only your garrison forces, since it's too far away from Harald for him to meaningfully contest it. The city's in a great spot, too. He basically built a city for you.

He settled it in the wrong place. I was going to settle 2 tiles south on the coast. But yes, i could raise it i guess.
 
Not only that but even human players like settling next to a luxury resource.
 
That is a raze and resettle two tiles South. Get iron two sides and extra cocoa..not bad. That is a troll city he planted
 
Never accept an embassy or become friends with the AI until you plant all or at least your core cities. This tends to help dissuade the AI from forward settling you. They won't have as good of an idea of the strength of your capital. The AI tries to friend you and then forward settle you so that if you DOW them, you take a big diplomatic penalty. It's a trap!
 
there's no way he can reinforce that city. Don't annex it, just raze and resettle, courthouse maintenance is not cheap. Plus, you can settle a better location.
BTW how could you lose this settlement spot? He's 20 tiles away and it's just outside your cap!
 
He settled it in the wrong place. I was going to settle 2 tiles south on the coast. But yes, i could raise it i guess.

That's because humans consider the future empire as a whole.
The AI doesn't consider future cities it's going to build at all.
Even for existing cities, it's limited, it treats a tile 2 tiles away (but currently outside its cultural boundary) from one of its existing cities as if the tile were nowhere near it.
 
That's because humans consider the future empire as a whole.
The AI doesn't consider future cities it's going to build at all.
Even for existing cities, it's limited, it treats a tile 2 tiles away (but currently outside its cultural boundary) from one of its existing cities as if the tile were nowhere near it.

The second statement is true, but not for the reason you described in your last statement. The AI actually does consider future cultural growth for its cities: even though yields and resources have base fertility values, a plot's overall fertility value has distance multipliers of 6, 3, 2, 1, and 1 for plots 1, 2, 3, 4, and 5 tiles away from the given plot. As a result, even if a certain plot would have a better overall fertility score 2 tiles away, the distance multipliers dictate that plots with a high fertility score in the first and second ring have a higher actual priority.

No, the most likely reason that the AI founded there instead of 2 tiles away is a combination of two of the biggest flaws in the AI settle plot logic: 1) the yield multipliers are incredibly out of whack (the AI considers food to have a value of 15 and hammers to have a value of 3), and 2) distance fertility multipliers are the same for all yields, even though food tiles located in the 3rd ring are most likely less useful than hammer tiles located in the 3rd ring (by the time the city expands to the 3rd ring, it'll most likely need hammers more than it needs food).
Essentially, it's not just the luxuries that drew the AI to that particular spot: it's mainly the 3rd ring floodplains, 3rd ring wheat floodplains, and the 3rd ring oasis. Food has a base value of 15, while hammers have a base value of 3, so a 3-food tile in the 3rd ring has a value of 90 (floodplains), while a 1-food 2-hammer tile in the 2nd ring has a value of 63 (iron grassland). These values are still multiplied by the AI's flavor values, but in order for the AI to consider the second tile to have a higher fertility than the first, the ratio of its growth flavor to production flavor must be 2:5 or higher. That's basically "never".
Things do get a bit weird with resources, though, which is why my example of comparing 3rd ring floodplains to 2nd ring iron grassland is a kind of a bad example. With resources, the AI will calculate the plot's yields as if the resource's improvement was already built on the plot, so for iron grasslands, the AI would see it as 1-food 3-hammer, which would bring the 2nd ring tile's fertility value to 72, but it would also see wheat floodplains as 7-food, so a 3rd ring wheat floodplains would have a value of 315. If the resource can be traded, the AI also adds in 10*(resource quantity), or 30*(resource quantity) if it doesn't have the resource. If the resource is a luxury, the AI also scores the tile for happiness and adds that into plot's fertility value as well.

Oh yeah, and the AI doesn't factor cultural influence speed into account, so if a couple of valuable tiles are separated from the settle plot by a desert, peaks, jungle hills, or other tiles that are harder for culture to spread through, the AI won't realize that it wouldn't get those valuable tiles just by settling at the plot and letting passive culture spread do its work.

The AI also sort of ignores peaks, ie. if it has buildings or wonders it may want to build that require nearby peaks, the AI will not take this into account when looking for plots to settle. It only takes peaks into account when calculating a plot's "strategic value", which is a highly flawed calculation: basically, the AI looks for hills in the city's 1st tile radius and peaks in its 2nd tile radius and increases the plot's score for each one it finds. This is why you'll see the AI settling near mountain ranges on tiles that are actually fairly poor settling spots: it saw all the peaks in the future city's 2nd tile radius and said to itself, "Ho boy, this place sure has enough strategic value to counteract how bad it is for food and hammers!"

Spain AI also does not recognize that it gets double the yields from Natural Wonders. Inca AI does not realize that it can build terrace farms on hills and would also have free maintenance from hills. Celts AI overvalues forests that would grant faith to a future city, ie. it values faith from unimproved forests to be at least 100 times the normal value of faith.
 
Spain AI also does not recognize that it gets double the yields from Natural Wonders.

That was changed in the last G&K patch prior to BNW coming out and so except for Vanilla it does. That same patch also highly encouraged Indonesian AI to settle on different landmasses (until it founded all 3 of the unique luxuries)
 
That was changed in the last G&K patch prior to BNW coming out and so except for Vanilla it does. That same patch also highly encouraged Indonesian AI to settle on different landmasses (until it founded all 3 of the unique luxuries)

Here's the code for the Spain bit:
Code:
if (pPlayer->GetPlayerTraits()->GetNaturalWonderYieldModifier() > 0)	//ie: Spain
{
	rtnValue += iNaturalWonderCount * m_iSpainMultiplier;	
}
iNaturalWonderCount is the amount of natural wonders in a 5-tile radius (not even within city work radius), m_iSpainMultiplier is 55000. As you can see, Spain AI still does not realize that natural wonders give double yield, all it does is boost up the fertility rating of all tiles near natural wonders by an ungodly amount of fertility. The funny thing is that a proper solution is just as simple as this one: simply check for whether a tile is a natural wonder and double all the relevant fertility components (everything except Resources and Strategic).
To be completely fair, all AI's give a flat bonus to the fertility of tiles that would work natural wonders:
Code:
if (pLoopPlot->IsNaturalWonder() && iDistance > 0 && iDistance <= NUM_CITY_RINGS)
{
	//iPlotValue += iPlotValue * 2 + 10;
	iPlotValue += iPlotValue * 2 + 500;
}

Indonesia AI's "solution" is just as daft: all it does is multiply the fertility value of tiles that would create a unique luxury by 3. There's no taking account for happiness flavor or anything of the sort, it's just a rudimentary *= 3 operation.

On the bright side, I double checked some of my previous statements, and it turns out that I was wrong about the AI ignoring tile ownership: it will actually zero the fertility component of tiles that are owned by someone else, so that's nice. I've edited the previous post to reflect this.
 
just load back at turn 40 on your autosave and capture his settler as it approaches than you get a free worker.

But if you are playing at Diety you should by that stage of the game you should have your units surveilling the area you want to settle otherwise the AI will grab them.
 
Top Bottom