Studying the AI to learn their strategies

I'm fairly new to GalCiv2, and have been struggling to match the AI at "tough" setting in the early/mid phase of the game. Basically, the AI is always able to grab more colonies than I, and is able to keep the maintenance of all those colonies from crippling their economy. I'm currently playing 1.6 Dark Avatar. All this research was done with intelligence set to "intelligent", which turns on full AI, but no bonuses.

So, in order to understand how the AI does this, I decided to do two things. First, I enabled the "Reveal the entire map" cheat. Second, I play that race that gets a spy right off the bat. The spy is used to monitor what the AI is building. I don't actually place him, I just bring up the screen that shows the planet's buildings (both built, and under construction). Unfortunately, this still doesn't show the AI's financial information, nor their tech choices.

I noticed one thing right off the bat. In the spy placement screen, the production values of the planet are theoretical maximums, as in what you'd get for each if you set that slider to 100%. This makes sense, as knowing what the planet was actually producing would also tell you the empire's production settings. Thus, despite what that number says, the AI does *not* get huge production bonues.

The AI's smart enough to build what it needs right away. If there's a resource, it will build a constructor. Otherwise it builds four scouts, and a colony ship (or two if no constructor is needed). It does this via immediate buying. I notice that if it knows about a planet nearby it'll buy the colony ship before buying the scouts.

In addition, the AI buys the first two factories for the home-world, and a spaceport, followed by two more factories for the first planet colonized. On each subsequent world colonized, it builds a spaceport first (buying if it has enough cash), and a factory (again, if it has enough cash).

If you run the numbers, you quickly realize that the AI needs at least 10,000 bc's to do all that purchasing. I've seen this several times, the AI clearly gets a bigger opening budget, vs the human player. There's no other way it could get four scouts, two colony ships (or a colony/constructor), three factories, and a spaceport, all within about 5-6 turns.

