Will 2.6.3 fix the AI starbase upgrade issue? (2.7.2 update)

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Did anyone try to write a version of "the plan" that values fleetcapacity 10 times higher than the vanilla version? If that makes the AI upgrade starports, it's probably just about finding the right number so that the AI doesnt think "those energy and alloy costs are way too high to justify having a bigger fleet".

If it doesnt, there is probably some underlying problem that the "the plan" doesn't know that upgrading your stations leads to having more slots that then can be used to increase your fleet capacity. So uprgades only happen when the AI, unrelatedly, wants to upgrade a station for defense purposes (or whatever other reasons there are) and THEN sees it's fancy new slots and builds some anchorages.


Or maybe I'm just thinking waaay too simplistic about the whole thing.
 
As an experiment I tried switching to one of the no-starbase-upgrade empires and gave them a bunch of free energy income and a stockpile of alloys. They responded by building a bunch of habitats. The only starbase action they took was to rebuild their shipyards, which they had dismantled earlier (probably due to low energy).

nice test, and also shows how this may be broken in endgame. but, we also need to see what they would've done with that energy income earlier in game before they could construct habitats or had alternative naval capacity sources.
 
Update
Okay, so I observed an AI for about 50 years just to see what is going on and I've solved at least part of the mystery.

There appear to be a number of reason why the AI is bad at upgrading starbases. However, the primary reason is that it will only consider upgrading them when there is excess Starbase Capacity. This means that there are only brief windows of opportunity for starbases to get upgraded. For example when it gets supremacy. Also, if it upgrades enough outposts into starbases before upgrading anything it won't upgrade. So for example if starbase capacity is 8/10 and it builds just 1 starport, it can still upgrade. However as soon as it starts to build that second starport, it will stop considering any more new upgrades to existing starports.

Here is a video I took where I gave the AI a tech that boosted its starbase capacity by 2 and then watched what happened.


On top of that there are resource requirements which I don't fully understand beyond the basics.
1. It has to have surplus energy income
2. It has to have a certain amount of alloy stockpiles

Regarding alloy stockpiles (expenditures), depending on whats going on the AI adjusts what percent of that stockpile gets allocated to ship building, starbases, and upgrades. While observing, you can view the AI's expenditures by typing debugtooltip in console, and then letting it run for a day.
UPTBlnj.png


The amount of alloy expenditures allocated to starbases appear to play a role in what gets upgraded. If it's too low I think it will only upgrade outposts. Starhold cost 500 alloy so it needs 500 in expenditures to even consider upgrading it during that brief window when it can even upgrade in the first place. I believe that 500 alloy number is modified by the supremacy tradition that lowers starbase upgrade cost, however it is not lowered by difficulty modifiers that lower starbase upgrade cost.

Furthermore I'm not certain, but I also think that the amount of alloy you need to trigger an upgrade is based on the highest tech starbase you can build. So instead of 500, it might be 1250. Again not sure.

You'll notice in the picture that "ship upgrades" is taking an awful lot of alloy expenditures. This is yet one more problem that is making it difficult on the AI. Basically, when the AI is at max fleet cap and not at war, it super-prioritizes spending alloy on upgrading ships. HOWEVER there are two problems:
1. It does not go away even if you have nothing to upgrade. This makes it that much harder to build up the alloy expenditures dedicated to starbases. Only wars make it temporarily go away.
2. THE AI IS EVEN WORSE AT UPGRADING SHIPS THAN IT IS AT UPGRADING STARBASES.

I'm fairly certain the culprit in all this is a problem with the economic minister. However that file does not appear to be moddable so I don't know what to do.

TL;DR
  • AI doesn't upgrade starbases unless it has starbase capacity open and hasn't already queued up enough level 1 starbases to max it out.
  • AI doesn't upgrade if it doesn't also have enough alloy stockpiles and energy income dedicated to starbases.
  • Alloy stockpiles necessary to upgrade are hard to get because ship upgrades take too much expenditures
  • AI rarely upgrades ships and the ship upgrade expenditure doesn't go away even if there is nothing to upgrade
  • When it does go away in times of war, ship building expenditure gets a huge boost
 
Last edited:
Okay, so I observed an AI for like 50 years just to see what is going on and I've solved at least part of the mystery.

On top of that there are resource requirements which I don't fully understand beyond the basics.
1. It has to have surplus energy income
2. It has to have a certain amount of alloy stockpiles

Regarding alloy stockpiles (expenditures), depending on whats going on the AI adjusts what percent of that stockpile gets allocated to ship building, starbases, and upgrades. While observing, you can view the AI's expenditures by typing debugtooltip in console, and then letting it run for a day.


I'm fairly certain the culprit in all this is a problem with the economic minister. However that file does not appear to be moddable so I don't know what to do.

