What logic does AI use in building ships?

haluu

Confused Troglodyte
Joined
Oct 13, 2010
Messages
585
Hey guys. While testplaying my mod for the next release, I noticed that the AI only builds the most simple sea unit (naval transport flag checked). I know that in the default game the AI builds ships just fine, but not in my mod.

I can get it to build "better" sea units by flagging these better units as "transports". Does the AI totally ignore the "naval power" flag? Also, I'm having issues getting the AI to build ships in any decent quantity, even with naval units set to "build often" for all civs. So I guess my 2 questions are:

1) how do I get AI to build higher level naval units?
2) how do I get AI to build more naval units?

I have attached my .biq. Thanks.
 
Haluu, the way to do it is to have cheap auto-producing buildings that produce ships at the rate you need them to for your mod. Civinator uses this method in CCM. Read his thread here and at Storm Over Civ for in depth explanations.
 
The AI will occasionally re-evaluate what it is building depending upon it's situation. e.g. If it goes to war, it sometimes will switch cities to land units to defend it's cities, etc. It's possible that it doesn't get that many ships out because of their expense. Lowering the cost of sea vessels in general would probably help; if that is something you would consider.

WW2 Global had an issue of USA AI hardly ever building ships; likely because of it being in locked alliance, it would tend to build only land troops, although other nations didn't have this problem. A strange thing, no doubt.

We're not even sure if and what build often actually does, or when it comes into effect. Tests have been done on build often flags, but no clear difference has been noticed in AI build quantities. Ozymandias made a thread which had alot of tests done to determine what AI decides to build.
 
EJ helped me in my thread over here (check p.2):

Advanced Fleets - A new Approach

Well worth the read, and it totally changed the way the AI behaves in my mod. My personal record was an AI Fleet (the Brits, of course) attacking Denmark with around 70 (!) ships, and actually bombarding the coast before sending in the marines...
 
Cost is indeed a huge factor for the AI. I think it also rates sea units as being intrinsically lower than land units, so if you want the AI to build a lot of sea units (say, around about as much as land), you may want to make their costs lower than the cost of similar land units. For example, in my Greek scenario, the average available land unit early in the game was about 20-30 shields, and sea units were about 15-25 shields, and the AI built plenty.

I also think it factors transports slightly differently to this - cost doesn't seem to matter as much from what I've seen, its more related to how many units they can transport at a time, and how much they need to transport.
 
>Implying the AI uses logic for anything.
 
wow. really interesting info guys! thanks to all of you! i'll try these methods out and let you know if i'm still having problems. :lol:
 
As posted above, low building costs are a big factor in triggering the AI to build a lot of ships.

Another big factor is to give a ship a bombardement ability - especially when there are no other bombardement units available at that time.

The third factor in my eyes is the "seafaring trait". Civs with this trait tend to build transport ships very early - but not ships with the naval power flag.
 
I have played around quite a bit with the naval units in the game, changing the combat ratings, transport capacity, and to an extent the cost. I also play only on continent and archipelago maps, so if the AI wants to move around, it has to build some ships. I have a mod posted with all of the changes in the completed modpacks section. http://forums.civfanatics.com/showthread.php?t=322522

Based on that, my experience is that the AI is not what I would call consistent in what it does. It will build naval transports, at times, and use them to colonize other islands/continents, and occasionally to attack me directly. Then there are times when I encounter a fairly advanced AI which could build ships, and has not built anything except a harbor. Harbors boost not just food, but also shields and gold in my mods. There appears to be a little correlation between the boosted harbor and ship-building, but I have not documented it to any extent. You could try boosting the harbor value and seeing how much that helps in your mod.
 
Haluu, in my humble experience the AI uses 'naval power' as escorts and little else. :(
 
hm... interesting....

i have played around with some of the ideas mentioned by you guys, and released a new version of my mod because i was satisfied with the results of multiple tests. thanks again, everyone!

In my mod there is a 'shipyard' that produces veteran sea units and allows for sea trading. It is also relatively cheap to build. The AI builds these shipyards often, usually right after the first 'culture' building. With many AI coastal cities who have shipyards, the AI actually builds many ships, and actually attacks with entire fleets during war from what i've seen (yes, even the ones with only 'naval power' marked). They weren't just escorts. So i think the combination of accessible 'shipyard' and cheap ships made the Ai utilize it's navy much better. :lol:
 
If using autoproducing buildings that can been built in every coastal town, take care of the MUA (Maximum Units Allowed =8192 units). This limit can be reached quickly, if the intervals in autoproducing units are too short and there are a lot of buildings that can autoproduce units.
 
Back
Top Bottom