The Big Question - How Does The AI Choose Which Units To Build?

Results:
NOTE: Both AI's are locked in war, my Civ is just an observer... Excel file below has full statistics on AI builds.

Test 3 Excel Spreadsheet

ROUND 1
AI Builds = 30 turns (each Civ = 210 units total):

Unit - # built - % built - Unit Flag

Germany:
Warriors - 15 - 7% - Amphibious
Archers - 3 - 1% - ZOC
Spearman - 2 - 1% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 4 - 2% - Radar
Pikeman - 45 - 21% - Enslave ability; enslave results in a worker
Longbowman - 132 - 63% - Ability to stealth attack musketmen
Musketman - 9 - 4% - 1 HP Bonus

Russia:
Warriors - 18 - 9% - Amphibious
Archers - 4 - 2% - ZOC
Spearman - 2 - 1% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 8 - 4% - Radar
Pikeman - 33 - 16% - Enslave ability; enslave results in a worker
Longbowman - 137 - 65% - Ability to stealth attack musketmen
Musketman - 8 - 4% - 1 HP Bonus


Observations:
- The AI first built units with Amphibious abilites (Warriors) over all others, then Stealth, then Enslave, and slowly built other units with other abilities after that. The reason is that since all units have the same defense factor of 5, it builds the first unit of the list, which is warrior. So this has made the Amphibious percentage higher than it should be.
- On turn 9, Soviet had 2 defenders in each city, 3 in the capitol (defenders were mostly Longbowman, then Pikeman, then Warriors)
- On turn 26, both AI's are primarily using Longbowmen for defense of their cities
- It is clear that a unit with Stealth ability is highly prized by the AI, then Enslave, Amphibious, Extra HP's, Radar, ZOC, and Defensive Bombard
- NOTE: The clear fact that the AI prizes Stealth so much means it can probably be used to coerce the AI to build more units of a particular type. Say, for instance, someone wants the AI to build more a particular unit that it does not build very often, one may be able to give it Stealth ability (and the stealth target would be a unit that is hardly ever encountered), and the AI may build many more of these units, simply because it has the stealth ability, same may go for Enslave as well

WINNER of ROUND 1: STEALTH
Stealth has won this round, and will be eliminated from Round 2 (to see if AI build priorities stay the same, or if they change). NOTE: Which or how many targets the stealth unit has the ability to choose from did not appear to have much of an impact on build priority, but further testing may have to be done to determine this.


---------------------------------

ROUND 2
AI Builds = 30 turns (each Civ = 210 units total):

Germany:
Warriors - 29 - 14% - Amphibious
Archers - 17 - 8% - ZOC
Spearman - 13 - 6% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 24 - 11% - Radar
Pikeman - 106 - 50% - Enslave ability; enslave results in a worker
Musketman - 21 - 10% - 1 HP Bonus

Russia:
Warriors - 28 - 13% - Amphibious
Archers - 13 - 6% - ZOC
Spearman - 9 - 4% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 19 - 9% - Radar
Pikeman - 111 - 53% - Enslave ability; enslave results in a worker
Musketman - 30 - 14% - 1 HP Bonus


