A Better AI.

You might be playing on settings which the AI struggles under.

I am using a custom difficulty where the AI is mostly performing as if on Noble, but the operative thing here is that the 2.08 stock AI doesnt seem to have the same significantly less production capability when playing on the same setting.

My feeling is that people are way overating Cottages and Pop-rushing nowadays. After the fix to the pop-rushing, that took a lot of the 'always beneficial' slant away from it. And new with Warlords is the fact that Hammers convert 100% to Research and Cash, not 50% like in stock Civ4, meaning that Cottages arent always a no-brainer way to go either. High production cities can put out some significant cash/research while still maintaining the flexibility of having high hammer output.

I believe that the AI plays more like being optimized for the 'old' rules rather than the new. I cant really 100% back that up, but its feeling I get after playing a considerable number of games with the newer AI builds. The 2.08 stock is MUCH worse for combat, but it does seem to be better at building up a production infrastructure (even though its likely doing it on lesser quality city sites etc).
 
Comments to the last couple of posts.

Sure, I'll post a screenshot. Can't do it right now but will do my best later today. But... you don't have to take my word for it and you don't have to worry about me giving you a "worst case" example simply to prove my point.

Simply open up your latest game. As long as it's past 1AD or so, there should be plenty of AI cities to give you data points. I hope it's not archipelago because that would skew things. Most any other map should be fine. If you haven't discovered the whole map yet just go into worldbuilder so you can see. Piece of cake.

My game with this mod is on a huge map and I haven't played far enough to see the behaviour that you're describing. (I'm actually waiting for the next version of the mod because I'm at the verge of a war and hope that the next version improves the war AI, especially for attacking cities with big stacks.) It takes a while longer on a huge map to completely fill it with cities. It seems that you're describing a situation where the AI is placing cities on optimal spots and later filling in the few unused tiles inbetween with minor cities. In my game, I have not reached this second stage of settlement yet. There is still a little bit of open space.

Now, I do think that if you place your cities so far apart that many a tile gets unused, that it is a good decision to place some cities inbetween these big cities. Those smaller cities will usually have more income than expenditures. However, it would have been even better, if the the cities were placed in such a way that there are no areas with a few left over open tiles. It would be better if the fat crosses of the various cities link with eachother almost perfectly.

By the way, I'm of the Blake school of thought. I'd rather have a few cities with overlap than a few unused tiles. I view each tile as a source of income and the decision to not use one is the decision to throw away a source of resources (commerce, production, food). But that doesn't mean that I will build my cities with maximum overlap. It means that I try to use almost every tile but try to use the minimal number of cities to do so.

It is difficult for an AI to do this. It doesn't plan cities ahead. It just compares settling sites and picks the best one according to a set number of parameters. Some of those parameters are there to limit overlap, but they are not as good as really planning ahead. It is really difficult to make an AI plan ahead. It would mean that the AI would have to compare every combination of settling points on a continent. (Virtually settling the whole continent with cities and determining the value of these cities and that for each possible position of the cities.) That takes too much calculation power if the continent is big. Planning ahead is also difficult when you don't have all the variables. If you haven't explored the whole continent, then it is difficult for the human player to think ahead. For the AI it is almost impossible. So at present the AI thinks about settling 1 city at a time and only after settling that city will it start thinking about the next one.
 
I know I prefer to have further apart, better cities, while Blake prefers cities with some overlap, wasting almost no space.

I have strong opinions on this: It is not about wasting space or not, it is about building USEFUL cities. Sometimes cities should overlap, sometimes not, whatever makes a city useful (commerce, resources, production, etc).

Hopefully you could come up with some sort of improvement on the current city placement algorithm (i.e. always overlap) - some AI cities are simply not worth it (they are settled overlapping resources that AI already uses in a different city).

Finally "wasting space" is a silly notion - some terrain just isn't too useful, so you don't always want to use every tile. What you don't want to do is "waste good space", i.e. good terrain.
 
Here's a thought.

I recognize that some tiles simply won't be worked ever (because a specialist will be better) or it won't be worked until so late in the game it doesn't matter.

So here's the question. The current algorithm probably adds together the "value" of ALL the tiles within the fat cross. But, that's nonsensical because most of those tiles won't be worked for a looooong time, if ever. So, perhaps the AI should only take the value of say the top 5 tiles, because only those tiles will be worked within a reasonable/useful game time.

Wodan

Ninja edit: take the number "5" and replace it with whatever number works for you.
 
Furthermore, I recognize and agree that the current Better AI probably looks for the "best" spot.

The problem is that this totally ignores that there is almost always value to taking the "best" spot and dividing it into two cities.

