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

tom2050,

Very interesting experiments.
They inspired me to resume my old experiments with AI and how it choose build strategy.

Thus AI would build Submarines and Nuclear Submarines in one of my test scenarios today.

Will now continue with WW2-Global and check out if it works there also.


Rocoteh
 
I wonder if the AI would build more Artillery if it had the Stealth Attack ability? This shouldn't change anything gameplay wise (they still can't physically attack), but it could push the AI into building more...

That is a good idea, the only problem would be, that after the AI has built them, they would all just sit comfortably within the confines of their own cities. Of course, you never know what the AI will do if it has tons of them, it may actually go on some crazy arty offensive!
 
tom2050,

Very interesting experiments.
They inspired me to resume my old experiments with AI and how it choose build strategy.

Thus AI would build Submarines and Nuclear Submarines in one of my test scenarios today.

Will now continue with WW2-Global and check out if it works there also.

Rocoteh

Hello! That is good news, keep me updated.

There is definitely some type of 'flag' that the AI has to wait for in order for it to build navy, once that 'flag' turns on, it starts pumping out ships. I started doing some tests to try to figure out exactly what it is. And it got me thinking, in reference to your WW2 Global, how Japan and Great Britain pump out ships like there is no tomorrow! :eek: and yet the US does not! (Although they do start building Battleship C2's eventually).

Did the fact that the Earth Map may be seen by the AI as 2 super-continents ever hold up? Being the reason large navy wasn't being produced?

I made a test scenario with 2 continents both locked in war, and both sides would make transports, but would NOT make a single ship; so I am thinking the Global AI must have some 'conditions' that need to be met in order for naval production to commence. It has to have something to do with map layout, there is no other explanation. I will try out different map variations, islands, numbers of continents, etc to see if I can't come across a key to this.
 
That is a good idea, the only problem would be, that after the AI has built them, they would all just sit comfortably within the confines of their own cities. Of course, you never know what the AI will do if it has tons of them, it may actually go on some crazy arty offensive!
Or hopefully a combined arms offensive.
Hello! That is good news, keep me updated.

There is definitely some type of 'flag' that the AI has to wait for in order for it to build navy, once that 'flag' turns on, it starts pumping out ships. I started doing some tests to try to figure out exactly what it is. And it got me thinking, in reference to your WW2 Global, how Japan and Great Britain pump out ships like there is no tomorrow! :eek: and yet the US does not! (Although they do start building Battleship C2's eventually).

Did the fact that the Earth Map may be seen by the AI as 2 super-continents ever hold up? Being the reason large navy wasn't being produced?

I made a test scenario with 2 continents both locked in war, and both sides would make transports, but would NOT make a single ship; so I am thinking the Global AI must have some 'conditions' that need to be met in order for naval production to commence. It has to have something to do with map layout, there is no other explanation. I will try out different map variations, islands, numbers of continents, etc to see if I can't come across a key to this.
That is a possibility although I hope not because it really screws up real world maps. Has anyone seen if seafaring effects naval builds? I realize it gives the civilization 1 extra naval movement but if it makes the AI build more ships maybe then give the Civilizations without that ability a naval academy that gives them +1 movement also.
 
Did the fact that the Earth Map may be seen by the AI as 2 super-continents ever hold up? Being the reason large navy wasn't being produced?

tom2050,

It may have impact.

I will make a test version of WW2-Global where Panama is replaced with
a coastal tile.
Hopefully this will increase US AI naval production.

Rocoteh
 
My observations on the AI building ships is that on a continent map with several continents and a fair number of islands and on an archipelago map, the AI will build ships. On some maps, the AI has even colonized another continent or island. However, on maps with only a couple of large continents, the AI does not seem to build ships until I contact them from another continent. That seems to act as a triggering agent. As for England and Japan building ships, I have also noticed that the smaller the initial island or continent occupied by the AI, the more likely it is to build ships. This would fit for England and Japan in the Global War game.

My suspicions are that there is a critical number of tiles to the land mass that the AI is on which triggers shipbuilding. The larger the continent land mass, the lower the ship probability. On the Ptolemy map, where you essentially have a single land mass, with some islands, the AI does not build ships until contacted by me, and I always have ships. Where you might focus your testing is on setting up land masses of specific sizes and then monitoring at what point does the AI build or not build ships.
 
Hi Tom, thank you for carrying out these tests. In your next round would you be able to check if having a pop cost for the unit has an effect on whether units are produced? It doesn't seem to put the AI off building units in my experience, but some more controlled tests would be great if you get the time.
 
Hi Tom, thank you for carrying out these tests. In your next round would you be able to check if having a pop cost for the unit has an effect on whether units are produced? It doesn't seem to put the AI off building units in my experience, but some more controlled tests would be great if you get the time.

@Keroro - mildly o/t: does the AI sensibly limit how many pop-using units it produces, or will it decimate its own cities building?

Thx,

Oz
 
@Keroro - mildly o/t: does the AI sensibly limit how many pop-using units it produces, or will it decimate its own cities building?

Thx,

Oz
Hi Oz, how are you? :) It's not that much o/t, considering that the thread is about how the AI builds units.

The latter, unfortunately seems to be the case. In my scenario I'm finding that my lovingly pre-placed cities are being reduced to a pop of 1 or 2 by a combination of pop-cost units and pop-rushing. They can be built back up by adding the slaves that are produced by most of my military units, but that's not the tactic I was going for, especially when pushing into India. Frustration!
 
Hi Oz, how are you? :)