Observations:
- The AI first built units with Amphibious abilites (Warriors) over all others, then Enslave, then they build other units in no particular pattern. The reason is that since all units have the same defense factor of 5, it builds the first unit of the list, which is warrior. So this has made the Amphibious percentage higher than it should be.
- It is clear that a unit with Enslave ability is also highly prized by the AI, then Amphibious, Extra HP's, Radar, ZOC, and Defensive Bombard (which was the same order of results as in Round 1)
- German AI used primarily Musketmen (Extra HP's) units to defend it's cities, wheras Soviet used
mostly Pikemen (Enslave).
- Soviet AI built quite a few more HP units (Musketmen) than Germany, whereas Germany built more
Archers (ZOC), Spearman (Def.Bomb), and Swordsman(Radar)
- NOTE: The Enslave ability could also be used to coerce the AI to make more units it does not normally make, especially good for defense units, since the enslave function would not be used that often (but this would only work in certain circumstances, since certain games would not want extra units being enslaved).

WINNER of Round 2: ENSLAVE
Enslave has won this round by a huge margin, and will be eliminated from Round 3 (to see if AI build priorities stay the same, or if they change).

---------------------------------

ROUND 3
AI Builds = 50 turns (each Civ = 350 units total):

Germany:
Warriors - 61 - 17% - Amphibious
Archers - 67 - 19% - ZOC
Spearman - 54 - 15% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 79 - 23% - Radar
Musketman - 89 - 25% - 1 HP Bonus

Russia:
Warriors - 50 - 14% - Amphibious
Archers - 62 - 18% - ZOC
Spearman - 56 - 16% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 85 - 24% - Radar
Musketman - 97 - 28% - 1 HP Bonus


Observations:
- Clear winner this round was units with Extra HP's, and then units with Radar very close behind; then ZOC, Amphibious, and Defensive Bombard
- AI builds units with Amphibious first (as they did in every Round so far), and units with defensive bombard last; other units built in no particular order
- The AI first built units with Amphibious abilites (Warriors) over all others and units with defensive bombard last; other units built in no particular order. The reason is that since all units have the same defense factor of 5, it builds the first unit of the list, which is warrior. So this has made the Amphibious percentage higher than it should be.
- The AI used no particular unit to defend it's cities, and it still used 2 defending units per city, and 3 for the capitol
- Soviet AI built quite a few more HP units (Musketmen) than Germany, whereas Germany built more Archers (ZOC), Spearman (Def.Bomb), and Swordsman(Radar); this is probably due to the fact that the programmers have implemented 'moods' of the AI (as I read in an interview somewhere)... and depending on an AI mood, they may build more of a particular type of unit than others

IMPORTANT NOTE!!!! - The Amphibious Unit production dropped alot! Previously, the AI built (by number) Amphibious, Radar, ZOC... but this round it built (by number) Radar, ZOC, Amphibious; so the AI apparently does not see the Amphibious unit as important as it did before. And even before, Amphibious was not considered as high as it appeared, since the AI will build the unit with the highest defense first to protect its cities, and since all units have a defense factor of 5, it picks the first on the list, which was warrior, so Amphibious was probably much lower than shown on all tests.
- Probable cause of change of build priorities: AI must place high attack values on Enslave and Stealth (Enslave is free units, Stealth is powerful attack tool), and with these gone in this round, AI produced many more units with abilities that 'increase' win percentages (Extra HP's and ZOC), and Radar units are the strange case here (although the build percentage is fairly consistent), so this may cause Amphibious to drop more (since it's advantages may not be considered as high as the others).


WINNER of Round 3: EXTRA HIT POINTS
Extra HP's has won this round, and will be eliminated from Round 4 (to see if AI build priorities stay the same, or if they change).

---------------------------------

ROUND 4
AI Builds = 50 turns (each Civ = 350 units total):

Germany:
Warriors - 73 - 21% - Amphibious
Archers - 94 - 27% - ZOC
Spearman - 76 - 22% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 107 - 31% - Radar

Russia:
Warriors - 73 - 21% - Amphibious
Archers - 104 - 30% - ZOC
Spearman - 68 - 19% - Defensive Bombard, Strength 5, Rate 2
Swordsman - 105 - 30% - Radar


Observations:
- Winner this round was units with Radar, followed VERY closely by ZOC, and Amphibious / Def. Bombard was practically a tie (although Amphibious was ahead by 2 units)
- I tested for 50 rounds to ensure clear results, but the numbers are still very close
- The AI used no particular unit to defend it's cities, and it still used 2 defending units per city, and 3 for the capitol
- Soviet and Germany build percentages were fairly close for all units this round


WINNER of Round 4: RADAR
Radar has won this round, and will be eliminated from Round 5 (to see if AI build
priorities stay the same, or if they change). NOTE: ZOC was very close to Radar, but ZOC has followed Radar in every Round so far, so the AI does consider Radar a higher priority than Zone of Control)

---------------------------------

ROUND 5
AI Builds = 50 turns (each Civ = 350 units total):

Germany:
Warriors - 106 - 30% - Amphibious
Archers - 127 - 36% - ZOC
Spearman - 117 - 33% - Defensive Bombard, Strength 5, Rate 2

Russia:
Warriors - 99 - 28% - Amphibious
Archers - 145 - 41% - ZOC
Spearman - 106 - 30% - Defensive Bombard, Strength 5, Rate 2


Observations:
- Winner this round was units with ZOC, followed by Defensive Bombard, and then Amphibious
- The AI used no particular unit to defend it's cities, and it still used 2 defending units per city, and 3 for the capitol
- Soviet and Germany build percentages were fairly close for all units
- Build priorities again changed this round, with Defensive bombard units being built more often than amphibious (amphib took last); Percentages of units built have steadily increased for all units; except for the Amphibious unit, which has decreased steadily since the first round