For example, take a big huge swath of floodplain. Put one city smack in the middle and it'll have huge health problems. So huge that the city will be all but worthless. In addition, at some point the city will hit happiness limits, and most of that tasty floodplain will sit there unworked anyway. On the other hand, put a city on one edge of that fertile area, and another city on the other edge. Both cities will have half the floodplains. Their health problems won't be nearly as bad, and they'll both be able to work twice the floodplains before hitting the happy limits.

That's just an example. The current AI might not compute things like floodplain health, I don't know. But, I don't think it matters. The point to illustrate is that no matter what we're talking about... floodplain, or food resources, or whatever it is, it's almost always better to divide it out between multiple cities than it is to work it with just one city.

Plain and simple, one city just won't get to a size to work a bunch of tiles for a long, long time. Two cities will almost always be better.

One caveat: ANY city should put value on having food available to grow to a reasonable size. That's probably already in the current algorithm, however, so it's not necessary to muck about with that.

What I'm getting at is that I think an algorithm that looks for the "best" spot is not necessarily what is best for the game. An algorithm that puts the most emphasis on spacing cities out would be better.

I did a test a few screens back, in the 30's I think (we're up to the 50's now :D where I took an oval island of grass, put 4 cows, and gave an AI two settlers to see what he would do. The ideal thing from almost any perspective would have been two put one settler on each end of the island, each having two cows and each getting coastal trade routes. But instead the AI founded one city smack in the middle (to work the 4 cows), without coast access, and...get this... fortifed the second settler in the city (because the leftover possible sites really sucked).

Wodan
 
I fool around alot with the world builder sometimes. Especially to see how the latest AI improvement has changed the game. It seems to me that the AI does not take into account overlap of tiles when placing a city, at least not to the extent it should.

There are valid reasons for this though. I don't like it, but my opinion isn't really important. The Goal of this project is to improve the behavior of the AI and make it "stronger" in it's economy and warring. Placing cities closer together allows for quicker economic expansion early (and we all know in CIV the earlier the better) at the expense of total territory. I'm not going to test it and decide which is better from a game mechanic standpoint. But based on what it seems "expert" (I define experts as deity players) players go for, that overlap which results in more dense city placement is an overall stronger strategy. Then again it might be nice for the AI to 1/2 or 1/4 value tiles already in the radius of another city. Maybe the AI does this already, but it does not seem to.

All the City placements made by the AI and subsequent blue circle recommendations I see show great standalone city placement, but the city is not standalone, it shares half it's tiles. Basically the AI seems to be valuing that copper or cows that's already being worked by another city as though it's a workable tile for the city, even though it will never be worked by the new city, since the older city will always be working it.

And Wodan I have to throw in a response to your 2 settlers on 4 cow island scenario. Way back in this thread Blake Stated that the AI cannot forward or back think. It works each turn out independently, and can't really have a set goal. It can lock into a cultural victory and do a different algothorim based on upping culture in 3 cities, but it does this turn by turn. So your settler test makes total sense. The AI cannot go I have two settlers, how should I place "them" in order to maximize the economic yield of 2 cities. Instead the AI can only think about each settler at a time. So it founds in the best spot possible with the settler, and gets all four cows. I remember as well that the AI cannot be programmed to forward think in the scope of this project as it would break save game compatibility.
 
The 'quick combat setting' solution to the buggy AI stack attack Iustus suggested for the previous build still aplly for this one too?
 
overlaping or not, its really depends on taste. Personally I like super specialized cities. So I avoid overlap as much as possible, I sometime even leave out resource tiles to found optimal city, but thats just me. One thing I really want AI to consider when founding city is cultural influence by other civs. specifically how safe it is from culture flip in the future. The game I'm playing now, hatshepsut tried to settle a new city in the middle of my empire. That site is a great city site, no overlaping what so ever, problem is its surronded by my cities on all 4 sides, its gonna get culture flipped by me sooner or later. But I guess I'm just asking too much. It would take a human brain to think that far ahead.
 
