A Better AI.

Last time I reported on Mansa with a big stack that didn't try to take back one of his cities (11-18 build). That stack was infantry with City Garrison promotion.

This time, I'm reporting on Huayna with a huge stack of City Raiders and catapults hunkered-down in a city under siege by me (11-26 build). The cats did not try to soften up my much smaller stack of maces/crossbows/trebs standing in a forest. The CR maces, swords and axes in the city did not take me on, though I think they would have wiped me out. Instead, I took many turns to take the city and earned two Great Generals in the process.

I like the big stacks that the AIs are creating, but they only seem to be willing to use them under very favorable conditions. (For example, I've had much trouble with Genghis and huge stacks of Keshiks.) Under more marginal conditions, they are so timid that a weaker force can take multiple turns to gradually wear a big stack down to nothing. I think they need to strike while they have maximum force.

One idea -- and I have no idea whether it can be implemented -- is to delay promotions when building up for the dagger. That way, if somebody attacks before the dagger is thrown, an effective set of promotions can be applied. This might allow the AI to act more aggressively.
 
Could the fact that the city has hit its happy cap be the determining factor? It's only anecdotal, but I've noticed a tendency on the part of the city governor to slow down growth at the cap, unless explicitly instructed otherwise (with Emphasize Food) or manually shifted.

Codex

I had a city with 15 population, but the happines cap was at 12 if Im not mistaken. The crazy city governor suddenly from 1 turn to the other(or maybe it just grown form 14 to 15) did put 6 priests specialist online where there was only 1 artist(they took the artist off too to put in the priests) for stop the growing, I was like ?WTH? heh, I dont want greatprophets anymore >.<
1 turn later, he did t5he same with other city, but now with scientists..

Well, I understood why he did that, but they could better ask me before no? :crazyeye:
 
I can't remember before the latest patch this kind of ugly city
placement by the AIs. It's totally illogical and highly annoying,
because of the close borders nonsense.

It's more interesting if the AIs start wars for expansion instead of
founding crappy cities.
Also, the game seems to be more boring with the new vassal concept.
I liked the old vassals better, it was more unpredictable and messy.

Here are 8 screenshots from 1 game.

ugly1on2.jpg


ugly2yw3.jpg


ugly3gx1.jpg


ugly4yp1.jpg


ugly5de2.jpg


ugly6ja4.jpg


ugly7ma5.jpg


ugly8zx4.jpg
 
@Tatran: Heh, lots of bad placements true! But AI always liked to place in this kind of sht place, and then in late game, where the oil and the uranium goes to? :scan:
That chinese city in the first screenshot, I bet a oil will appear right beside it! Did it? :crazyeye:
Sure I get what you mean! And they should stop spamming cities just because there is a square in a trunda somewhere free heh..
Anyway, AI always did it, since first version of CIV4..
 
on another note ~ Blake's newest patch had Gandhi just a little behind me in a race to a culture win! His first city hit legendary before any of mine, but i was able to win (perhaps by using the culture slider ~ i wonder if blake has modified that so that AIs will use it to boost the culture production) anyway, when i did win, his lowest city was only about 10 - 15,000 points shy. Also, on the Culture graph at the end, i was THIRD after i won!!

Great, great improvements :goodjob: ~ if wanted, i can post screenies.

perhaps something can be added that anytime a city hits Legendary Culture, they get a Diplo penalty with all other AI civs to try and provoke an attack and simulate the AI trying to stop the human from winning via culture?

ps ~ as you can tell, i got the patch to work ~ thanks Iustus and everyone else who posted an answer!
 
Hi BetterAI-team.

I've found an instance where the governer has some strange behaviour when I emphasize commerce. It is clear that it would use the cottaged tile instead of the oasis as the cottage can grow to produce more commerce, but I see no reason to use the coastal tile instead of the oasis. See the picture below.

Strange Governer.JPG

That looks like exactly the bug that should have been fixed in the 11/26 build, were you using the previous one?

There is an upcoming fix to the emphasize food case, and the governor will like food a bit more when you are just one under the food cap, but otherwise, the 11/26 build should be pretty solid.

-Iustus
 
@Tatran: Heh, lots of bad placements true! But AI always liked to place in this kind of sht place, and then in late game, where the oil and the uranium goes to? :scan:
That chinese city in the first screenshot, I bet a oil will appear right beside it! Did it? :crazyeye:

If so, then spamming cities doesn't sem to be such a bad idea after all, does it? :)

And the Civ4 AI does *not* know where resources will pop up later on. Some fanatics here (including myself) ran extensive tests on that when Civ4 came out. You can easily check it for yourself. We designed a cross-shaped map that had four identical branches, only one had some oil hidden inside. The AI was given a settler. If the AI knew about the oil, then it should *always* choose the branch with the oil for settling. But it didn't, hence it does not know that the oil is there. If you give it the tech needed to see oil, it will always choose the oil branch btw. (Note: There was an error in Civ4 that let the AI see *some* data it shouldn't see before the first patch, but this has been fixed long ago).