WINNER of Round 5: Zone of Conrol
ZOC has won this round, and would be eliminated from Round 6, but it appears that the AI would build more Defensive Bombard units over Amphibious.. I may do a quick test just to see though.

---------------------------------

ROUND 6
AI Builds = 69 turns - stopped before 70 since that is when first tech is researched (each Civ = 483 units total):

Germany:
Warriors - 224 - 46% - Amphibious
Spearman - 259 - 54% - Defensive Bombard, Strength 5, Rate 2

Russia:
Warriors - 244 - 51% - Amphibious
Spearman - 239 - 49% - Defensive Bombard, Strength 5, Rate 2


Observations:
- Winner this round would appear to be the Defensive Bombard (won by 30 more units being built), although Russia built more Amphibious units. So it's pretty close to even, but I personally would have to give Def Bombard the win.
- Also, since all defense factors are the same for all the units, each civ initially built all warriors because they were 'first on the list', so defensive bombard would also be winner with this taken into consideration.


WINNER of Round 6: Inconclusive (read below)
Defensive Bombard has won this round, although the results were very close, further testing discovered something strange though!

Just to see if the amount of bombard would make a difference, I did another test giving the spearman a bombard of 45 and rate of fire 7. The AI still built the units in a similar fashion as they did before, with only slightly more defensive bombard units compared to amphibious... this shows the AI does not look at defensive bombard rates, only that it has them.

So I did another test, removing the defensive bombard ability from the Spearman. This time the AI built the units in the same pattern as before, building more Spearman (no abilities) than Warriors (Amphibious)! This concludes that the AI does not look at defensive bombard at all! Not only that, but it also concludes that the AI does not place a high priority on the Amphibious ability (since it built less units with Amphibious (Warriors) than units with no abilities (Spearman)). This is a somewhat shocking discovery! The AI built these Amphibious units first solely for the reason it was first on the build list (Every test, on the first week, the AI built all Warriors, then slowly switched to building other units as well). The first 2 tests, I only went for 30 rounds, and afterwards I went for 50 rounds... on the first 2, if I did go 50 rounds, Amphibious probably would not have been as high as it was. So it appears that the AI, to a small extent, sees Amphibious as a penalty, or that it does not take the Amphibious flag into consideration.

I did another test, changing the Spearman to Amphibious and the Warrior to no abilities.. and the AI created Warriors in all 7 cities on the first turn... this proves that the AI just builds the first unit on the list (since all their defense stats are the same) and does not take initial build flags into consideration.

None of these flags that have been tested here are not taken into consideration when the AI builds units initially to defend it's cities. It only looks at the defense factor.
----------------------------------

CONCLUSION:
Flags the AI likes the most are:

1. Stealth
2. Enslave
3. Extra HP's (more HP's probably increases AI chance of building a particular unit, see HP Test below)
4. Radar
5. ZOC
6. Inconcluisve (Defensive Bombard is not factored in by the AI... units with no abilities will be produced more often than units with Amphibious)
 
Settings for Test 4 (The Hit Point Test)

The purpose of this test is to evaluate the AI selection among 7 types of units: each unit has an Attack and Defense = 5. Combined Attack + Defense for each unit = 10. All units move 1. Each unit has a different amount of extra Hit Points. Conditions have been set to make this test as absolutely "vanilla" as possible.

1. There are two Civs. Each Civ has 7 cities and begins with no units. These civs start at war.
2. Each city begins at size 5.
3. Cities are limited to a maximum size of 5.
4. Each Civ is limited to one Gov type, “Despotism” modified to minimal corruption and no tile penalties. All units are free, no units may be rushed, and war weariness is “none”.
5. No Civs have been given any bonus traits (Commercial, Expansionist, etc.)
6. Aggression for all Civs has been set to “3".
7. All Civs have been made members of different cultural groups.
8. All terrain is grassland which produce 2 food and 3 shields, with 1 hill with bonus resource for each nation.
9. There is one bonus resource which provides 25 gold; one of these is available for each nation.
10. Standard victory conditions are in use.
11. For this round, 7 unit types exist – see below for unit information.
12. All units cost 10 and require support.
13. No Civ AI strategies have been checked (e.g., "Build Often"; etc.); unit strategy flags for all three unit types have been set to both "offensive and "defensive".
15. Number of citizens quelled by military = 3.
16. Each city has a temple which produces 5 content faces, 0 culture, 0 maintenance.
16. Techs take 70 turns to research minimum.
17. Level of play = Monarch, AI Aggression = Normal.
18. Each city will be able to produce 1 unit per turn.