Life is insane, but I'm doing well, thanks :) , et tu?

The latter, unfortunately seems to be the case. In my scenario I'm finding that my lovingly pre-placed cities are being reduced to a pop of 1 or 2 by a combination of pop-cost units and pop-rushing. They can be built back up by adding the slaves that are produced by most of my military units, but that's not the tactic I was going for, especially when pushing into India. Frustration!

So the trick is to try to guestimate how long it will take the average city to produce a single pop-cost unit and make that the interval between units production ... ? :hmm:

As for pop-rushing, if you're having population problems on both fronts, I'd go with Paid Labor. I don't even think it's too wildly inaccurate for the era.

Best,

Oz
 
Life is insane, but I'm doing well, thanks :) , et tu?
Glad to hear it. I'm generally OK, though a small promotion at work has not helped my civ work-rate. :(

So the trick is to try to guestimate how long it will take the average city to produce a single pop-cost unit and make that the interval between units production ... ? :hmm:

As for pop-rushing, if you're having population problems on both fronts, I'd go with Paid Labor. I don't even think it's too wildly inaccurate for the era.
Yeah, I think I'll be doing that. I was trying to make sure that there was plenty of gold to pillage, but it's no good if all the cities end up at size 1 or 2. Come to think of it I seem to remember that you can stop the AI from hurrying production at all - might be just as well to do that. It does look like you have to consider your growth rates very carefully when you have pop costs for units.

My experience might be affected by the fact that my scenario has a locked war. Without that the AU may behave a little more sensibly.
 
AI Naval Builds

Not to revive an old thread... but just to add something in here. It seems that as far as naval production goes, the AI seems to consider Naval Transports and Naval Carriers in a different light than Naval Powers. I don't have spreadsheets and stacks of data to back this up, but am fairly confident that this conclusion is correct.

I believe the AI considers (to some extent) the decision to build transports/carriers based partially or fully off w/e algorithm it uses for ground forces and air. It seems that when I have Build Often set for only navy; the AI built less transports than when it was set to navy, offensive and defensive ground units.

On the same note, on another test, initially build often was set to offensive and defensive ground, naval, and air. The AI rarely/occasionally built a naval carrier. When build often naval was removed (so offensive and defensive ground and air remained), the AI built 2-3x as many carriers as before.