Of course, since then we've got another patch, an expanison, a patch for the expansion, and an AI mod, so things may have changed. Might be worthwile to re-run the old tests.

Sure I get what you mean! And they should stop spamming cities just because there is a square in a trunda somewhere free heh..
Anyway, AI always did it, since first version of CIV4..

Well, as long as it can hold the city, it's still possible to get a net gain from it. Even if it doesn't, the city can be used for scouting, a bridgehead in alien teritory, and a potential stagibng point for air attack preparations. And there's the possibility to find a resource there that you wouldn't have otherwise. All this together *may* offset the cost of maintaining a city that cannot be productive in its own right.

What's, however, definitely stupid is that the AI doesn't seem to take future culture development in account when planting new cities. In my last game I had Cyrus found a lone city directly on the border to my capital. Inevitably it flipped to me after a while. So in founding this city and trying to build it up, Cyrus was basically just giving me one settler's and several improvements worth for free. Perhaps before planting a city, the AI should check whether it will probably flip before a net gain can be achieved from it. If no, the city shouldn't be founded. (This was Warlords 2.08 AI, I don't have Blake's AI yet.)
 
What's, however, definitely stupid is that the AI doesn't seem to take future culture development in account when planting new cities. In my last game I had Cyrus found a lone city directly on the border to my capital. Inevitably it flipped to me after a while.

What the AI does recognize and didn't used to is using Culture aggressively. I used to be able to take over plots I wanted without war just by appropriate culture buildup and saved Great Artists. I'd get a bit of a diplo penalty from it but that's all

A week or so ago, I did the same while using Blake's AI patch and as soon as I had the GA sacrifice himself, I had a war on my hands. I eventually did get the three gem mines but it was a bit of a surprise.
 
Arlborn said:
That chinese city in the first screenshot, I bet a oil will appear right beside it! Did it? :crazyeye:
Nope, but there was oil (ocean tile) below that Celtic city.
You won't hear me complain, because the desert tile below Pusan
had oil too.
The only reason the AI, first the Chinese and later the Incas, founded
a city in that first screenshot was the corrupted floodplains, no food
on it (this bug is still there). No resources were there.
 
That looks like exactly the bug that should have been fixed in the 11/26 build, were you using the previous one?

There is an upcoming fix to the emphasize food case, and the governor will like food a bit more when you are just one under the food cap, but otherwise, the 11/26 build should be pretty solid.

-Iustus

Sorry, I should have added the information about which build I'm using. I'm using the 11/26 build. Maybe it has something to do with the oasis. It's a special type of desert overlay that might have escaped your corrections.

It's not a big deal to me as I don't use the governers a lot myself, but I read a post somewhere in this thread that you were looking for these kinds of bugs with governers and emphasizing.

One thing that might make a difference: I changed the financial trait so that it only gives an extra commerce in tiles with 3+ commerce instead of tiles with 2+ commerce. I'm playing a financial leader in this screenshot, so with the normal rules the coastal tile would give me 3 commerce instead of the 2 in the picture. I would still prefer a 3 food, 2 commerce oasis over a 1 food, 3 commerce coastal tile, but I could see the logic in prefering the coastal tile by the governer in that case as I was closing on the happiness cap while suffering from unhappiness from pop-rushing.

So if there is some governer code that differentiates the financial leader from the non-financial leader without looking at the actual tile-output, then this small modification by me could be the cause. In that case, sorry for the confusion.
 
I can't remember before the latest patch this kind of ugly city
placement by the AIs. It's totally illogical and highly annoying,
because of the close borders nonsense.

It's more interesting if the AIs start wars for expansion instead of
founding crappy cities.
Also, the game seems to be more boring with the new vassal concept.
I liked the old vassals better, it was more unpredictable and messy.

Here are 8 screenshots from 1 game.
Thankyou, the screenshots are very helpful. I'll take measures to reduce the AI "desert/ice city spam".



Yes, I understand. I was talking a bit about how the coastal tiles that were not linked to land (the 1-0-1 tiles) were valued very lowly even by coastal cities. I agree that those tiles are not great. But they are better than some other bad tiles.
Ocean is useless. In many cases the 1 commerce wont even cover the upkeep. It may be better than farmed lake tundra pre-biology, but useless is still useless. All they serve as is a place to hold pop until it's whipped or turned into a specialist.


