Ok, this is gonna be a long but informative post, as I've dedicated the last 2 days entirely to observe AI autoplay esp. with the intention to find out what internal code drives the AI into farming usage.
In most instances the basic setup was this:
- swapping beteeen vanilla game & CU, with a few minor changes to some files in order to trigger, manipulate or test specific behaviour
- 1vs1 game, always Arcean as allies (they do so bad during colonial rush), all vic cond disabled, techtrade disabled, no minors, all-abundant
- cheat to have no PQ0 ingame, resulting in the testing faction aquiring ~1000 planets by year 6.
- allow for 300-1500 turns for the game to develop at low-tech speed
- setting AI tags for improvements to the CU value
TARGET POPULATION:
If the target population of a planet is below 11, then an AI is still able to queue a proper farm. If target pop = 11 (or more) then he never will.
This is the reason why a CivCap never receives additional farming. (There are, however, exceptions: one are improvements which hold multiple or mixed type of bonuses, such as the Thalans Hyperion Matrix, others are "unrecognized farms" such as the Food Distribution Center.)
If you are now seeing an Initial Colony that holds several farms with levels of pop way beyond that limit, then this is the result of some different but interlinked dynamics:
- As long as targetpop isn't 11 the AI can still queue, at least, 3 proper farms. This happens esp. on (1) extreme worlds with only 50% production because there, a farm might need a long time to be build (2) if farm strength is = 2 (3) if economy is broken & production slider is reduced (4) a bigger upgrade chain got triggered before farms got enqueued, by researching new levels of buildings or terraforming (5) a wonder/GA is build at a planet with pop maxed, the AI returns to just add farms to the queue
Because all of this can happen before the first farm has been completed, some of them which may be on a bonustile, this may lead to the impression that the AI cannot properly utilize farms. Especially since most starting farms can become susceptile for a future upgrade which then will raise targetpop into obscene levels. Still, none of this is actually a problem as I will explain later.
PROPER FARMS:
The game takes them as real farms, but it doesn't read out the value, or calculate for a target pop in advance. It will simply try to build such a farm and, as long as target pop stays below 11, eventually aim for another one.
Generic Tree: The first farm only gives 2mt food which means, as long as he only has this level, he will always build 2 of them. Although this is not going to happen on all planets for various reasons, such as (1) no more free tiles (2) other stuff was more important (3) bonus-tiles. In my tests around ~25% of all planet saw 2 farms, which ultimately translated into +22mt food. Around ~50% had only 1 farm for 15mt food, around ~20% had no farm at all, and the minor rest had 3 farms.
A reasonable re-balancing of the generic farm values would be IMO:
Tier0: 3 food
Tier1: 4 food
Tier2: 6 food
The effect would be:
- More worlds with only 1 farm, translating into 14mt food
- Less worlds with 2 farms, for 20mt worlds.
- More effective use of tiles in case only tier0 are used
- If only tier1 farms are available, planets range from 12-20b ppl.
- A single 100% bonustile with a single farm will create only a 20b ppl world.
I strongly suggest getting back to proper food in the CU.
INITIAL FARM AVAILABILITY
If farms were available right from the start then this did increase the chance of planets having multiple farms. The reason is that, during the colonial rush, some of the above mentioned reason which reduce planetary production, do apply, giving the AI more time to queue a second or third farm before finishing off the first. On that it should be noted that now, all AI will research Soil Enhancement very early (if a single uninhabitated extreme planet is present on map) which will trigger an upgrade-chain right during the colonial rush.
Suggestion: Remove starting farms, except Yor, Iconian, Torian
Instead, increase AI value of all proper farms. If build under proper production a tier0 should be quick to build.
PERCENTAGE-FARMS:
The game cannot identify farms holding only a percentage-food-bonus. These improvements are somewhat "void" for him and therefore, the AI very seldomly uses them. In my tests, it was around 5 planets out of 1000 on average. Where each planet just held a single such farm. The remaining planets all stayed low at 8b ppl. Making these farms available as starting improvements did slightly increase the chance of usage. And if the AI uses them, it can also be at the CivCap.
YOR STALKS:
The 11mt brickwall is as well in place for them, so the game actually recognizes them to be farms. This is the reason why they aren't build at Iconia, and why the AI maximally builds 3. However, it's still a mixed improvement and the AI will put it firstly on a moral bonus tile. I would need to do more testing on why this behaviour is exactly like it is... perhaps there is a routine in place which suggests that foodtiles are the least desireable... but this is speculative.
In one way the Stalks introduce the most reasonable approach to bonustiles, since a planet with one 100% bonustile will still be able to build a second stalk, a planet with a +300% not. The endresult of Advanced Stalks then ranges just between 17-20 only, a very homogenous margin. (ofc it doesn't always happen like this, reasons see above, but in alot of cases it will be like this)
Because of this self-regulatory system, the AI value could see the most increase, perhaps to 100. Esp. also since the Yor economy has to rely on them in the abscence of banks/VLCs.
ICONIAN ROBOTIC FARMS:
The Iconians build less farms than the generic races because they immediately hit the 11mt wall. Which, in their case, is not well designed since that farm doesn't receive any future upgrade. At AI=100 they'll build, at least, a single farm on 50% of all worlds, 30% receive 2, the rest none. Therefore the Iconian worlds are inferior in popstrength than all other races. I'm not exactly sure what to do here, but since the Iconian approach is hands down the weakest, it'll call for a buff. Perhaps increase the strength to 4mt, or reduce their maintenance, or both... or give them some additional ability. Just not reducing their buildcost - because this will only serve to let them have even less.
TORIAN HARVESTER:
Basically the same could be also said about Torian Harvesters, although the situation is even more worse at the beginning of the game. Because Torians don't have instant access to farms, so mostly all early planets will only receive the Harvester but no other additional farm. That's in one way tragic because the combination of a small 1pp food structure with a upgradable farm that rises from technological progression is perhaps the best approach to reasonable farming. 8mt --> 12mt to give Breeder SA more breathing room, then 12mt-->14-->18-->19 for the following years.
In my opinion, this could only safely happen if the Harvester gives maximally +2mt food. So that, regardless of time, Torians will always be able to queue another farm. Perhaps buff it into other regions such his foodproduction. A +1mt +20% food production will still only create a +10b ppl world initially while, once another farm is added, that +20% will make much more out of it (if it has proper food)
AI TAG IN PLANETIMPROVEMENTS.XML
Some of the AI values need adjustment, but this has to be done in response to the actual overall-balancing, and also, the actual strength of the starting farm.
Initial farms that give +3 (or more) food need to be increased BY MUCH (in direct comparison to other improvements) to make sure that the AI gets the chance to build 2 of them more often. I'd suggest a value of 50-100 for them.
Lowyield starting farms with +2 food can see lower values, perhaps ranging from 20-50, because the AI has all time to build 2 of them if enough space is available.
You'll need to adjust this also for single branches when going from tier to tier.
HYPERION MATRIX:
This is a special mixed-bonuses building and is therefore excluded from some AI routines. The AI will reckon this as farm, even put it on a farming-bonustile, even at a homeworld. However, his priorities are as the bonuses are listed in the ingame informational window in the planet screen. Deleting the research & industry bonus - essentially turning it into a genuine farm, will prevent the AI from building it at a planet with targetpop of 11 or more.
If CivCaps come back to 16mt it may be okay to adjust this so that Thala receives an upgrade in potential pop to 20mt food. Also, the food bonus can savely stay percentage... neither way will do any harm.
FOOD DISTRIBUTION CENTER:
This improvement is not recognized by the game as a farm and therefore, it is the only chance of the AI to increase the population of his CivCap from 16 to 20 lategame. However, the chance that this is going to happen is minimal, because (1) the game very seldomly uses these "void" improvements (2) and if he chooses to use it it may not be at his CivCap.
My suggestion would be to re-integrate it back into the game (it has been intially thrown out under false assumptions) but to make it 1pp improvement. As such, this is the only hope of planets with only a single farm (pop=11-15) to receive a final upgrade (to 13-18)
FOOD BONUSTILES
Their presence seems to increase the chance of farms being enqueued on that planet. This might be related to the AIs behaviour trying to keep bonustiles free of unrelated improvements as long as possible. It may seem broken that a planet that is going to multiply its food will eventually see more farms but a superhigh target pop didn't create any problems. The additional farms are - more or less - only a waste of tiles (which could have been used for other stuff) but that's no gamebreaker.
SUPER HIGH TARGET POPULATION
The AI have no problems managing super-high pop worlds. It is beyond me how that initially got identified as a problem (???). Maybe someone could help me here to setup a game which will esp. trigger this alledged problem....
As for my tests, which have been extensive & extreme - the results are:
- The AI will adjust its general tax sliders in accordance with his economic balance. If he makes negatives - he is going to increase tax in order to get more money NO MATTER how unhappy planets will become. He even goes so far as to cross below 20% approval resulting in an instant drop of population (mostly on superpop worlds) which then, gradually increases the planetary approval next turn. Ultimately this means that all of his high-target pop planets (be it either from 3*farms or bonus tiles, or both) will have high pop but low moral between 20%-38%.
If the AI makes alot of surplus money he might lower taxes resulting in a slight increase in pop in some of these worlds. He does, however, instantly STOP with this behaviour when making no surplus. In other words, the AI does NOT try to fully maximize the actual population to meet the final target pop range! These planets do not threaten his game.
I went to extreme measures to further corroborat this - giving the initial colony +99mt food as base(!). Result was after (300 turns on 1000 planets):
- ~25% of planets red moral, pop from 20b - 24b ppl
- ~50% of planets yellow moral, pop below 20b, still growing
- ~25% of planet 100% approval, recently colonized.
Global economy stable, although +20k/turn bc on espionage
In a normal setup, the extreme range of actual pop was reduced, as was numbers of super high pop planets - which could all be identified as having +300% or multiple +100% bonustiles + farms. And although all their moral was red, the AI didn't bother in reducing taxes.
However, these conclusions are all based on a game where an empire has more than 100 planets.
There might be exceptions to this when facing tiny empires. Using Thala as example, I got these results:
- If the starting planet hightargetpop (=24mt food) had low moral (because I deleted the Temporal Entertainment...) then the AI will try to reduce the taxes, resulting in new colonies with very high moral, until he cannot afford it economically. Then he will naturally increase tax until somehow balanced. This mechanism supports increased population growth in low pop worlds - good.
And it actually is the complete opposite of the "High Moral Worlds Economic Breakdown":
HIGH MORAL WORLDS ECONOMIC BREAKDOWN:
This is something that can happen esp. to Iconians if they have 1 or 2 moral bonus tiles on New Iconia. They will most likely build 2*25% Dream Conclaves = +100% planetary approval, +10% from high PQ world, +20% from CivCap == +130% total.
This triggers the AI to jack up global taxes to extreme levels, resulting in deep red approval on newly colonized worlds. As such, his game remains static forever, as he even faces pop loss in all colonies but his gifted HW.
The crucial ingredient to this self-destructive behaviour is that, early on, it's the HW that nets the major economic income (you cannot corroborate this on tiny-medium galaxy where tourism income is splendid....) so the AI focuses on that world solely. His other worlds - that actually net minus bcs - he views as a drag and eventually will try to get rid of them.
This incident usually doesn't happen later on because, with enough planets collected, the AI tax slider adjustments reflects more the average planetary situation.
As I recall, OSHEE created a minor version of the Dream Conclave - that should be taken back in, again.
ESPIONAGE:
This is the most severe threat to a functioning economy, and it may even cause problems very lategame. If some AI get too many Esp. bonuses their game sliders alternate between 100% & 0% production because espionage is eating away so much funds they always need to play an "empty turn" to be able to fuel their production. In all games all AI won't refrain from collecting spies even if they have 99.
If Esp. is reduced by -100 then around midgame all AI tend to increasingly quickbuy stuff. In endgame they either can't - or won't - spend all of it so they accumulate several hundreds of thousands in surplus cash quickly.
Around -50% it seems to be balanced for the vanilla game.
CIVILIZATION CAPITAL:
At 12mt food it won't see a proper normal farm, and therefore, stay smaller than many other colonies.
I suggest upping it to 16mt food, again.
MINOR FARMS:
If food goes back to proper value none of the Minors will use them.
If CivCap food goes back to 16mt then there is no need for Minor farming, at all. The Minors make enough money, anyway. What they need is industry to build ships to hold off the attackers.
Actually, superhigh pop (around 20b ppl) for Minors is not good because of the increased moral penalty - worlds in red moral are very easy to take by using Information Warfare, practically defeating the planet with its own population.
***
unrelated:
TECHTRADE BUG#1:
If AIs trade techs amongst themselves then these specific techs don't get obsoleted. In some way this can be perceived to "kill the upgrade chain"...
TECHTRADE BUG#2:
The AIs can trade technologies amongst themselves which they already possess.
Both bugs can be conjoined:
In one of my games the Yor reseached Collective Research, traded for Research Academy, then went on to research Invention Matrix. At this point, both Research Academy & Invention was shown under "NEW" - and they also build both.
After ~100 turns they then traded for *another* Collective Research - which also made the Research Center available under "NEW" - so they build inferior labs in more than 60% of all cases.
Researching Discovery Sphere will solve this partially, because all redundant improvements will become elligible for an auto-upgrade - but this only works as long as the ultimate end of the upgrade chain hasn't been reached.
After that they will still queue otherwise obsolete improvements....
Thus, a quasi-fix for midgame is to interlink more branches.
Ultimately, the only true fix is to make all techs holding redundant improvements untradeable.