Silly AI behaviour

Noyyau

Privateer Captain
Joined
Jun 9, 2012
Messages
1,446
Location
Italy
I'm playing a High to Low game.

Despite the AI having "forgotten" that it should heal its injured units, from the mid-classical era even backwards civs that had lost some cities to barbarians managed to get them back and expand.

I get switched to yet another civ, Venice this time. They had driven themselves in a corner: huge army costing absurd money, wrong civics that had their cities shrunk to a pitiful size (4-5 compared to 18ish for my previous civ and generally 12-15 for the other civs), and really horrible city placement.

I change civics, abandon and re-found some cities in better places, research initially goes down to 0 to simply break even, but as population slowly grows, things get better.

So I think, why not use this massive army?

And I march south and invade Italy (to me, as an Italian, Venice invading Italy is hilarious for several reasons :lol:), against whom the AI that controlled Venice had already warred, spurred on by the "assassin in capital" event.

Anyway, the point of this post is:

I raze a couple of Italian cities, conquer Genoa (holy city with shrine and some wonders) and then move on to Rome. And what do I see? Not only the cities are lightly defended, the italian AI keeps a decent stack of Longbows on a hill between the cities! Good defensive location, sure, but what's the point if I can waltz in and capture the best cities defended only by measly Mounted Infantries??

And I'm slogging around with a single 1-move stack, so plenty of time for the AI to react and move along their road network. But no, they just sit there, Archer Bombard a bit, and sometimes suicide Mounted Infantries against Swordsmen in a forest.

Insanity :crazyeye:

Attached archive has two autosaves from the last turns (save interval: 2 turns), you can see me moving but the AI doens't move the Longbowmen from the hill, and if you attack Rome (which I did), again no reaction.
 

Attachments

  • noyyau.7z
    2.8 MB · Views: 65
From your post, I analyze three problems:
- The AI has probably built a massive army during war but didn't not used it. This should probably be fixed with rev951.
- The AI doesn't know how to handle the latest civics changes as they can really harm the growth.
- The strategic decisions of unit placement have some problems concerning defense priorities.
 
Players wishing to report AI bugs need to turn on Better AI logging and post their BBAI.log file. Otherwise bug reports about the AI are no more than wild speculation.

Turn on BBAI logging in the Logging tab of the BUG options. The log file is in My Games/Beyond the Sword/Logs.

The BBAI logging is the key to understanding the AI. Every major decision is reported on, and rationale for that decision. Civics, production, war, etc.

So without the logs you can not authoritatively say the AI was making poor decisions. The AI might have been making perfectly rational decisions given the knowledge it had.

From your post, I analyze three problems:
- The AI has probably built a massive army during war but didn't not used it. This should probably be fixed with rev951.

I haven't looked recently but do you calculate the cost of maintaining an army into the optimal army size for an AI? Because that is a very relevant factor. Once the number of units exceeds the free unit maintenance, it matters a lot.
 
Turning logging on...
 
I haven't looked recently but do you calculate the cost of maintaining an army into the optimal army size for an AI? Because that is a very relevant factor. Once the number of units exceeds the free unit maintenance, it matters a lot.
No I don't but I make it to not build units for the reserve army if there are financial troubles. I'll try to adjust that.
The problem there is that when the war is coming, the AI should defend himself and create an army even if it has financial troubles. What do you think about that?
 
Although I've mentioned this before, silly AI behaviour which is troubling me at the moment is the way a large enemy stack suicides one siege unit each turn on a well-defended fort or city. Eventually they run out of siege. If they'd just attacked all at once, they'd have easily won. it makes the game almost pointless at the moment.

I've also noticed that the AI is building VAST numbers of longbows - like 40 in some cities. I can't imagine how it's paying for them when it has just three medium sized late-Medieval cities. This Civ hasn't yet got Arquebusiers, and probably also lacks Iron/Copper (unless it can trade it), so perhaps that's why it's spamming so many longbows. Not sure if this is a problem or just the best way to deal with a bad situation. I would have expected some catapults or other units to counter-attack my stack with though.

Cheers, A.
 
Although I've mentioned this before, silly AI behaviour which is troubling me at the moment is the way a large enemy stack suicides one siege unit each turn on a well-defended fort or city. Eventually they run out of siege. If they'd just attacked all at once, they'd have easily won. it makes the game almost pointless at the moment.

