Before I start, Kael and everyone else who worked on this amazing mod, thank you. I enjoy it so much more than Civ4. I love the atmosphere and mechanics. Anyways, I just finished reading the AI patch bug thread for .41h+ and noticed that OMG SoD was a major problem for most people. While I like that the AI has 120+ units to throw at me, it's not using them intelligently and should be far more aggressive if it does have them. So while don't we combine the wisdom of Sun Tzu with the Civ4 AI so they can know when to attack?
Combat Tactics
What I suggest is that the computer do a quick analysis before every battle and do the following comparison (I don't know XML, so it'll look like C++ code):
If ( myNumUnits > (theirNumUnits * 5 ) )
Attack
else if ( myNumUnits > (theirNumUnits * 4 ) && ( combatOdds >= 20% )
Attack
else if ( myNumUnits > (theirNumUnits * 3 ) && ( combatOdds >= 40% )
Attack
else if ( myNumUnits > (theirNumUnits * 2 ) && ( combatOdds >= 60% )
Attack
else if ( myNumUnits > (theirNumUnits ) && ( combatOdds >= 80% )
Attack
else if ( myNumUnits <= (theirNumUnits * 1.5 ) )
Pillage Countryside //this effectively divides their forces. If the player comes out to stop them, they will attack the weaker of the two targets if it falls into the odds there.
Stack Sizes
Then for the stack of doom being literally 100+ units and actually not being effective, how about we put a hard cap on their stack size of 50 units? Units such as great people, settlers, and workers will not be included in this. This will make them have separate stacks to take multiple cities with. However, there needs to be this clause.
if ( biggestEnemyStack >= myBiggestStack )
Merge stacks until myBiggestStack > biggestEnemyStack
This will let the AI be able to counter huge stack vs stacks in pure numbers.
Stack Composition
This needs to be flavorful to really capture the essence of FFH2, but there are certain units that the AI must have to be effective: Offense, Defense, Siege, and Support. We can split this into a few categories.
Offense: Warriors/Axemen/Champions/Phalanx/Berserkers/Martial Heroes/Horsemen/Summon Focused Adepts/etc
Defense: Archers/Warriors/Axemen
Siege: Catapults/Cannons/Fireball - Maelstorm Adepts/Tsunami Cultists (Must have water near by!)/Pyre Zombies!!! (I hate these bastards)
Support: Medic II + March Religious Units/Rust - Haste - Bless Mages
Now assuming a stack size of 50 the average civ should break down like this:
Offense: 25
Defense: 10
Siege: 10
Support: 5
If a unit can reasonably be two different things, like Pyre Zombies, give them a priority. Pyre Zombies are primarily a Martial Collateral source of damage. An Adept can be anything so let the AI have 3 different routines when making them (Offense, Siege, and Support)
Attack Priority
When the AI decides to attack a city it should do so in the following order.
Bombard > Magical Collateral > Siege Collateral > Magical Buffs > Summons > Martial Collateral (i.e. Berserkers) > Strongest Unit > Weakest Unit
The idea is that the AI will first destroy defenses then use spells like fireballs, maelstorm, and tsunami next. Then will use its siege engines to weaken enemies as much as possible. Afterward summons will do the remaining weakening. Then the best units (Ones with the highest combat odds will attack). Adepts/Mages/Archmages will never ever attack.
City Defense
After the AI has capture a city it should leave 4 to 5 of its defensive units behind then push ahead with the rest of the stack. Once the stack runs out of defensive units when capturing a city (Typically 2 or 3), the whole stack will defend until more defensive units appear.
If it sees a large stack passing by and is within reach, it will leave 5 offensive units behind and then engage (Using the above rules).
About First Turn Defense
All the AI should use their first warrior to defend. If they don't have a warrior, their first scout. AI can't restart. They cannot take that risk early game.
-----
This is just a bunch of suggestions and will need fine tuning for optimal performance. Go with the spirit of it rather than the exact hard numbers. Remember that the AI needs to play like a player does. How can we make standard procedures and rules out of our strategies?
Combat Tactics
Sun Tzu - Chapter 3
Generally in warfare:
If ten times the enemy's strength, surround them;
if five times, attack them;
if double, divide them;
if equal, be able to fight them;
if fewer, be able to evade them;
if weaker, be able to avoid them.
Therefore, a smaller army that is inflexible will be captured by a larger one.
A general is the safeguard of the nation.
What I suggest is that the computer do a quick analysis before every battle and do the following comparison (I don't know XML, so it'll look like C++ code):
If ( myNumUnits > (theirNumUnits * 5 ) )
Attack
else if ( myNumUnits > (theirNumUnits * 4 ) && ( combatOdds >= 20% )
Attack
else if ( myNumUnits > (theirNumUnits * 3 ) && ( combatOdds >= 40% )
Attack
else if ( myNumUnits > (theirNumUnits * 2 ) && ( combatOdds >= 60% )
Attack
else if ( myNumUnits > (theirNumUnits ) && ( combatOdds >= 80% )
Attack
else if ( myNumUnits <= (theirNumUnits * 1.5 ) )
Pillage Countryside //this effectively divides their forces. If the player comes out to stop them, they will attack the weaker of the two targets if it falls into the odds there.
Stack Sizes
Then for the stack of doom being literally 100+ units and actually not being effective, how about we put a hard cap on their stack size of 50 units? Units such as great people, settlers, and workers will not be included in this. This will make them have separate stacks to take multiple cities with. However, there needs to be this clause.
if ( biggestEnemyStack >= myBiggestStack )
Merge stacks until myBiggestStack > biggestEnemyStack
This will let the AI be able to counter huge stack vs stacks in pure numbers.
Stack Composition
This needs to be flavorful to really capture the essence of FFH2, but there are certain units that the AI must have to be effective: Offense, Defense, Siege, and Support. We can split this into a few categories.
Offense: Warriors/Axemen/Champions/Phalanx/Berserkers/Martial Heroes/Horsemen/Summon Focused Adepts/etc
Defense: Archers/Warriors/Axemen
Siege: Catapults/Cannons/Fireball - Maelstorm Adepts/Tsunami Cultists (Must have water near by!)/Pyre Zombies!!! (I hate these bastards)
Support: Medic II + March Religious Units/Rust - Haste - Bless Mages
Now assuming a stack size of 50 the average civ should break down like this:
Offense: 25
Defense: 10
Siege: 10
Support: 5
If a unit can reasonably be two different things, like Pyre Zombies, give them a priority. Pyre Zombies are primarily a Martial Collateral source of damage. An Adept can be anything so let the AI have 3 different routines when making them (Offense, Siege, and Support)
Attack Priority
When the AI decides to attack a city it should do so in the following order.
Bombard > Magical Collateral > Siege Collateral > Magical Buffs > Summons > Martial Collateral (i.e. Berserkers) > Strongest Unit > Weakest Unit
The idea is that the AI will first destroy defenses then use spells like fireballs, maelstorm, and tsunami next. Then will use its siege engines to weaken enemies as much as possible. Afterward summons will do the remaining weakening. Then the best units (Ones with the highest combat odds will attack). Adepts/Mages/Archmages will never ever attack.
City Defense
After the AI has capture a city it should leave 4 to 5 of its defensive units behind then push ahead with the rest of the stack. Once the stack runs out of defensive units when capturing a city (Typically 2 or 3), the whole stack will defend until more defensive units appear.
If it sees a large stack passing by and is within reach, it will leave 5 offensive units behind and then engage (Using the above rules).
About First Turn Defense
All the AI should use their first warrior to defend. If they don't have a warrior, their first scout. AI can't restart. They cannot take that risk early game.
-----
This is just a bunch of suggestions and will need fine tuning for optimal performance. Go with the spirit of it rather than the exact hard numbers. Remember that the AI needs to play like a player does. How can we make standard procedures and rules out of our strategies?