The 7 types of units are:

"Warrior" A/D/M = 5/5/1 - 0 Extra Hit Points
"Archer" A/D/M = 5/5/1 - 1 Extra Hit Points
"Spearman" A/D/M = 5/5/1 - 2 Extra Hit Points
"Swordsman" A/D/M = 5/5/1 - 3 Extra Hit Points
"Pikeman" A/D/M = 5/5/1 - 4 Extra Hit Points
"Longbowman" A/D/M = 5/5/1 - 5 Extra Hit Points
"Musketman" A/D/M = 5/5/1 - 6 Extra Hit Points

All units were flagged both "offense" and "defense".

Results:

Wartime builds = 50 turns (each Civ = 350 units total):

Germany:
Warriors - 4 - 1% - 0 HPs
Archers - 8 - 2% - 1 HPs
Spearman - 28 - 8% - 2 HPs
Swordsman - 33 - 10% - 3 HPs
Pikeman - 44 - 13% - 4 HPs
Longbowman - 78 - 23% - 5 HPs
Musketman - 141 - 42% - 6 HPs

Russia:
Warriors - 4 - 1% - 0 HPs
Archers - 8 - 2% - 1 HPs
Spearman - 16 - 5% - 2 HPs
Swordsman - 36 - 11% - 3 HPs
Pikeman - 51 - 15% - 4 HPs
Longbowman - 90 - 27% - 5 HPs
Musketman - 131 - 39% - 6 HPs

Observations:
- I deducted 14 units from the Warrior, since it is known that the AI will initially build the unit with the highest defense (when it has no units in its cities); in this case all units have the same defense factor of 5, so it builds the first unit on the list, which was the warrior.
- As it can be seen, with no other factors to take into consideration, the AI will still build all units, but places a higher priority on units with more Hit Points


1. Musketman (+6 HPs) - 272 units built - 40%
2. Longbowman (+5 HPs) - 168 units built - 25%
3. Pikeman (+4 HPs) - 95 units built - 14%
4. Swordsman (+3 HPs) - 69 units built - 10%
5. Spearman (+2 HPs) - 44 units built - 7%
6. Archer (+1 HPs) - 16 units built - 2%
7. Warrior (+0 HPs) - 8 units built - 1%


EDIT: I did another test using only the Musketman (+6 HPs) and the Warrior (+0 HPs)... the results are below:

350 units built by each Germany and Russia (total 700)

1. Musketman (+6 HPs) - 631 units built - 90%
2. Warrior (+0 HPs) - 69 units built - 10%
 