I've also noticed that the AI is building VAST numbers of longbows - like 40 in some cities. I can't imagine how it's paying for them when it has just three medium sized late-Medieval cities. This Civ hasn't yet got Arquebusiers, and probably also lacks Iron/Copper (unless it can trade it), so perhaps that's why it's spamming so many longbows. Not sure if this is a problem or just the best way to deal with a bad situation. I would have expected some catapults or other units to counter-attack my stack with though.

Cheers, A.

I've noticed that behavior too. The AI in Rev 920 does pretty well (they WILL attack full-on, though there is weird behavior where siege weapons are grouped in a separate stack, but at least they use them effectively), so you could play that for the time being.
 
Well I guess the changes I've made trying to improve the AI pathfinding has failed. I'll try to revert them to see if it's better (except the one which avoid grouping when using xUPT).

About the longbows, the problem is fixed now (rev 948 I think). That was a bug.
 
@Afforess: Do you think you're latest changes about AI moves can have an impact on this problem or is this solely related to my changes?
 
@Afforess: Do you think you're latest changes about AI moves can have an impact on this problem or is this solely related to my changes?

The latest commit I did would not affect AI pathing in any way.
 
In the newest Rev the AI still is having trouble figuring out things. Catharge declared war on me and all she would do is move units around, pillage, and capture workers, and she only had one catapult in the largest stack. She didn't use it to bombard. Then a unit one turn slammed into a heavily guarded city (obvious suicide) and the second unit did the same thing the next turn. The main stack (probably 15 or 20 units) just moved around and pillaged, even when it came across some cities that were defended lighter. I finally destroyed the stack easily after observing what it would do.

Here's the save and the BBAI log file:

https://www.dropbox.com/s/1rpfkuy499qdh7m/Caymon Savegame rev 954.zip?dl=0
 
Hm. I'll take a look at this this weekend.
 
@dbkblk Revision 931 only changed behavior for the unit ai's of captured animals. That would not affect non-captured animals in any way.

More broadly, dbkblk, I think you are looking for a revision that does not exist. The AI has always been not-so-great with stack attacking. I have seen the AI stack attack correctly in Rev 950+ and also seen it stack attack incorrectly.

Instead of trying to track down a revision, I'd focus on figuring out where the AI decides when/how to stack attack and improve that. CvSelectionGroupAI is probably a good bet.
 
I sieged a barbarian city with a Phalanx and a Battering ram on one tile and a Swordsman alone on another tile.I deliberately placed also an Explorer on another tile to see which unit will be bombarded by the defender.The guarded barbarian archer decided to bombard my harmless Explorer.:lol:
 
@nionios: They probably attack the weakest?

@Afforess: I haven't tested your changes yet Afforess but it seems a very good revision :)

You may be right about the AI logic. I think I focused too much on the AI recently and I was blurred when I read that "it was better some revisions ago".
 
Forget about this post.
 
@nionios: They probably attack the weakest?

@Afforess: I haven't tested your changes yet Afforess but it seems a very good revision :)

You may be right about the AI logic. I think I focused too much on the AI recently and I was blurred when I read that "it was better some revisions ago".

I also want to point out something you may not have considered. There will always be what players consider "AI Silliness". With your changes that improve City AI, you made units AI the focus of attention. Previously, a large complaint of players was that the AI was poor at developing large and powerful cities or maintaining an adequate infrastructure. This is a problem that is now solved, and in large parts due to your changes. So now the focus has switched to the next-largest AI problem, unit AI.

Every time you fix one part of the AI, you will highlight deficiencies in other areas of the AI. Its not that you are creating new bugs in the AI, it's that previously you were unable to identify and notice the problems you face now because they were masked by still larger problems.

I guess an analogy is that you walk into a dark building. You fix the lights, and discover the floors are dirty. You clean the floors, and discover a cockroach infestation... etc. Every time you fix something, you reveal a new problem. This is a good thing. New problems means you cleared up the old problem well enough to spot something new.

By the time units start behaving acceptably, this thread will be full of new AI reports about something else.
 
By the time units start behaving acceptably, this thread will be full of new AI reports about something else.

But... that doesn't mean we don't appreciate the efforts of all of you developers!:goodjob:

PS: Rev955 enemy siege stack still just camped next to my lightly defended city.
 
Top Bottom