AI suggestions

Koshling

Vorlon
Joined
Apr 11, 2011
Messages
9,254
I'm starting this thread to get input on what are perceived as the areas the AI most needs changes in, and specifics for how it might alter its decision making. All suggestions (and observations about current behaviour) are welcome, but the more specific the easier they will be to address.

Here are a few I have recently addressed or plan to address soon:

1) Ship spam whereby the AI winds up with more or less a ship in every owned water tile that then just sit there - should have been addressed in the latest DLL

2) Stack dither during city attack whereby the AI creates large attack stacks, but then just sits there on the out-skirts of the target city without making a concerted effort to conquer it even, though the stack is clearly (to a human) sufficient to do so. I plan to deal with this one next week.

3) Poor civic choice in respect of empire stability visa vi REV. As an example when I turned over a position from my game to the AI, it rapidly lost most of my empire due to choosing civics that gave it far too much instability.

4) Bad timing on war declaration/revolution. This one might be controversial - I noticed that the AI tends to declare war and change to war civics in the same turn, thereby starting the war with several turns of anarchy when it cannot produce anything. It seems to me that it should get the revolution over with and THEN declare the war, but I guess lost production just before is arguably as bad - what do people think is the correct balance here?
 
I'm starting this thread to get input on what are perceived as the areas the AI most needs changes in, and specifics for how it might alter its decision making. All suggestions (and observations about current behaviour) are welcome, but the more specific the easier they will be to address.

Here are a few I have recently addressed or plan to address soon:

1) Ship spam whereby the AI winds up with more or less a ship in every owned water tile that then just sit there - should have been addressed in the latest DLL

2) Stack dither during city attack whereby the AI creates large attack stacks, but then just sits there on the out-skirts of the target city without making a concerted effort to conquer it even, though the stack is clearly (to a human) sufficient to do so. I plan to deal with this one next week.

3) Poor civic choice in respect of empire stability visa vi REV. As an example when I turned over a position from my game to the AI, it rapidly lost most of my empire due to choosing civics that gave it far too much instability.

4) Bad timing on war declaration/revolution. This one might be controversial - I noticed that the AI tends to declare war and change to war civics in the same turn, thereby starting the war with several turns of anarchy when it cannot produce anything. It seems to me that it should get the revolution over with and THEN declare the war, but I guess lost production just before is arguably as bad - what do people think is the correct balance here?

I think that if an AI or Player suddenly goes from a "anti-war" type Civic setup to one geared towards war, the other AIs should take notice. Especially those bordering that Civ and moreso if there are negative relations. I don't think I'm good enough of a player to really know if the best civic strategy is to change first, build up, then declare war (especially if the above were implemented), or my current style of building up with my current civics, go to war, then change only if my war weariness goes out of control.

I saw #2 in action both with Neands and with a current game where the Greeks declared war, sent in a stack, then sat at some random location in my borders until a straggling single unit of his caught up, then started to take action. I had already converged units by then and effectively weakened him.

City placement for the AI may need to be looked at. With all the new buildings and goods in C2C, having a city by the ocean or river, or both really adds a lot to what you can build.
 
AI City placement definitely, not only try for coast but also not ON a resource they can see...
Several times I see AI set cities one plot away from coast, even to the point where it's a riverside ocean plot. More than several times I see AI cities on a resource they wanted, have even seen them set those cities. This does gimp said city quite a bit.

On that note maybe Barb Cities placements should be looked over if they are supposed to turn into a nation further along.

Cheers
 
AI City placement definitely, not only try for coast but also not ON a resource they can see...
Several times I see AI set cities one plot away from coast, even to the point where it's a riverside ocean plot. More than several times I see AI cities on a resource they wanted, have even seen them set those cities. This does gimp said city quite a bit.

On that note maybe Barb Cities placements should be looked over if they are supposed to turn into a nation further along.

Cheers

Screw barbs ;-) I'll look at general AI placement though.
 
AI City placement definitely, not only try for coast but also not ON a resource they can see...
Several times I see AI set cities one plot away from coast, even to the point where it's a riverside ocean plot. More than several times I see AI cities on a resource they wanted, have even seen them set those cities. This does gimp said city quite a bit.

Cheers

That is a generally a good policy to follow, but there ARE 2 important advantages to placing ON a resource, which sometimes necessitates it:

1) The city instantly gets access to that resource. No need to build a tile improvement on it and then a road to the tile.

2) It can never be pillaged or otherwise a unit placed on it to block the resource.

So if you just need that resource NOW (to say start making certain military units) then it can be an option. In most cases though, I agree with you.
 