Yes, I can see that it would be difficult to make the AI avoid such a situation. The resources are very attractive. You're talking about the run-time; did you make the AI think ahead in this case? Or did you make it realize that it won't be using a lot of good (2 commerce) coastal tiles? However you did it, great work.
Not think ahead, I just made it look for any resource within 4 tiles (in a 9x9 block minuse the fat city cross), for each resource found in that block, it tries to find a place it can found a city, if it can't find such a place it'll recognize the bonus as being unaccessable (this happens sometimes due to "fish off mountain island" or other players culture), for each possible city site it checks to see if the potential new city will block that site, if it can't find a non-blocked site then it returns the number of blocked resources.
The foundvalue for a polt is then divided by 1 + the number of blocked resources, so if a site blocks 1 resource the value is halved... this massive penalty will tend to mean that non-blocking sites score more highly.
The only potentially problematic case is the lesser of two evils case - where you're going to block a resource regardless, in that case the AI will still pick one of the blocking sites sooner or later but it may take longer than it should. However the "lesser of two evils" case is very, very rare and any site with resources (even blocking) will tend to out-value a site without resources.
 
The latest build is very nice, however there are a few changes I'd like to see:

The governor is FAR too earger to assign Artists. Could we make it so no artists are assigned unless culture is needed for the fat cross?

Wars - where are they? The AI almost never declares war anymore. Not on me, not on each other. This despite me having my own religion in my latest game, not shared with any AI.
 
Sorry, I should have added the information about which build I'm using. I'm using the 11/26 build. Maybe it has something to do with the oasis. It's a special type of desert overlay that might have escaped your corrections.

It's not a big deal to me as I don't use the governers a lot myself, but I read a post somewhere in this thread that you were looking for these kinds of bugs with governers and emphasizing.

One thing that might make a difference: I changed the financial trait so that it only gives an extra commerce in tiles with 3+ commerce instead of tiles with 2+ commerce. I'm playing a financial leader in this screenshot, so with the normal rules the coastal tile would give me 3 commerce instead of the 2 in the picture. I would still prefer a 3 food, 2 commerce oasis over a 1 food, 3 commerce coastal tile, but I could see the logic in prefering the coastal tile by the governer in that case as I was closing on the happiness cap while suffering from unhappiness from pop-rushing.

So if there is some governer code that differentiates the financial leader from the non-financial leader without looking at the actual tile-output, then this small modification by me could be the cause. In that case, sorry for the confusion.

could you post a save file and perhaps a zip archive of your XML changes? I would like to track this down, it should not be happening. The governor uses the current settings, so it should not matter how you have changed the XML.

-Iustus
 
The governor is FAR too earger to assign Artists. Could we make it so no artists are assigned unless culture is needed for the fat cross?

Hmm, can you give some more detail? I do not see artists assigned much under normal circumstances. Were there open spots for engineers, scientists, merchants, or priests still? I assume you were at or above your happy cap? Did you have emphasize commerce clicked? (Emphasize all 3 counts here). What was your global culture slider at?

As an aside, if you are using Better AI you should move away from clicking emphasize all 3, food, production, commerce. This is not a good idea. While the behavior is still decent at this setting, you are basically turning off most of the important checks by doing this (actually drowning them out). By default, the governor will not run specialists if you are under your happy cap unless you click emphasize GP points (which you might want to do at your top GP cities, or at a GP farm). If you find yourself wanting to click emphasize all 3, then try with emphasize nothing. In most cases you will get better behavior.

Wars - where are they? The AI almost never declares war anymore. Not on me, not on each other. This despite me having my own religion in my latest game, not shared with any AI.

There was a bug recently that caused AIs to not attack early, prior to getting siege weapons. That will be fixed in the forthcoming patch. In addition warlike leaders may choose war to solve their financial troubles. If anything, war may become too frequent and we will have to turn it down a bit.

Expect a new patch in the next two days with the war changes.

-Iustus
 
Nope, but there was oil (ocean tile) below that Celtic city.
You won't hear me complain, because the desert tile below Pusan
had oil too.
The only reason the AI, first the Chinese and later the Incas, founded
a city in that first screenshot was the corrupted floodplains, no food
on it (this bug is still there). No resources were there.

Heh :crazyeye:
The OIL is *always* in that crap city in desert the AI founded 5 turns ago withouit scientific method! And The uranium is *always* in that other crap tundra city :D

Nah, I know they probably onjly get lucky because they like so much of founding in that crap sites and oil and uranium are almost always in crap sites :p
 
The latest build is very nice, however there are a few changes I'd like to see:

The governor is FAR too earger to assign Artists. Could we make it so no artists are assigned unless culture is needed for the fat cross?

Again luck of knolidge and undestanding.
In even Old AI goverment will assign artists if city if culture pressured.

