How to make the AI build tonnes of units

Kieran

Warlord
Joined
Nov 27, 2005
Messages
107
I have enabled initial 999 free military units, and made the AI pay no civic upkeeps or city maintenance. I've reduced the unit build time too.

However the AI is only putting about 8 defenders in its cities and not that many outside its cities even though it can afford many more.

I've checked the AI civs and they have plenty of money but when they have all buildings built and 8 or 10 defenders they switch to building research instead.

I've tried making research, wealth and culture unbuildable but in that case the AI actually chooses to make nothing at all in its cities.

Does anyone know what I can do so that the AI will keep pumping out units?
 
You could try going into a specific Leader's XML files and set BuildUnitProb to 100. I have no idea what that will do though....
 
Kieran said:
I've checked the AI civs and they have plenty of money but when they have all buildings built and 8 or 10 defenders they switch to building research instead.

I've tried making research, wealth and culture unbuildable but in that case the AI actually chooses to make nothing at all in its cities.
Interesting, we were having the opposite problem of the AI building too MANY units, so it's good to know it stops at some point.

I would try woodelf's suggestion first, but I suspect your problem is rooted somewhere much deeper, in the AI itself, which you'll need the SDK to root out. I've found that the AI hard-codes a lot of assumptions about game rules (as it must for a game this complex). How else would it "know" how many units it "should" build?
 
The whole bulding & city managment AI is something I'm going to start tackling properly in about a months time. At the moment the number of defenders needed increases proportionally to the city size, with a few other linear factors.
 
Actually the way to make the AI build a lot of units is to remove the unit upkeep. That is how I have it in my mod and the AI always ends up with hundreds of units.

It takes time for them to build that many, however, it does work. ;)
 
Agent 009 said:
That would work also, however, the biggest problem is if it was set to 100, then the AI would never build buildings and/or Wonders. ;)


then use 99 :goodjob:

j/k :p


I think the "vanilla" AI is this

15 is low

40 is high


so maybe use something higher than 40 ... like 60 or something
 
Officer Reene said:
then use 99 :goodjob:

j/k :p


I think the "vanilla" AI is this

15 is low

40 is high


so maybe use something higher than 40 ... like 60 or something

LOL! 60 would certainly be better. Although I am merely speculating that 100 would make the AI not build anything but units, however, it does seem logical.

The idea I stated above about removing the unit upkeeps works perfectly. If he were to do that and then change the base free units number back to the original values, then it would give the desired effect he wants.

Basically, the upkeep being removed will make the AI think units are free, so they will continue to build them untill the actually start losing money. That's when they stop. The amount of free units increases due to how many cities that civ controls and how big they are. ;)
 
Agent 009 said:
LOL! 60 would certainly be better. Although I am merely speculating that 100 would make the AI not build anything but units, however, it does seem logical.


I wonder if anyone can verify this...? :confused:


Agent 009 said:
The idea I stated above about removing the unit upkeeps works perfectly. If he were to do that and then change the base free units number back to the original values, then it would give the desired effect he wants.

how do you remove upkeep costs? set it to 0?
 
Officer Reene said:
how do you remove upkeep costs? set it to 0?


You need to edit the CIV4UnitInfos.xml file.

Find this parameter:

Code:
<bMilitarySupport>1</bMilitarySupport>

And change the 1 to a 0. Basically you can easily do this with notepad by a find replace method. This will make each unit not cost anything extra.

Example of how this works:

Let's say you have an empire which allows 50 free units. You have 100 units total.

Normally with <bMilitarySupport>1</bMilitarySupport> you will have a base cost of 100 gold. 100 (total units) - 50 (free units) = 50 (units that need support) *2 gold = 100 gold. It gets multiplied by 2 because of the cost being 1. However, if you have <bMilitarySupport>0</bMilitarySupport>, then it will cost only 50 gold instead of 100 as the 1 support isn't applied and only the base number is. ;)

It would seem as if this is how it works. However, the AI seems to not look at the base number so much as the cost. If the cost is 50% reduced, they build units much faster and more often. ;)

Also keep in mind I am not applying the handicap value to this calculation. :)
 
Agent 009 said:
You need to edit the CIV4UnitInfos.xml file.

Find this parameter:

Code:
<bMilitarySupport>1</bMilitarySupport>

And change the 1 to a 0. Basically you can easily do this with notepad by a find replace method. This will make each unit not cost anything extra.


man you gotta edit every unit... that sucks (although the Replace function should handle it)


I'll keep it in mind
 
Top Bottom