Most I've seen placed cities on top of are Stone, Ivory, Pig, Hemp, Prime Timber, Iron, and Horse. Well, the ones I can tick of from the top of my head at least. Two of those are like you say Eldrin, Iron and Horse. The rest aren't, and I've even seen a city on a stone making it miss a cow for the BFC (would have gotten it in 3 rings but that's so far off that it's usually not a good idea to even contemplate that). One plot up would have given the cow, a banana and the stone in the BFC, placing on the stone still got the banana but, like stated, missed the cow as well as the hammers from the Stone (being a coastal city with 1 hill).

*chuckle* Well, could "quote" scenarios all day long. Suffice to say I agree that some times it can be worth it, even going as far as adding another example of it being worth setting on a resource:

3) When getting 2 or more other resources within the BFC when setting city on a resource where setting beside it in any direction would have limited that amount to 1 or even 0.

Cheers.
 
Also is there a way for the AI to recognize 1-tile landbridges so it can take this into account when building a city?
 
Also is there a way for the AI to recognize 1-tile landbridges so it can take this into account when building a city?

Yes, it is my intent to do a strategic analysis (I have a plan for how to do it) which will pick up that sort of thing
 
Yes, it is my intent to do a strategic analysis (I have a plan for how to do it) which will pick up that sort of thing
Nice! I'd like to see that code :)

Also dont forget small canals that they can bridge with naval transport units in the early game, and natural chokepoints on the map. I guess the code should be similar.
 
AI City placement definitely, not only try for coast but also not ON a resource they can see...
Several times I see AI set cities one plot away from coast, even to the point where it's a riverside ocean plot. More than several times I see AI cities on a resource they wanted, have even seen them set those cities. This does gimp said city quite a bit.

On that note maybe Barb Cities placements should be looked over if they are supposed to turn into a nation further along.

Cheers

Yeah the AI is weird in placement, for instance placing a city on a river and coast should be the best spot, however i frequently see them placing their cities not only one off from the river but one off from the coast too. Makes me want to raze their city and place a new city in a better spot.
 
Fixed the tendency the AI has to march large stacks up to cities then not really try to capture them and just 'hang around'.

Turned out this (at least the case of it I had in my game - if anyone has other cases post save games) was a long-standing (probably original BTS) bug, that surfaces when a stack is lead by a non-direct-attack unit (usually an early seige wepaon unit of some sort such as a battering ram). The way the AI operates, a stack's actions and decision making is based on that of its head unit (which should take the rest of the stack into account). In this case when it evaluated whether it could attack the city (having already moved next to it and having massively superior force) it decided it couldn't because the head unit was defend-only! This was because the routine in question was erroniously using the unit canMoveInto() call intead of the stack one (which checks if ANY units can).

Fix will be in the patch thread later today.
 
Fixed the tendency the AI has to march large stacks up to cities then not really try to capture them and just 'hang around'.

Turned out this (at least the case of it I had in my game - if anyone has other cases post save games) was a long-standing (probably original BTS) bug, that surfaces when a stack is lead by a non-direct-attack unit (usually an early siege weapon unit of some sort such as a battering ram). The way the AI operates, a stack's actions and decision making is based on that of its head unit (which should take the rest of the stack into account). In this case when it evaluated whether it could attack the city (having already moved next to it and having massively superior force) it decided it couldn't because the head unit was defend-only! This was because the routine in question was erroneously using the unit canMoveInto() call instead of the stack one (which checks if ANY units can).

Fix will be in the patch thread later today.

Now THIS fix is very badly needed, glad to see it was on your list, i didnt understand why they ALWAYs did this, thx for the info.
 
Now THIS fix is very badly needed, glad to see it was on your list, i didnt understand why they ALWAYs did this, thx for the info.

I agree.

However I also encounter some civs bringing out all their forces from their cities and leaving them with like 1 or 2 units. Whats even stranger is they are bringing city guard units with them.

Is there some way to tell the AI that they should keep units with the promotion of Riot Control (1-5) that the unit should stay in the city?
 
I agree.

However I also encounter some civs bringing out all their forces from their cities and leaving them with like 1 or 2 units. Whats even stranger is they are bringing city guard units with them.

Is there some way to tell the AI that they should keep units with the promotion of Riot Control (1-5) that the unit should stay in the city?

By and large the Guard-type units should be camped in the cities, but there could be some situational cases where moving one or two out makes sense; maybe to defend a nearby resource or choke point. With an attacking stack, the Guard unit may be there to protect a city once it is conquered.
 
Are we talking about the Town Watchman/Guard/City Guard line? Because if we are, I was thinking of dropping them from my mods because
1. they are bright pink
2. they don't get the city defense promotions.
 