As far as Naval Missle Transports go, I have no clue, done no testing with that. But this leads me to believe that "BUILD OFTEN NAVAL" is more for ships with ONLY "NAVAL POWER" selected. A simple test would be to have build never 'naval' turned on, and the AI should still build carriers and transports (I may try it to see). This may already be known, but I figured I would throw this out there.

So in essence, the point is, a good way to get a nation to perhaps build more NAVAL WARSHIPS is to simply allow it to be a transport also (for 1 troop) or (1 aircraft). Of course, it depends on the scenario if it is an option. For a pre-aircraft scenario, adding the ability to be a Naval carrier would effect nothing, but may make the AI build more of these ships anyways; and with build often AIR selected would increase this chance.

Tom
 
AI Naval Targets

Also, just from observation, AI transports seem to attack (drop troops of at) small islands first before they will attack larger landmasses. The AI must assess landmass size as a part of a civ's strength.. because the AI will travel halfway around the world to reach a small island somewhere and attack there, instead of dropping troops off at a major continent right next door. So for instance on World Maps, if there is an enemy on an island anywhere, the AI will likely go there first, instead of attacking a enemy city on the mainland nextdoor. Of course, there are rare exceptions.. such as... The AI will judge defensive strength of that city, and if very weak, may attack the city on a larger landmass instead. The AI seems to know what a city's defensive strength is inherently, without having to see it (no surprise there).

This is somewhat of a problem for scenarios because there is not much of a way to get around it, since AI actions cannot be altered in any way.

So as far as I know, how AI determines where a transport will attack:
1. Defensive strength of units in a city, (number of units in city?).
2. Will go for smaller landmasses before larger ones (with all other things equal).

Tom
 
Well, I have been doing some tests to try to see if I can figure out why the AI never builds navy sometimes.

I have done no tests for some time though, since May of last year. But it is one of those things that I am compelled to figure out. Too bad Civ 3 source code will likely never be released due to some arcane 'ownership issues'. Then we wouldn't need to worry about things like this. :)

Tom
 
It also seems that the AI considers hitpoints on a naval ship a huge deciding factor when it considers which to build.

Between these 2:
Ship 1 with: 11 Attack, 8 Defense, 8 MP, 12 hitpoints (cost 360)
Ship 2 with: 70 Attack, 62 Defense, 6 MP, 6 hitpoints (cost 800)

AI chose to build Ship #1 more often! Why? No one knows... AI probably places way too much emphasis on hitpoints. And since it was shown the AI likes more expensive ships, the reason it choose ship 1 is somewhat startling. The only thing it wins on is hitpoints and movement. They do both have the ability to carry 1 troop, both have bombard (Ship 1 has 7/1/2 - Ship 2 has 20/1/3).

If hitpoints are valued this much, it's likely it is the similar with ground units and air units, although I am unsure on this.

Tom
 
Good to know. Another example of the complete stupidity of the AI. But on the possitive side could be useful for increasing build odds, like all your research. While I would like to see a truely intelligent Civ 3 AI, I know that that is just a dream, so I'll settle for being able to get it to build a bigger variety of units. Once again thankyou!!

Nick
 
It's very nice to see someone pick this up and expand it to the naval realm :love:

Re: your excellent observations, when testing land (see early in the thread):

The AI
  1. seemed to build Defensive:Offensive units (based on DF, not strategy flag) ca. ~55%:45%. It also directly figured DF as DF*HP
  2. It builds the cheapest defensive unit first in an empty city.

I'm not certain how this bears on your work, but data is data, and kudos for your observations and hypotheses.

Fine stuff :thumbsup:

Best,

Oz
 
There are those out there trying to get Take2 to release source code (or improved editor), or at least get a statement from them (which they will not do). Apparently it goes something like this, Take2 owns the game, but not the rights to release the source code (which firaxsis still has somehow).. and since this will not likely change ever, chances of getting source code is nill. Hopefully one day, then we can all improve the AI! SMILE1.gif

Tom
 
Back
Top Bottom