That how AI fight culture wars and goverment AI is the same that AI itself use.

If you want to nerf AI, then you will remove this behaviour, otherwize assign specialists yourself.
 
In addition warlike leaders may choose war to solve their financial troubles. If anything, war may become too frequent and we will have to turn it down a bit.

Expect a new patch in the next two days with the war changes.
:D:D:D Oww, can't wait. Would love to see the AI warmongers go to war for financial benefits. Will the AI handle a deficit spending/pillaging strategy or will it just go to war because it is in financial difficulty (ie, at a low research rate) and hope for the best?
 
Ocean is useless. In many cases the 1 commerce wont even cover the upkeep. It may be better than farmed lake tundra pre-biology, but useless is still useless. All they serve as is a place to hold pop until it's whipped or turned into a specialist.


I respectfully disagree. Or at least disagree with the statement that the 1 commerce won't cover the increase in (city and civic) upkeep of the higher population after a courthouse is present (in most cases). But the value of the tiles is pretty low, so I agree with your founding algorithm. Lets bury it, the difference between useless and very low value is not worth a discussion, I think. I shouldn't have brought is up when reading the city founding algorithm.


Blake said:
Not think ahead, I just made it look for any resource within 4 tiles (in a 9x9 block minuse the fat city cross), for each resource found in that block, it tries to find a place it can found a city, if it can't find such a place it'll recognize the bonus as being unaccessable (this happens sometimes due to "fish off mountain island" or other players culture), for each possible city site it checks to see if the potential new city will block that site, if it can't find a non-blocked site then it returns the number of blocked resources.
The foundvalue for a polt is then divided by 1 + the number of blocked resources, so if a site blocks 1 resource the value is halved... this massive penalty will tend to mean that non-blocking sites score more highly.
The only potentially problematic case is the lesser of two evils case - where you're going to block a resource regardless, in that case the AI will still pick one of the blocking sites sooner or later but it may take longer than it should. However the "lesser of two evils" case is very, very rare and any site with resources (even blocking) will tend to out-value a site without resources.

Good work with this. I hadn't looked at the picture carefully and had missed the resource that was deadlocked. Your programming method seems to be the way to avoid the situation. :goodjob:

Can you make the AI create Great Person Factories? (talked about it in my previous post (no 557)).


Iustus said:
could you post a save file and perhaps a zip archive of your XML changes? I would like to track this down, it should not be happening. The governor uses the current settings, so it should not matter how you have changed the XML.

-Iustus

I'm very sorry. I can't seem to recreate the situation. In the exact same situation, it uses the oasis now. And I really didn't change anything. Now, I know something must have changed, but I can't find it.

Maybe it has to do with using two python modifications (Civ4lerts which gives alerts when cities grow or when they become unhappy and such things and the Exotic Foreign Advisor which improves the screens of the foreign advisor). Both mods don't use the CvGameCoreDLL.dll and are just nice interface improvements and I was using this combination of mods from the start of this game. Maybe I should remove them. Any way to see if they might negatively influence the BetterAI mod?

I'm sorry about the confusion. Bug reports from people who are using multiple mods aren't very reliable but I really like the interface changes from these mods...
 
Peaceful construction in more akin to a Simcity style of gameplay (and there is nothing wrong with that). And even that game tries to introduce elements of conflict. Because that is what drives drama and keeps people interested.

It wouldn't be hard at all to add a "Relatively Peaceful" mode where the AI is much less aggressive, and the war weariness penalties are horrendous for anything other than a brief conflict, and you wouldn't be allowed to attack friendly civs. Perhaps cities could revolt ....

I enjoy builder games, but when you get down to it, there's less strategy involved in building. The AI wouldn't be able to do it so well otherwise. Ever since 1992 or whenever it was I've been filling up maps with farms. Maybe learning to fight isn't such a bad thing.

No... the navy stuff is just plain crap.
I'll think about a way to fix it... maybe get the ships to dump their cargo and sail out to sea if the city is threatened....
And get the AI's to train less ships.

It's nice that the AI keeps a naval retaliatory force around, but something that seems stupid to me is that AIs keep landing the same place over and over again.
 
Regarding ships I think a reason the AI leaves so many combat ships in port is because they're effectively acting as escorts for the troop carriers. If the troop carriers are doing nothing, i.e. not transporting troops, they tend to remain docked in cities in an idle state. I remember from the days of CivIII when frigates and destroyers etc were created by the AI they were either labelled as attack ship or escort ship. If the latter then that's all they ever did and their role didn't change. Maybe there's something similar going on in CivIV? Regardless, it's daft when my ships are off pillaging the AI's sea resources when they have a multitude of ships doing diddly squat in their ports.
 
Back
Top Bottom