By and large the Guard-type units should be camped in the cities, but there could be some situational cases where moving one or two out makes sense; maybe to defend a nearby resource or choke point. With an attacking stack, the Guard unit may be there to protect a city once it is conquered.

In general i find them just standing outside their city doing nothing. Not at any particular spot either, not at a choke point or even a good defensive terrain type such as hills or forest.

Are we talking about the Town Watchman/Guard/City Guard line? Because if we are, I was thinking of dropping them from my mods because
1. they are bright pink
2. they don't get the city defense promotions.

Yes i am talking about them.

1. Mine are not bright pink. However i recall back in the old days they use to be.

2. The they get a new promotion called "Riot Control"

Riot Control I = 10% Less Likely To Revolt
Riot Control II = 20% Less Likely To Revolt
Riot Control III = 30% Less Likely To Revolt
Riot Control IV = 40% Less Likely To Revolt
Riot Control V = 50% Less Likely To Revolt

Town Watchen = Riot Control I
Guard = Riot Control II
City Guard = Riot Control III
Police Squad = Riot Control V

I would like to add a Sheriff in between City Guard and Police Squad with Riot Control IV.

After that I would like to have things like a Police Car or Swat Team or even a Terminator-like Police Robot too for later eras. Note they would have Riot Control V plus Urban Tactics.

In short please don't drop them. Or at the very least merge them into the core if you don't want them in your mods.
 
In general i find them just standing outside their city doing nothing. Not at any particular spot either, not at a choke point or even a good defensive terrain type such as hills or forest.

If you le me have a save game with them doing this I'll find out why. In general thou I would say it's not unexpected that they not be in the city provided some are. It arrays it's defenders about half in the city and half on decent defensive terrain (or guarding workers) close by. Seeing one standing alone on poor defensive terrain is unusual though, especially if it doesn't also have bunch in the city. What it does not do (currently) is distinguish between defender types when deciding which to station actually into city and which nearby (clearly that could be improved)
 
If you le me have a save game with them doing this I'll find out why. In general thou I would say it's not unexpected that they not be in the city provided some are. It arrays it's defenders about half in the city and half on decent defensive terrain (or guarding workers) close by. Seeing one standing alone on poor defensive terrain is unusual though, especially if it doesn't also have bunch in the city. What it does not do (currently) is distinguish between defender types when deciding which to station actually into city and which nearby (clearly that could be improved)

Here is the file and a screenshot. Seems like for most of the game the Dutch make stacks of doom and leave their cities mostly empty. In their stacks are mostly city watchmen.

Red Circles = SOD
Red Squares = Cities with little guards.

Note they usually stand their and do nothing or sometimes go back and forth between 2 tiles.
 
In general i find them just standing outside their city doing nothing. Not at any particular spot either, not at a choke point or even a good defensive terrain type such as hills or forest.



Yes i am talking about them.

1. Mine are not bright pink. However i recall back in the old days they use to be.

2. The they get a new promotion called "Riot Control"

Riot Control I = 10% Less Likely To Revolt
Riot Control II = 20% Less Likely To Revolt
Riot Control III = 30% Less Likely To Revolt
Riot Control IV = 40% Less Likely To Revolt
Riot Control V = 50% Less Likely To Revolt

Town Watchen = Riot Control I
Guard = Riot Control II
City Guard = Riot Control III
Police Squad = Riot Control V

I would like to add a Sheriff in between City Guard and Police Squad with Riot Control IV.

After that I would like to have things like a Police Car or Swat Team or even a Terminator-like Police Robot too for later eras. Note they would have Riot Control V plus Urban Tactics.

In short please don't drop them. Or at the very least merge them into the core if you don't want them in your mods.


I definitely think the Guard units have a place in the game :cool: Especially with Hydro's crime stuff coming in, I would expect Guards and Police to act as some kind of countering force-- in addition to reducing rebellion. Maybe even with Civics where a unit in a city gives +1 :) they give an additional +1.

City Defense... I see two sides to that argument:

1) It would be nice to have a single unit that can be used to defend a city. Allows city defense promos as well as the other stuff.

2) If the above were implemented, would archer/ranged units be used as much, or at all, in the cities anymore?
 
2) If the above were implemented, would archer/ranged units be used as much, or at all, in the cities anymore?

Archers would still be needed to counter all the anti-melee units. Remember the City Guards before gunpowder are still melee units and can be taken out. City Guards units are more to keep the city from rioting and less about defending from armies. There should always be a place for military units like the archers. Personally i use at least the combo of archers, spearmen, city guards, dogs and healers for my cities. Each of those defend against different attacks.
 
Back
Top Bottom