My cities usually don't overlap too much because they can steal good tiles from each other and i can't set which tiles go to which city (or at least i don't know how to do this). For instance a top-production city can lose a mine tile to a minor city which is a bad change.

Some AI overlap is not bad though because it gives more cities overall and this can help to let more civs in the game because more can fulfill the national wonder city requirement (6 cities / civ on standard map).
 
A lower priority idea but i think the AI could use a mass-upgrade routine when a superior unit is researched like maceman.
When this happens AI cities exlc. ones that build wonder,worker,settler could switch to wealth and slider set to max gold possible with no unhappiness and go this way until all units are upgraded.
This would help especially the dagger-stacks.
And maybe after this we could eliminate the huge AI upgrade bonuses.
 
A carrier load of bombers would be a heck of a surprise to a human player,

It certainly would be a suprise - as carriers can not carry bombers. :D :D :lol:
 
My cities usually don't overlap too much because they can steal good tiles from each other and i can't set which tiles go to which city (or at least i don't know how to do this). For instance a top-production city can lose a mine tile to a minor city which is a bad change.

Just click the darkened unused tile when you're in city view. It will lighten and be selectable in that city. When you enter the city that used to use the tile, the tile will be darkened in that city and a citizen that used to be working that tile will be working another tile or will be changed in a specialist.

Of course, this only works for tiles inside the fat cross of cities.
 
Here are some additional aspects used in the city founding location:

Food is valued immensely to an extent, a city without enough food to work tiles wont really get settled (until much later, if ever), the AI will not readily place cities near things like ice silver unless it actually has food to work it - it'll place the city EVENTUALLY. But the value of food is also capped, it's about at +6 or something, this means that in a food-crazy area it'll probably go for the edges where there are non-food benefits, like hills, or food-consuming plots to work (ie plains stone type thing...).

Another factor added quite recently is anti-greed, any site which claims more than 2 unique resource types or 4 (or is it 5?) resources total is considered "too greedy" and is penalized some, this is to encourage it to place multiple cities around a resource cluster rather than a single city in hte midle. Since creative cities can work all resources much more quickly the greed factor is reduced.

An extremely useful factor is "Anti deadlocking", that is the AI is acutely aware of when a city being placed will prevent a resource from EVER being worked, it makes a reasonable effort to avoid this case and thus will typically be able to work all of it's seafood. After I wrote this code I generally lowered the value of seafood and coast in general to help prevent it being coast obsessed (previously my solution to the seafood problem was to make it really keen to settle the seafood sites first).

Another old factor is that the AI is obsessive about placing cities 5 tiles away from existing cities, 5 tiles is the non-penalized distance, any distance closer or further than 5 is penalized. I recently fudged this factor so that 4 and 5 are both neutral - with closer and further being penalized. I also added a general distance penalty to make the AI more eager to found cities close where they can be made productive earlier.

In terms of poaching I added a penalty for "culturally entrenched" tiles, once a tile has enough culture on it the tile will be completely ignored (previously the AI always considered tiles in other peoples culture to be totally fair game), creative leaders have a higher threshold for this. In the case of landmasses where the AI has no cities, the presence of hostile culture incurs a much greater penalty - this is to discourage poaching absurdly bad spots on another continent.

A minor but significant change I made was to remove a "minimum value of 1" factor - at some point in the code (before the distance calculations) the old way was that even if the found value got reduced to below zero (due to it being far away and rubbish) it would get set to 1 anyway - making it a valid city site (if obviously rubbish at a value of 1), now it goes to 0 instead, meaning those sites fall of the AI's radar, this discourages long-distance poaching.

Something to note is that Overlap tiles are NOT counted (if they overlap with own cites) - however nor are they penalized against much. They are basically treated a lot like ice. I'm probably going to rework the overlap stuff because it's not all working as it should.

Also some of the other factors may be too strong or not strong enough...
 
Just click the darkened unused tile when you're in city view. It will lighten and be selectable in that city. When you enter the city that used to use the tile, the tile will be darkened in that city and a citizen that used to be working that tile will be working another tile or will be changed in a specialist.

Of course, this only works for tiles inside the fat cross of cities.

Thanks a lot. Sorry for my inexpererienced hassle in this top-level topic.
 
sveint,
Actially it is a resonable suggestion by AI.
Propoused side would be a better city, if there were no other cities around. It will hav emach more grassland and coastal water ties.
If you intend to use stone, it is even tactically better site, not that AI take this in account.
Settling on stone give immidiat access to it with out need to build quary, after you know masonry .
 
One final thing.

Blue circles are STILL weed and are to be taken with a grain of salt.
Especially remember that they only suggest sites a limited distance form the settler and ONLY if the tile is currently visible.

Also they only ever show "local maximums", you can theoretically have a gradient of found values resulting in no blue circles for a long stretch ie imagine there's a stretch of coast and the found values just keep getting higher...
increasingfoundvaluesyv4.png


Because there's no "local maximum" it can't create a blue circle...

These long stretches of increasing(decreasing) found value are more common than you might think because of the distance factor. This can result in large stretches of quality terrain not having blue circles, with some crappy site being a local maximum and thus getting a blue circle.

Anyway AI doesn't use blue circles so improving them isn't a big priority. It's not the "Better Blue Circles" project....
 
Something else i noticed that seems like a pattern:

Can it be, that the AI sometimes goes mounted-heavy?
Is it the extra XP from stables tat makes the AI attack with a stack of elephants, horse archers, knights and 2 catapults?

It cannot be for the quick moves, since eles and cats are movement 1, but often i see stacks that do not contain a single unit with defense bonus.

It so happened with frederick last game, 2 large stacks containing only mounted units and 1-2 catapults.

I mean, ok, i just spam pikemen, but a handful of macemen would turn the odds in his favour, since i just have to sally forth like a madmen no matter the terrain.
 
Back
Top Bottom