AI is VERY, VERY BAD at Evaluating Relative Strength

The problem is the way the game calculates strength: it puts too much emphasis on CURRENT military strength and not enough emphasis on POTENTIAL military strength. 

For example, the AI with a ton of ships (because of Malevolent Lvl 5 Free Overlord Ship) will think a human with ZERO military ships is a pushover.  Unfortunately, the human is on twice as many colonies as the AI with twice the productive power and twice the military technology.  

So the AI declares war on the human and 6 turns later realizes it made a DRAMATIC mistake and makes peace.  

 

If the AI could leverage its initial military advantage and capture a bunch of the human's worlds on the first turn of war that wouldn't be as big of a problem.  But the AI is incapable of preparing for war so it spends 10-20 turns dithering and doing nothing, giving the human more than enough time to churn out UNSTOPPABLE FLEETS OF DEATH that is two or three tech levels ahead of whatever the AI has.  The AI seriously needs to PREPARE for war BEFORE going to war.  

At least the AI in Vid's mod is balling up its fleets into maxed out balls and killing shipyards and starbases.  Now the AI needs work on general strategy and putting more engines on its ships so it can move faster than 6 moves at a time.  

16,866 views 11 replies
Reply #1 Top

I think <FactionPowerModWhenCheckingForWar> in galciv3AIdefs.xml is the value that determines this - and I think that it's basically just a flat multiplier, so the AI just presumes that your power score will rise 25% or so in the next X turns, and won't attack you if this number is higher that it's own power score. Which is a fairly awful way of going about checking the enemy's war potential.

Reply #2 Top

Any way to change that? 

Reply #3 Top

The problem is the power scoring system itself.  It overweights things like influence and current military power.  And it significantly underweights potential military power (production especially).  

Also, the AI needs 3x the power of a human before it can declare war on it given the difference in tactical ability.  

Any evaluation system of relative power should be based on RAW PRODUCTION X 20 X AVERAGE MODIFIERS ([Research+Money+Production modifiers]/3)+ Current Military Might.  Nothing else should matter.  

Not only that, but the AI should WORK TOGETHER.  It should feel threatened by large empires more so than not.  Consequently any evaluation system needs to weigh in what the other AI are doing.  

Reply #4 Top

Yes, the AI DOW is basically just a reliable in-game timer saying that "before this you don't have to research any military tech whatsoever, military ships even less". Plenty of time for both after that as you only need a fraction of the tonnage of the AI for tactical power parity...

At the very least the AI should copy the simplest basic opening from the human player's manual:

- First mass up a sizable fleet before you send it against the enemy

- While the first wave is on the way keep building and massing up the second wave; don't send them piece-meal.

- When the first wave is at a striking distance of the target world i.e. you can attack at the same turn, then make the DOW.

Yeah, the human will notice your fleet advancing towards him if he's not a complete doorknob but so what? You still don't have to DOW until the last moment when you attack. Besides, it's always possible the human doesn't notice. It's not like there's a downside for not DOW:ing...

I'm quite sure the above can be added to the AI without great difficulties. Script it if you must but at least get the basics there. It can always be improved later.

If ever there was low-hanging fruit in the AI war department waiting for implementation...

Reply #5 Top

<FactionPowerProductionPointMultiplier>0.3</FactionPowerProductionPointMultiplier>
<FactionPowerBattleRatingMultiplier>0.002</FactionPowerBattleRatingMultiplier>
<FactionPowerTreasuryMultiplier>0.001</FactionPowerTreasuryMultiplier>
<FactionPowerInfluenceMultiplier>0.1</FactionPowerInfluenceMultiplier>
<FactionPowerUnlockedTechsMultiplier>0.25</FactionPowerUnlockedTechsMultiplier>
<FactionPowerUnlockedCultureMultiplier>0.1</FactionPowerUnlockedCultureMultiplier>

 

For determining power scores, this is the relevant bits of code in globaldefs.xml. In each case, it's a flat multiplier for score - every 1 point of production gives 0.3 power score; every 1 point of battle rating gives 0.002 power etc.

 

