I have a pretty good idea how to fix the combat AI

Soren Johnson, I think the lead AI guy, talks about how the AI "cheats" in this video that I'm sure a lot of you have seen http://www.youtube.com/watch?v=IJcuQQ1eWWI. There is a part where he mentions how they let the AI "see" your units at specific moments in time, but not all the time. Perhaps if the AI could see your units at all times it might be better at war? I think the OP's ideas and some others would also have to be implemented, but if the AI knew where your units were at all times it would make it more challenging, instead of just "peeking" at times.

49:40 is where he talks about it
 
On higher difficulties, we should just let the AI see all your units, ESPECIALLY when it comes to positioning its ranged units.

I never get my ranged units caught in the open by enemy melee units, but the AI is incapable of shielding its ranged units properly and consistently. So just give it total vision, get it to never throw its archers into an open field with my melee units one hex away. This would naturally allow all of its melee units to filter forward through the battle lines, while its ranged units constantly maintain a safe gap between themselves and my units. As it stands right now, I've killed countless archers who just walked into my front lines.
 
e. any hex bordering two "green" hexes and a "red" one becomes "green"
How do you make sure this algorithm converges?
A hex bordering 2 green and a red becomes green if it's not already colored, or if it's already colored?

These tiles would help it defend itself IF it would have enough units to fill out all the tiles it used for the calculation. However, that is almost never the case.
On Deity the problem is usually more that the ai has no room for new units, so that's almost always the case.

Also, this is a nice treaty on static defense, but the Maginot Line wasn't very effective so I doubt about the validity of this strategy if applied by the ai as is.
How will the units move from one position to the next city to defend when priorities change for example?
 
How do you make sure this algorithm converges?
A hex bordering 2 green and a red becomes green if it's not already colored, or if it's already colored?

It colors (assigns a numeric value) and then recolors.

On Deity the problem is usually more that the ai has no room for new units, so that's almost always the case.

Lets hope this AI fix would make Deity almost never played :)

Also, this is a nice treaty on static defense, but the Maginot Line wasn't very effective so I doubt about the validity of this strategy if applied by the ai as is.
How will the units move from one position to the next city to defend when priorities change for example?

This segment is exclusively for defensive moves (which AI chronically lacks at the moment). The AI should separate its defensive force from its (counter)attack forces.
 
I assume you meant to imply this too, but I just wanted to make it explicit that as a unit that's at 8 HP is going to be easier to bring down to that critical 0 HP than one that's at full health, it should weigh how close the unit is to death even if it can't take it down in that attack or even that turn. Although then you'd have to give it some parameters for avoiding excessive overkill if it can.

Considering PGF experiences, the following algorithm for city's attack (and any ranged unit defending a city for that matter) should be more than sufficient:

Priority +6: check 2-hex radius for full-health melee enemy units that have an adjacent friendly unit or city. If exists then attack, but only if projected damage more than 0.
Priority +5: check 2-hex radius for units with 2 or less HP. If exists then attack, but only if projected damage more than 0.
Priority +4: check 2-hex radius for units with 4 or less HP. If exists then attack, but only if projected damage more than 0.
Priority +3: check if cavalry unit protecting city. IF so, attack pikeman/spearman unit, but only if projected damage more than 0.
Priority +2: check 2-hex radius for melee unit. If exists, attack the one closest to city.
Priority +1: check 2-hex radius for any melee unit. If exists, attack.
Priority +0: attack any unit within 2-hex radius.

Extend it to 3-hex radius if:
a) logistics or range promotion
b) artillery or rocket artillery

This will have the following effects:
- ranged and city finishing off units
- ranged and city weakening melee units enough for a melee counterattack
- killing off units that can actually capture the city first



***

Similar to the above, city-defender melee units could get similar algorithms:

Priority +4: If adjacent ranged enemy unit on protective terrain AND less than 2 enemy units adjacent to target - attack.
Priority +3: If adjacent melee enemy unit with less than 6 HP on protective terrain - attack.
Priority +2: If adjacent ranged enemy unit on flatland AND no other enemy units in 4-hex radius - attack.
Priority +1: If adjacent melee unit on flatland AND no other enemy units in 4-hex radius - attack.
Priority +0: stay put.

and for cavalry as well:

Priority +4: If adjacent ranged unit on protective terrain AND less than 2 enemy units adjacent to target - attack.
Priority +3: If adjacent ranged unit on flatland - attack and retreat to previous position.
Priority +2: IF adjacent melee unit with less than 8 HP NOT a spearman/pikeman on flatland attack and retreat to previous position.
Priority +1: IF adjacent melee unit with less than 8 HP NOT a spearman/pikeman on rough terrain AND no enemy units in 4-hex radius - attack.
Priority +0: Stay put.

With additional IF-ENEMY-JAPANESE-THEN priority lists.
 
With additional IF-ENEMY-JAPANESE-THEN priority lists.

Hm, I hadn't even thought of that. I suppose you may also want to include a different script for Janissaries and Jaguars because heal-on-kill could really screw over the AI if it's using units that have a serious disadvantage (strength/health/great general/terrain etc).
 
Hm, I hadn't even thought of that. I suppose you may also want to include a different script for Janissaries and Jaguars because heal-on-kill could really screw over the AI if it's using units that have a serious disadvantage (strength/health/great general/terrain etc).

Yes, sorry. Jannisaries as well. Jaguars are too early in game to make any strong impact (i.e. not enough defensive units to "focus fire").
 
It colors (assigns a numeric value) and then recolors.
Then are you sure it always converges, and that it doesn't depend on the order in which the hexes are evaluated?

Lets hope this AI fix would make Deity almost never played :)
Indeed, with a better ai, Deity wouldn't be needed.

This segment is exclusively for defensive moves (which AI chronically lacks at the moment). The AI should separate its defensive force from its (counter)attack forces.
There are still many issues here. I implemented a game with a strategy dividing forces between offense and defense. The result is ok until your offensive forces get obliterated or severely depleted. At which point the strategy of what to put from defense to offense, and how to convey reinforcements, becomes difficult. It also doesn't help with handling defense when you're attacking someone and are backstabbed.
And yes I read that this was for defense, and I think my remark still holds: You are presenting static defense positions, which is a strategy that has been exposed time and again. Mobile defense is mucch more efficient, if only because you need less units.
I love to pillage roads between enemy cities for instance, because it slows down reinforcement and cuts off trade routes. Waging wars of attrition is not the most common strategy in civ, although I'd expect it to be usable on longer games (big maps or marathon), and your static defense won't help against pillagers/raiders.
 
LDiCesare, note that he is weaving in other thread ( not complete ATM ) the attacks and counterattacks ( linked some posts above ). Most of the mobile defense will probably fit better in there than in here ...
 
Yes, sorry. Jannisaries as well. Jaguars are too early in game to make any strong impact (i.e. not enough defensive units to "focus fire").

I agree that Jaguars are too early to have much impact in that regard, but what I meant (and totally failed at saying) was those units and units upgraded from them, since they keep their heal-on-kill abilities. Especially given human players' propensity to build lots of UUs that keep their promotions and then upgrade them later on.

Plus, it would most likely be a simple matter of copying over the script for Janissaries and changing one number to get it to affect jaguars/former jaguars.
 
Back
Top Bottom