In order to try to create an 'Algorithm' to use (to try to figure out how the AI decides how to build it's units)... we need a 'base' to build on...

A normal unit with no abilities and having the same offense and defense would be this 'Base Unit'. Our base unit is a 5/5/1 unit with no abilities.

And this 'Base Unit' should be given a value of 1

Hence, if the AI has 2 'Base Units' available to choose from:
- both 'Base Units' are exactly the same (5/5/1 no abilities)
- 1/2 = 50% build ratio for each unit (value of unit/number of units AI can build)

We could start by trying to find how much certain abilities increase the 'Base Unit' value. For example, if AI can build 2 units, a 'Base Unit' and a 'Base Unit with Stealth', this build ratio may give us good info on how much it values specific values, and we may be able to place these numbers into an equation to (at best) very roughly make a determination.

Of course, it is impossible to make something like this accurate, but we may be able to come somewhat close.
 
Kudos! :thumbsup: I'm delighted that you've picked up on this. :goodjob:

BTW, in my testing I noticed certain random and non-random oddities: (1) different Civs built consistently different unit mixtures (2) the AI sometimes clearly built "inferior" units (3) the AI seemed to shun extremes (e.g., 9/1/1 and 1/9/1) and, (4) IIRC it factored in HP so that a 5/5/1 HP:1 was built in roughly equal proportions to a 3/2/1 HP:2 (BTW, Movement Factor seemed to have no effect!)

Best,

Oz
 
I have also found, in regard to the stealth ability, it does not matter if the stealth target is even buildable in the game, the AI will build stealth units just as often. This is crazy, but is true:

Test 1:
2 units were used, a base unit (5.5.1 with no abilities) and a stealth unit (5.5.1 with stealth against the warrior-which is the Base Unit)
AI built (out of 700 builds):
Stealth Unit - 667 built - 95%
Base Unit - 33 built - 5%

Test 2:
2 units were used, a base unit (5.5.1 with no abilities) and a stealth unit (5.5.1 with stealth against a unit that could not be built by any nation)
AI built (out of 700 builds):
Stealth Unit - 663 built - 95%
Base Unit - 37 built - 5%

CONCLUSION
AI only looks at Stealth ability, and not what Stealth targets it can act upon. This can be used by modders to coerce the AI to build more units of a certain type that it normally would not build that often.
 
CONCLUSION
AI only looks at Stealth ability, and not what Stealth targets it can act upon. This can be used by modders to coerce the AI to build more units of a certain type that it normally would not build that often.

Now that is some seriously useful information! - BTW, I've lost track: does Stealth Attack actually work or not? :confused:

@tom2050 - check out the edits to my last post.

Best,

Oz
 
Tom2050 very interesting results and quite allot of testing. Ozzy I also have noticed that the AI builds different mixtures depending upon the civilization. I wonder how much the abilities and aggression level affects builds.
 
Tom2050 very interesting results and quite allot of testing. Ozzy I also have noticed that the AI builds different mixtures depending upon the civilization. I wonder how much the abilities and aggression level affects builds.

All my testing was done (like tom2050's) with the conrol set being A+D=10, likewise with Agression set at 3. I've always suspected that there are some weird, undocumented ( :shake: ) "priorities" in the code to force the appearance of variety.

Best,

Oz
 
Now that is some seriously useful information! - BTW, I've lost track: does Stealth Attack actually work or not? :confused:

As far as I know, Stealth attacks work... In Rocoteh's WW2 Global it is used and only works against the targets specified in the .biq file... as far as the AI using stealth, I have never paid much attention... but I think it does. Ill have to start a Britain game in WW2 global, and see if the Germany AI uses it's subs (which have stealth) to attack only top ships, or if it does indeed use their stealth abilities.

EDIT: I was going to say I think the same thing applies to the Enslave ability as well, the AI puts a high value on Enslave, but does not take into consideration what type of unit is created out of the Enslave. So the AI doesn't care if Enslave creates a worker or a Mech Infantry, it will probably build them at the same rate.
 
Yeah, stealth attack works.

I'm having a hard time believing that the AI doesn't build units based on the units speed- I'm sure that if Horsemen and Archers are available, but Swordsmen not, the AI tends to build a lot more horsemen... :hmm:
 
I have also found, in regard to the enslave ability, it does not matter what unit the enslave ability produces, the AI will build enslave units just as often. This is also somewhat of a crazy thing, as it shows the AI builds enslave units that produce a worker just as often as the AI builds enslave units that produce Modern Armor!

Test 1:
2 units were used, a base unit (5.5.1 with no abilities) and an enslave unit (5.5.1 with enslave producing a Worker)
AI built (out of 700 builds):
Stealth Unit - 597 built - 85%
Base Unit - 103 built - 15%

Test 2:
2 units were used, a base unit (5.5.1 with no abilities) and an enslave unit (5.5.1 with enslave producing a Modern Armor)
AI built (out of 700 builds):
Stealth Unit - 596 built - 85%
Base Unit - 104 built - 15%

CONCLUSION
AI only looks at Enslave ability, and not what unit is produced by the enslave. This can be used by modders to coerce the AI to build more units of a certain type that it normally would not build that often. Also, there is no difference in build percentage even if the enslave results in multiple units being produced.
 
All my testing was done (like tom2050's)I've always suspected that there are some weird, undocumented ( :shake: ) "priorities" in the code to force the appearance of variety.

Best,

Oz
Yes I am thinking there is something beneath the surface that we do not know.
Yeah, stealth attack works.

I'm having a hard time believing that the AI doesn't build units based on the units speed- I'm sure that if Horsemen and Archers are available, but Swordsmen not, the AI tends to build a lot more horsemen... :hmm:
Yes I find that is also strange. Maybe it also has to do with resources. Too bad one of the programmers is not available to really explain things.
I know two flags that definitely makes the AI want to build the units.
Hidden Nationality
Starts Golden Age
Also I am willing to bet that the "blitz" ability coupled with increased movement rate will effect AI builds.
 
Yeah, stealth attack works.

I'm having a hard time believing that the AI doesn't build units based on the units speed- I'm sure that if Horsemen and Archers are available, but Swordsmen not, the AI tends to build a lot more horsemen... :hmm:

Ah, my dear Virote, dig through these hoary archives and you'll find it's a test I ran myself.

My theory for some time now is that the AI is not programmed to make "rational" decisions comparing unit stats. Yes, it does SOME of this, but I believe it's design is geared towards selection of units from a very (to a modder's POV) limited force pool. Think about the sequences of units available at any given time in a vanilla game: that's the range of choice the AI is equipped to deal with, so it doesn't have to decide which is the best attacker, the best defender, etc.; even though it is equipped to perform these simple functions, tom2050's tests should tell you all you need to know about the Artificial Idiot's range of decision making prowess.

This is not to say that there aren't rules we haven't uncovered: the "rogue" choices the AI made supply evidence of at least a minor randomness factor.

BTW, in your Horsemen/Archers example, the Horseman of course requires a resource (horses); I believe the AI "perceives" units that require a resource to be more valuable than those which do not.

Best,

Oz
 
Also I am willing to bet that the "blitz" ability coupled with increased movement rate will effect AI builds.

Perversely, I'd be willing to bet on the "Blitz" flag increasing a unit's desirability to the AI - but I'd also bet that would be the case even if the unit's MF=1.

-Oz
 
BTW, in my testing I noticed certain random and non-random oddities: (1) different Civs built consistently different unit mixtures

I bet that these 'unit mixtures' are based on the culture group selected for a particular civ, since these culture groups cannot be changed in the editor and are programmed into the game (american, european, asian, etc..). These must be the cause of the different unit builds!

(2) the AI sometimes clearly built "inferior" units

Yes, it appears that all units that are buildable to a civ always have a 'chance' to be built, but sometimes that chance is so low (for an inferior unit), that in order to see it build one, it would take more turns than most games go for (see the Extended Hit Point test below, it shows this in action!)

(3) the AI seemed to shun extremes (e.g., 9/1/1 and 1/9/1)

The AI shuns them, I am surprised.. especially since many defense units in the normal game are of that sort! 1.3.1 pikeman, 1.4.1 musketman, etc...

(4) IIRC it factored in HP so that a 5/5/1 HP:1 was built in roughly equal proportions to a 3/2/1 HP:2 (BTW, Movement Factor seemed to have no effect!)

I am surprised that the 1 extra HP amounted to the same thing as 3 less defense and 2 less attack! That is quite amazing!
 
The AI shuns them, I am surprised.. especially since many defense units in the normal game are of that sort! 1.3.1 pikeman, 1.4.1 musketman, etc...
Ignoring UUs, 1.3.1 and 4.1.1 are the most extreme ones in the basic game, either of which is a far cry from 1.9.1 or 9.1.1.

(FWIW, in my experience the AI doesn't build many Longbowmen.)
 
Extended Hit Points Test
The 'Base Unit' is a 5/5/1 unit with no special abilities and +0 Hit Points
The 'Test Unit' is a 5/5/1 unit with no special abilities and +(a certain amount) of HPs

Test (exact same units, should be 50/50 build ratio):
AI built (out of 700 builds):
Test Unit (+0 HPs) - 356 built - 51%
Base Unit - 344 built - 49%

Test 1:
AI built (out of 700 builds):
Test Unit (+1 HPs) - 430 built - 61%
Base Unit - 270 built - 39%

Test 2:
AI built (out of 700 builds):
Test Unit (+2 HPs) - 462 built - 66%
Base Unit - 238 built - 34%

Test 3:
AI built (out of 700 builds):
Test Unit (+3 HPs) - 526 built - 75%
Base Unit - 174 built - 25%

Test 4:
AI built (out of 700 builds):
Test Unit (+4 HPs) - 555 built - 79%
Base Unit - 145 built - 21%

Test 5:
AI built (out of 700 builds):
Test Unit (+5 HPs) - 599 built - 86%
Base Unit - 101 built - 14%

Test 6:
AI built (out of 700 builds):
Test Unit (+6 HPs) - 631 built - 90%
Base Unit - 69 built - 10%

Test 7:
AI built (out of 700 builds):
Test Unit (+9 HPs) - 681 built - 97%
Base Unit - 19 built - 3%

Test 8:
AI built (out of 700 builds):
Test Unit (+15 HPs) - 700 built - 100%
Base Unit - 0 built - 0%

This shows that the AI uses a 'percentage calculation' to determine what it builds.. this means that there is ALWAYS a chance that any inferior unit can and will be built, but often it would probably require enormous amounts of turns and units to be produced in order to show 1 being built.
- For the above TEST 8, if I tested long enough, a normal unit would probably eventually show up, but I am not determined enough to do something like this :)
 
Speed Test
The 'Base Unit' is a 5/5/1 unit with no special abilities and 1 Movement Point
The 'Test Unit' is a 5/5/# unit with no special abilities and +(a certain amount) of Movement Points

Test 1: Test Unit has Speed 2
AI built (out of 700 builds):
Test Unit (5.5.2) - 453 built - 65%
Base Unit (5.5.1) - 247 built - 35%

Test 2: Test Unit has Speed 3
AI built (out of 700 builds):
Test Unit (5.5.3) - 500 built - 71%
Base Unit (5.5.1) - 200 built - 29%

Test 3: Test Unit has Speed 4
AI built (out of 700 builds):
Test Unit (5.5.4) - 557 built - 80%
Base Unit (5.5.1) - 143 built - 20%

Test 4: Test Unit has Speed 5
AI built (out of 700 builds):
Test Unit (5.5.5) - 570 built - 81%
Base Unit (5.5.1) - 130 built - 19%

Test 5: Test Unit has Speed 6
AI built (out of 700 builds):
Test Unit (5.5.6) - 600 built - 86%
Base Unit (5.5.1) - 100 built - 14%

The AI does increase the percentages of it's builds to a higher amount based on the units speed factor, but in reality units speeds hardly ever surpass 2, so if all else is equal, it will build a faster unit 65% of the time.
 
Ignoring UUs, 1.3.1 and 4.1.1 are the most extreme ones in the basic game, either of which is a far cry from 1.9.1 or 9.1.1.

(FWIW, in my experience the AI doesn't build many Longbowmen.)

Yes true, and looking at the type of unit builds the basic game has, there are 'patterns' in regards to offense and defense numbers the units have. These were probably implemented that way to conform with the way they programmed the AI (dumb, yet can appear smart with it's limited force pool).
 
Blitz Test
I did tests with terrain movement rate set at 5 and 1, to see if it caused any effects on AI decision making (although I highly doubted that to begin with), but as it shows, it did not.

Test 1:
The 'Test Unit' is a 5/5/1 unit with Blitz
The 'Base Unit' is a 5/5/1 unit without Blitz
Movement rate on Terrain is set at 5

AI built (out of 700 builds):
Test Unit - 378 built - 54%
Base Unit - 322 built - 46%

Test 2:
The 'Test Unit' is a 5/5/1 unit with Blitz
The 'Base Unit' is a 5/5/1 unit without Blitz
Movement rate on Terrain is set at 1

AI built (out of 700 builds):
Test Unit - 373 built - 53%
Base Unit - 327 built - 47%

Test 3:
The 'Test Unit' is a 5/5/2 unit with Blitz
The 'Base Unit' is a 5/5/2 unit without Blitz
Movement rate on Terrain is set at 5

AI built (out of 700 builds):
Test Unit - 378 built - 53%
Base Unit - 322 built - 47%

Test 4:
The 'Test Unit' is a 5/5/2 unit with Blitz
The 'Base Unit' is a 5/5/2 unit without Blitz
Movement rate on Terrain is set at 1

AI built (out of 490 builds):
Test Unit - 282 built - 58%
Base Unit - 208 built - 42%
(With movement rate of 1 on terrain, I had to stop test early, otherwise I would of had to start counting units getting killed and so forth, but it is safe to assume the build percentages would have been close to the previous 3 tests)

Conclusion
- From these results, it appears that the AI does not place a high value on the Blitz ability. From a human player standpoint, Blitz is an incredibly powerful tool, but it is primarily because human players know how to use bombardment to lower an enemies hit points, and then use Blitz forces to knock out many enemies while minimizing causalities; the AI does not know how to do this, and the programmers probably realized this, and thus programmed the AI to not place a high value on Blitz.
- Giving a unit the Blitz ability, would only increase the AI building them (with all other things being equal) by around 4%.

I personally expected the Blitz flag to cause units to be built much more often! This was completely unexpected!
 
Back
Top Bottom