Production appears largely broken, since it uses the final output score. This means it varies wildly depending on your slider settings. Late-game, you can increase your power score by several thousand points simply by fiddling with the output circle; and I've often noticed my score going up by anything upto 50% when I go bankrupt and the game throws everything into cash generation, which implies that treasury multiplier is too low - every point of income is worth 30 times as much as cash you already have.  Battle Rating multiplier is quite good; I think it uses some code from AIdefs to determine initial battle rating. Influence and ideology likewise appear to do a decent job. Tech might be a little undervalued (I think it grants 25% of base tech cost, which is too high early on and too low later).

 

I think ultimately, there needs to be some kind of measure of social development added separately from production, and production should simply use raw prod rather than eventual output. We have to get away from a situation where just shifting your slider settings can cause such wild swings in total power rating. Presently, if I have a planet with 1000% research bonus currently set to manufacturing (say, to finish some upgrades), it's power rating sinks down to (basically population+5)*0.3. When I switch it to produce research, it suddenly becomes ((population+5)*11)*0.3. Let's illustrate that with a real game example:

 

25 pop planet with 1000% research bonus set to manufacturing power score = 9.

25 pop planet with 1000% research bonus set to research power score = 99.

 

90% of the planet's potential is completely ignored while it's set to non-optimal settings. If, instead, we used raw production for score and then gave, say, 0.1 per 1% bonus to manu, research etc, then the score becomes pretty much fixed - you get 9 from the raw production and 100 from the bonus, even if you're not making use of it. The score loss from maintaining 'bad' slider settings comes from not getting the score from techs as quickly.

Reply #6 Top

A really clever AI would do behind-the-screens battle simulations between its max fleet and the player's max possible fleet, possibly also remembering real fleet setups the player is using or has used, to determine how many AI fleets, on average, it needs to beat the player fleet and then calculate how many such fleets the player would be able to manufacture in the time it needs to get its own fleets there. If the AI has enough to top that it's time to attack. But that's daydreaming... :)

Reply #7 Top

Change FactionProductionPoint to RAW Production. Change BattleRatingMultiplier to 0.0001 (add an extra decimal space and then halve it).  Change tech multiplier to 0.15.   Make everything else in the list to zero.  

Reply #8 Top

That doesn't account for social development. An empire with 1000 raw production and no buildings is a lot weaker than an empire with 1000 raw production and top-level infrastructure. Besides, I do think that influence and traits should have some representation - influence can make you largely immune to invasion and traits are very powerful too. I'd also be rather tempted to buff treasury score rather than abandon it; being able to rush-buy a fleet is a pretty potent move which is otherwise hard to account for.

Reply #9 Top

well if you did some of these suggestions then no one would fight some players making a unrealistic game mechanic. Being technologically superior won't work if no one ever comes close to technologically. I want the opposite a super instigator back. The Ai does needs to attack when its ready for war, not before. You would be more accurate calculating average power rating. I think if you add for production plus economy plus military to be more accurate. Using average not current. At least have a military capable of attacking before declaring war should be the minimum.

Reply #10 Top

Quoting naselus, reply 8

That doesn't account for social development. An empire with 1000 raw production and no buildings is a lot weaker than an empire with 1000 raw production and top-level infrastructure. Besides, I do think that influence and traits should have some representation - influence can make you largely immune to invasion and traits are very powerful too. I'd also be rather tempted to buff treasury score rather than abandon it; being able to rush-buy a fleet is a pretty potent move which is otherwise hard to account for.
End of naselus's quote

 

That raw production is being spent somewhere.  If it's not being spent on social development it's being spent on research or a giant fleet.  

Or make the power graph equivalent to AVERAGE production.  You add total research+production+money generation subtract maintenance costs, and divide it by 3 and then you add in raw production x 3 to that number.  And that's your power.  

 

Reply #11 Top

While not the most accurate, could you add in all of the potential max slider configurations of a planet?

 

So for the sake of argument. Lets take a 10 RAW production planet with 100% research, 25% manu, 50% wealth bonuses through the buildings/planet bonuses...etc.

Research: 10 * 100% = 20

Manu = 10 * 25% =  12.5

Wealth = 10 * 50% = 15

 

Total Power Rating = 20 * (power rating for research) + 12.5 * (power rating for MANU) + 15 * (power rating for WEALTH).

 

So this calculation adds in all of the possible potential bonuses the planet could have based on slider configurations, and would better estimate planets with a mix of types on the same planet (which the AI commonly does).