Another thing I noticed is that the AI goes all-out to grab colonies. Looking at the treasury graph, the AI ran out of money (mirrored by his ceasing to buy factories for the new colonies), then started gaining money, despite having seven colonies (other than its homeworld). Keep in mind that the human player is charged 12bc/turn per colony. Thus, the AI should be charged 84/turn for merely having those colonies. I rarely can afford that kind of cost until my population crosses 15-20 billion. One possibility is that since the AI I was monitoring was "human", it might have gotten the "five most populous colonies may no maintenance for initial colony", for being "good". Actually, I just tried that (as I'm typing this), starting out as "human" I was charged the full 12bc/turn after colonizing Mars. I'll do more research on this over the next few days, see if the AI colonizing rapidly hurts it economically.

Thus, from my research, I've ascertained that "Intelligent" setting gives the AI at least 10,000 in starting budget, and the AI doesn't appear to be penalized for multiple colonies as much the human player.

Is there a setting I can play the game where the AI doesn't get these two bonuses? I'd like to be able to compete with the AI in the early game w/o having to overcome these two advantages. Even the initial $$ isn't nearly as bad as the lack of apparent penalty for the AI grabbing colonies as fast as it can. I really noticed this earlier last week when I set the universe to have 2-3 habitable planets per star, and was completely dominated in the colony-grabbing game (because I throttled back when my mainenance costs went through the roof).

I'll do more research on this over the next few days, including seeing if these bonuses apply at the lower AI levels.
17,470 views 29 replies
Reply #1 Top
I did figure out how the AI can purchase all that stuff w/o blowing a 5,000 bc starting budget. If the AI bought that stuff on an installment plan, it could pull it off, at least initially. Using Terra Manufacturing, four scouts, two colonies, three factories, and a spaceport can be had for 4736, and 190/turn for 18 weeks. Using Mitrosoft, the same package can be had for 1675, and 136/turn for a long time.

However, under either purchase scheme, the AI's economy should be utterly crippled once it's out of cash, throw in the initial colony maintenance fee, and the AI should go into the red for a long, long time. This should be easy to spot, after the first 7-8 colonies, the AI should no longer be able to "buy" anything until it gets back in the black.

On a hunch, I purchased two colony ships from Terra Manufacturing to get my "lease" cost to 90+/turn (about 60/turn more than I earn at the beginning). I then bought stuff until my treasury was around -1000. The game shut down my production/research, and said it would stay off until my budget got reasonable. Since my leases ensured that I wouldn't be cash-flow positive for a while, this pretty much shuts down my empire. This should be easy to spot for the AI (no cash, and no production should yield no ships produced). Thus it should be relatively easy to determine if the AI is using leases to purchase all that stuff and stay under 5,000 initial budget. I'll run this test next chance I get.
Reply #2 Top
In order to think like an AI, you first need to learn how to drool while playing. ^^
Reply #3 Top
There are several different aI routines in the game - so be careful generalizing what it does. Each race has their own individual aI algorythms and play balance.
Reply #4 Top
There are several different aI routines in the game - so be careful generalizing what it does. Each race has their own individual aI algorythms and play balance.


You're right of course. However, for the same race, I should be able to match what the AI does in the first dozen or two turns, or at least come close. Given what I've seen, that's not physically possible, at least w/o using leases that cripple your empire for turns 20-100 or so.
Reply #5 Top
Given what I've seen, that's not physically possible, at least w/o using leases that cripple your empire for turns 20-100 or so


Well, so you have figured out that the AI starts out by leasing. So, either learn how to manage an economy using leases, or try to overcome the AI early by overcoming the fact that the AI is paying leases (so will have less cash 20 turns in).

The AI is not getting any advantages that you can't duplicate. The real question is do you want to gamble the same way the AI gambles? You can also take the hit for having multiple colonies without much work. I prefer having multiple colonies, that extra 12bc in upkeep cost is barely a drop in the bucket. It sounds like to compete you need money. Think about these changes in your approach:

What is your tax rate? The AI typically taxes its people to death. It is probably playing with a very high tax rate (and hurting its pop growth). Basically, the AI gambles it will do well long term if it sacrifices everything early. You start off with an imperial government. That means there are no votes to keep you in power. Your people will continue to breed with as little as 41% morale. As an imperial government, there is nothing your people can do to you for being overtaxed (other than to stop breeding)

What is your econ bonus? Remember, you can start a game with a +100% econ bonus (with the Krynn). How did you spend your ability points? The AI may well be putting points into +econ, +moral and +pop growth. With all of these you make more money from taxes and can handle much higher tax rates. Also, both the federalist and universalist parties add +econ and/or +pop growth bonuses.

What techs have you researched? You can also increase your economic rating through research. Many techs either give you a direct econ bonus rating or researching advanced government which can increase your economy.

I often try and grab lots of planets early exactly because they will make me money. Even in the early game. Handling a -136bc per turn lease really is not that hard with practice. In fact, I often start a game with between 300 and 500 bc/turn in leases by the end of the first year.

There are multiple different AIs that build up their planets differently. But the AI is not getting any advantage that you don't get. The AI just is programmed to emulate an experienced player.

It is actually possible to far outclass what the AI does in the first few turns. Mimicking them exactly might not be the best approach. If you need more help, let us know.

- Wyndstar
Reply #6 Top
Interesting ... so you're suggest that if you tax the people to the hilt, you can overcome a 136bc/turn burnrate due to leases even at turn 10, using a stock race. Does the AI choose its abilities, like the human player can?

I'll experiment with how much lease burden one can take in the early game w/o crossing the point of no return (the point at which your income, when tax is maxed out, is insufficient to keep you from crossing the -500bc barrier that shuts down your empire). Up to this point I pretty much ignored leases, as 20 or 47bc/turn lease is a huge chunk of my initial cash-flow.

What I find fascinating about this game is that until you get economy buildings going, and trade, your economy growth rate is pretty much pegged to your population. 15 billion people pay the same taxes on 15 planets as they do on one, given no other bonuses. Having 3x the number of planets only helps *later on*, for example, once your population starts to exceed the value that would fill your planets.

When I have time, I might determine the tax revenue/billion people curve (unmodified), to determine what, over the first 30 or so turns, my overall cash supply is. Combine that with the income expected at that 30 or so turns, and one should be able to create an optimized leasing/spending plan that maximizes early purchasing power (so you can build stuff that maximizes the number of claimed planets/resources). The idea is to grab as many planets as possible, as soon as possible, all w/o exceeding the -500bc limit. This would make for an interesting exercise.

Is there going to be a "no leases" option added to the game in future patches? This would greatly simplify the early-game financial juggle. Heck, is there a "no purchases allowed" option planned, for the true iron-man approach? Of course, what would you do with your surplus cash in that situation?
Reply #7 Top
Considering how crucial fast buying is to any starting strategy, ESPECIALLY for experienced players, I doubt it.

I'm surprised that the AI is fast buying quite that much, though... neat find.
Reply #8 Top
Ok, I tried to match the AI in fast-buying techniques. Using exclusively leases, I was able to purchase as many ships, but I cannot (even with 75% economy boost and 20% happiness boost) get my income to match my lease per-turn burn-rate, meaning I'm slowly sinking into a financial abyss. Maybe using the shorter (but more bc/turn) leases might help, as they'll expire quicker, hopefully before my account plunges too far into negative territory. Simply put, my population doesn't grow quickly enough to get my income much above 100 or so.

OTOH, I may have stumbled upon a solution. First off, I noticed that stock humans at 99% happiness on the home planet yields about 1.3%/turn growth rate. At 41% happiness you get about 0.9%/turn growth rate. This means the hit for an extreme taxation isn't all that bad, IMO, as long as you keep the happiness at 41% or more on the planets you want to grow. But the biggest thing I noticed was that when I colonized Mars with 100 million people, it too grew at about 8 million people/turn. That means that if you spread your people out amongst multiple planets, you will gain people *much* faster than if they're all on one planet. Thus, I suspect, you can save yourself financially by snagging as many planets as possible, maximizing your growth rate.

The question, however, is does your growth-rate in your taxes due to people outmatch the 12bc/turn cost per colony, and potentially 150-200bc/turn cost for all those leases. So far, I haven't figured out how. And question #2 is does the AI go bankrupt if it has only 3 planets within reach?

Thus I'm still on my quest to attempt to match the AI in initial strategy. How does one produce 4 scouts, 2 colony ships, three factories and a starport on 5000 initial budget, and the bc/turn income you can get in the first 30-50 turns?

I'll keep trying.
Reply #9 Top
Please do.
This is interesting stuff.
Reply #10 Top
You can use the foreign stats window to see what factors are in their economy, even without spies. You can also check their treasury in the trade window (and probably foreign stats) That may help you.

Also, there is a possibility that the AI is building ships partway, and then leasing the remainder.
Reply #11 Top
Quotes:

"15 billion people pay the same taxes on 15 planets as they do on one, given no other bonuses"

Not so, taxes go up with the square root of the population, so you actually collect more by having several smaller colonies instead of one big one. I found this on the Wiki:

Tax income (DA):
34.5 * sqrt(population_in_billions) * tax_rate * (1 + (sum from buildings on planet)) * (1 + (sum from racial bonuses/maluses) )


"OTOH, I may have stumbled upon a solution. First off, I noticed that stock humans at 99% happiness on the home planet yields about 1.3%/turn growth rate. At 41% happiness you get about 0.9%/turn growth rate. This means the hit for an extreme taxation isn't all that bad, IMO, as long as you keep the happiness at 41% or more on the planets you want to grow."

True, however, you get a real nice bump in pop growth when the approval rating is 100%, so that would be the better comparison point. I often start with very low taxes, to keep the approval rating at 100%, just to get the pop built up a bit for putting on colony ships. From what I remember, approval of 75-99% gives a 25% bonus to the growth rate at 41-74%. And 100% doubles the growth bonus.
Reply #12 Top
Thanks for that formula. Well now, that changes everything. If you get more taxes by distributing the population over planets, then you have to grab as many colonies as possible ASAP, and put people on them. According to your formula, at 59% tax rate, you need a population of only .35 billion to pay for the initial colony. A population of 1 billion will yield a profit of 8bc/turn for the planet. I suspect the profitability point for a planet is around .45 billion or so (as in you'd make more money than simply not having the colony and having those people at home, given a baseline of 8 billion for your homeworld).

Thus, always pack your colony ships with as many people as you can (assuming it's a short voyage), as their tax contribution at home is little, but they'll pay for themselves in spades at the destination.

Also, it means you shouldn't ever bother with farms (build econ buildings instead). A population of 16 billion only pays 40% more taxes than 8 billion, yet is massively more unhappy. A couple buildings that increase your economy by 40% would make up for the population difference.

So, my next strategy is to grab as many colonies as possible as quickly as possible, while filling my colony ships up as much as I can. This suggest limiting colony ship production exclusively to the homeworld for ships that I buy. This also suggests sending your first colony ship to the homeworld to pick up extra people, as that will save you lots of money on that first colony.
Reply #13 Top
Also, it means you shouldn't ever bother with farms (build econ buildings instead).


You should also be wary of morale buildings. This thread and the two links in the first post there provide most of the information you are looking for. By changing the "home planet" population to 16b from 12b, it might be advisable to build one morale building on home worlds, depending on your empire wide morale bonus. Might. I still don't use them.

- Edit. Also, the AI DOESN'T overcome its early economy choices. Very often you will see the AI completely crash in the first year. It gambles, and the gamble doesn't always pay off. Indeed, I would say in my games it often doesn't pay off for the AI. With the longest leases you leave yourself some operating capital while you slowly sink and you wait for your population to breed and overcome the deficit. That point may not come for quite some time. It may come quickly. Depends on how many colonies you grab. On maps with fewer planets the AI will crash its economy with greater regularity. Again - you really may not want to be using the AI's pattern of expansion.

Yes the AI leases - but it uses the longest leases. The AI also overcomes the 12bc per turn upkeep on its new planets by taxing its new population heavily and waiting for them to breed and become self sufficient. Now, you are just trying to make up the rest of that lease shortfall to "match" the AI - but don't struggle too hard. The AI can't even do it.

- Wyndstar
Reply #14 Top
Very interesting thread. Thanks, OP, for your efforts, and for sharing your findings ... and to the others for their contributions. Personally, I often find the early game "balancing act" the most enjoyable part of the game.
Reply #15 Top
Interesting. I didn't know about the AI crashing. I guess when you play with 6-9 AI's, the odds are there that at least a few of them are going to make it, and make it big.

Incidentally, I did my math wrong. I just ran some experiments, and the DA 1.6 formula seems to be 20 * sqrt(pop) * taxrate * (1 + mods), where taxrate is 0 to 1.0, with 1.0 = 100%. That means the "break even" point for self-sufficiency on a new colony (assuming 49% tax rate) is 1.5 billion. Ouch. So you have a catch-22, you must spread out your people to maximize your tax/citizen ratio, but it takes quite a while to reach break-even on those colonies. I'm wondering now if it's better to build colony ships with two colony modules, to minimize the <1.5 billion time, and to speed up spreading your colonies. Or maybe beelining to planetary invasion, and using troop transports to shuttle people around quickly, and en-mass.

Ok, my new strategy is to not try to compete with the AI in up-front shipbuilding. Instead, focus on building dual-colony ships w/o leases, beelining to a better propulsion (so I can get decent speed), then to troop transports (so I can start shuttling population around en-masse). It's obvious that you want as even a distribution of population as possible. Not only does that yield more tax revenue for the same population, but the smaller population/planet yields a faster growth rate per citizen. The plan is not to outgrab planets, but to get so far ahead in the economy/population game, that the 50-150 turn phase catapults you ahead of all but the luckiest of AI.
Reply #16 Top
Hmm, maybe it's only me, but I still don't see after reading so many threads about it why farms are that bad.

Taking the above formula You get an 22.5% income increase for adding a 3-food-farm to a 6bn-world. (without extra modifiers, taking a 49% tax rate (but different amounts don't change the relations): 20*sqrt(6)*0.49=24.0 <> 20*sqrt(9)*0.49=29.4))

in my book thats a pretty decent income-increase. You would need teh topc econ-building to equal that.

Researching the 5bn-food-farms, gets you to 11bn pop on ex-6bn-world, which equals a +32.5% increase in income for using a single tile.

as a "bonus" you get higher absolute growth rates I you want to use the world for troop-ship-production and a higher defense against invasions.


So, very high populatons are bad for morale and stuff, but I still will put a single farm on all but the most crappy planets and also research a few additional levels of farming.
Reply #17 Top
The following screenshots have been made in an all-abundant game on a gigantic map on "Tough" difficulty.




As you can see, all the AI players eventually had to stop production completely for a rather lengthy period of time followed by a slow increase in production. I myself played the Altarians and had to stop production for a few turns once, but by far not as badly as the AI. I expanded too fast and didn't find any anomalies with BC in them for a while



This last screenshot is from later into the game. Notice how the AI has to repeatedly throttle its production in order to pay back its deficit.
Reply #18 Top
Does the AI do leases? I play my games at the tough level. At the end of the game summary screens come up that recap the game. One of the items shown is how much has been spent on leases. In my games, I've never seen the AI having spent anything on leases.
Reply #19 Top
Perhaps the Ai got a few lucky anomalies and got some extra cash.....but I still wonder how they get all that research out!

Just *how* does that topsy turvy AI sleep at night Brad? But seriously Brad, you need to reveal the AI's secrets. (Or how they think and manage to do these feats)
Reply #21 Top
Also, it means you shouldn't ever bother with farms (build econ buildings instead).


Gotta disagree with this one. When I start building transports for invasions, I don't want to be removing 1/6th of my planet's pop when I do so. Better to have 11-12B on a planet that's cranking out transports.

Also, keeping a planet of 11B pop happy is not that tough. Don't even need morale improvements for that (except the wonder/trade good kind that boost every planet at once).
Reply #22 Top
Hi!
but I still don't see after reading so many threads about it why farms are that bad.

One basic farm is OK if you have decent morale ability (~100%), because penality for 9B population is 21%. Going up with the pop makes makes penality bigger: 28% for 11B, and for 13B it is 36%, for 16B 48%, and for 19B 61%, and for comparission 12% at 6B. It seems not much, but the approval calculation works by first decreasing all morale bonuses (native morale, buildings...) by that percent of penality, and then starting real calculations. Another obstruction is the morale ability after decrease is capped at 100%. That's what makes having more than one farm on a planet difficult. To keep taxes and approval high you need very high morale ability, and that's possible only by mining morale resources, which usually come in quite short supply.


Researching the 5bn-food-farms...
as a "bonus" you get higher absolute growth rates I you want to use the world for troop-ship-production and a higher defense against invasions

I'm affraid that's wrong assertion. Having more population on a planet actually DECREASES the ability to grow more pop quickly.
1) pop growth is capped at 75M + bonuses, so growth above 2.5B pop is a constant. The most important bonus is 100% approval on the planet, that doubles the growth after all other bonuses apply.
2) the higher population on a planet, the lower the approval. So a player has to decrease his tax rate significantly more to get pop on an 11B planet grow at 100%, than on a 9B planet (or 6B, but lifting there 2B pop makes a significant dent on its money-producing ability).

So the real troop-breeders in my small games with 1-2 morale resouces in the whole galaxy are 9B planets.

BR, Iztok
Reply #24 Top
I'll check that thread. My formula was based on starting a game with stock humans (no picks), so I had no econ bonuses. I measured the income with taxes at 100%, for 8.0 billion, 8.1, 0.1, and a number of other values (you can lose population very quickly with 100% taxes, making for an easy tool to try different values). In all cases, "20" came out of the equations consistently. This is for version 1.6 of DA (it might have been different for 1.5 DA)
Reply #25 Top
aha, thanks Iztok.
I'm a little astonished that I then can chain-produce troopers on my worlds in 3-4 turns in some cases and still not decrease its population. I just somewhere read that the pop gros at x% (but talks were about the growth rate when creating a colony) so I assumed it would be the same for the whole time. Ah well, assumption is the mother of all fuck ups

But then again, so far I was almost always able to grab at least 1 Morale resouce and so far also have always been able to get Harmony crystals. (the AI seems to give Xeno ethics as a very low piority...). So also my 11bn worlds are almost always at 100% approval with a tax rate of 49% (and for some sentimental reasons I hardly ever raise it above that value - I mean I were pissed as hell in rl if I got taxed at 79% or so )

But in the end I still like my 11bn worlds if only for the accassional AI-troop-ship that happens to get to one of my worlds