TL;DR
  • AI doesn't upgrade starbases unless it has fleet capacity open and hasn't already queued up enough level 1 starbases to max it out.
  • AI doesn't upgrade if it doesn't also have enough alloy stockpiles and energy income dedicated to starbases.
  • Alloy stockpiles necessary to upgrade are hard to get because ship upgrades take too much expenditures
  • AI rarely upgrades ships and the ship upgrade expenditure doesn't go away even if there is nothing to upgrade
  • When it does go away in times of war, ship building expenditure gets a huge boost

So, if can you mod the cost of upgrading a star base (for the AI only) based on how many are already present vs max so that at the certain point it becomes too expensive to upgrade outposts to star bases but infinitely cheaper to just upgrade from star base to citadel etc.? For example, if it has 8/10 capacity, upgrading an outpost would cost 10000 alloys, where as upgrading from starbase -> whatever would be 1 alloy. All modules and maintenance would be 0.

Basically it just seems to me that without access to the AI files you're best off modding the starbase and module costs, it might feel shitty for the AI to receive such a boon but it'll probably give it a competitive fleet?
 
I believe adjusting the prices down might help some issues, however the big issue is that when starbase capacity is maxed the AI will simply refuse to upgrade starbases to their next level. It doesn't matter how much energy and alloy they have.

Another thing that would help would be to just delete the alloy_expenditure_ship_upgrades part in alloy budget.txt. I don't think it even helps the AI upgrade and all it does is eat into the Alloy expenditure that would otherwise go to the AI's starbase budget.
 
the big issue is that when starbase capacity is maxed the AI will simply refuse to upgrade starbases to their next level. It doesn't matter how much energy and alloy they have.
that sounds like someone typed < when they meant >.
 
So, if can you mod the cost of upgrading a star base (for the AI only) based on how many are already present vs max so that at the certain point it becomes too expensive to upgrade outposts to star bases but infinitely cheaper to just upgrade from star base to citadel etc.? For example, if it has 8/10 capacity, upgrading an outpost would cost 10000 alloys, where as upgrading from starbase -> whatever would be 1 alloy. All modules and maintenance would be 0.

Basically it just seems to me that without access to the AI files you're best off modding the starbase and module costs, it might feel shitty for the AI to receive such a boon but it'll probably give it a competitive fleet?
This could potentially work. Giving the starbase a positive rather than negative energy value might help too.
 
oops, my tl;dr had a critical typo. I meant to say starbase capacity, not fleet capacity.

The AI won't even consider upgrading a starbase to a starhold and so on, unless it has excess starbase capacity.
 
Last edited:
I believe adjusting the prices down might help some issues, however the big issue is that when starbase capacity is maxed the AI will simply refuse to upgrade starbases to their next level. It doesn't matter how much energy and alloy they have.

Another thing that would help would be to just delete the alloy_expenditure_ship_upgrades part in alloy budget.txt. I don't think it even helps the AI upgrade and all it does is eat into the Alloy expenditure that would otherwise go to the AI's starbase budget.

Yeah, that's why I suggested or tried to suggest (not sure if my wording got there) that starbase capacity should be based on an exponential curve so by the time they get to 9/10 , going to 10/10 would cost them 1 million alloys so the only alternative is to upgrade.

Could anyone give me some direction as to what files I should take a look at? I want to take a stab at it if no one else is but I am totally new to modding
 
Yeah, that's why I suggested or tried to suggest (not sure if my wording got there) that starbase capacity should be based on an exponential curve so by the time they get to 9/10 , going to 10/10 would cost them 1 million alloys so the only alternative is to upgrade.

Could anyone give me some direction as to what files I should take a look at? I want to take a stab at it if no one else is but I am totally new to modding
I think I get what you're trying to say but "patching" such a massive bug by preventing the AI from ever using its full starbase capacity is sort if crazy. I guess you could solve it by adding one extra starbase capacity so the AI only "has" its expected amount of upgraded starbases (until the first time it conquers anything) but that gets messy.

Also, while in theory the modding language is good enough for this, it'd be extremely messy. Costs can be modified empire-wide for outposts or for upgrading starbases in general, but there's no modifier that's just for upgrading from Outpost to Starport, or for Starhold/Star Fortress/Citadel but not for Starport. Programmatically (dynamically) modifying the cost of a particular purchase (like the Starport upgrade) should be possible but didn't work the last time I tried it; there are weird restrictions on where you can use modifiers or computed values and costs are one of the more limited fields.

The actual solution is, of course, to just fix the damn bug so the AI doesn't worry about its starbase capacity when upgrading Starports (or above) into the next level. Starbase capacity is only relevant for Outpost->Starport, but the AI seems to be unaware of that rather-important fact. Unfortunately, this will require PDX take some time out of their efforts to screw up the Fleet Manager or Empire Sprawl in new and inventive ways, and might require editing up to four lines of code, so it probably won't happen this month.
 
Isn't an easier workaround to add additional fleet capacity to certain tech thresholds?
Lets say every Starbase tier adds +100 FC with is_Ai_only or something.
 
Isn't an easier workaround to add additional fleet capacity to certain tech thresholds?
Lets say every Starbase tier adds +100 FC with is_Ai_only or something.
No, because that doesn't scale.