Reviewing the current Imperial Stockpile mechanics

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

Message
Author
User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Reviewing the current Imperial Stockpile mechanics

#1 Post by Oberlus »

Reviewing the current Imperial Stockpile (IS) mechanics. Very related to this thread on Stockpile Techs, but it already has several open discussion going on so I thought it is better to post this on its own thread.


Generals:

Each colony has MaxStockpile and (Current)Stockpile meters, which contribute to the total Empire's Stockpile and MaxStockpile.
The Empire's Stockpile refers to the PPs the Empire can draw from the PPs stored in the IS each turn.
The PPs stored are simply any non-consumed PP (what in older FO was wasted here is stored).
Each conoly's MaxStockpile depends on the focus of the colony, its population, and the presence of certain techs and buildings (each giving fixed and pop-based bonuses).

Caveats:

There is a suggestion to make the Stockpile value only relative to the Empire (removing that meter from the colonies), so that each colony's MaxStockpile contributes/determines the Empires MaxSotckpile but the current value only depends on Empire-wide conditions (total population or total number of colonies). All this as a patch against the focus dance (micromanagement), that does not fully fix the problem and that is not liked by some of the devs.
There is another solution (not a patch) that seems very good (to some people) requiring influence for focus switching. However, until some alpha version of influence is finished and merged to master, we can either ignore the focus dance problem or patch it somehow. Certainly, more elegant alternatives than the mentioned above are welcome.
Meanwhile, I still have to check some more FOCS code to find out if (some new form of) the penalisation mechanic for industry and research foci can be used to tackle this focus-dancing issue.


SPECIES TRAITS:

In species/common/stockpile.macros:

[[STOCKPILE_PER_POP]] is 0.02

[[STANDARD_STOCKPILE]] increases or decreases planetary stockpile towards MaxStockpile, at a fixed rate of 1 per turn. Every species execute this (I think every turn), except those with the [[NO_STOCKPILE]] trait.

[[{BAD,AVERAGE,GOOD,GREAT,ULTIMATE}_STOCKPILE]] sets the MaxStockpile. Effect is value = value + {0.5,1,3,10,15}*Population*[[STOCKPILE_PER_POP]]. What is MaxStockpile "value" at start? I assume 0. BAD stockpile species colony begins with a MaxStockpile = pop*0.5*0.02 = 0.01*pop, AVERAGE is 0.02*pop, GOOD 0.06*pop, GREAT 0.2*pop, and ULTIMATE 0.3*pop.
Sidenote: wouldn't it be better to remove that "value +" from the effect?.


TECHNOLOGIES:

techs/production/PREDICTIVE_STOCKPILING.focs.txt
- Unlocked at start.
- Gives a fixed +1 to MaxStockpile of every colony with the stockpile or growth planetary focus.

techs/production/GENERIC_SUPPLIES.focs.txt
- Gives a fixed +2 to MaxStockpile of capital. Small effect but handy.
- Gives a +0.01*pop to MaxStockpile of every colony, effectively doubling the pop-based stockpile of a BAD species, or a +50% for average, but it's only a +20% for Laenfa or +10% for Sly. So stockpiling species doesn't need it, and since base stockpiling output of the non-stockpiling species is very small from start, the +100% or +50% is of not much help and should invest on this only when then have spare RPs.
- Gives a fixed +3 to MaxStockpile of every colony with the stockpile or growth planetary focus.

When stockpiling-focus only possible on capital or homeworlds, this value is too small for stockpiling empires to consider it useful, since they already have considerable stockpiling output thanks to their pop-based bonus. And for non-stockpiling empires, although the proportional effect is noticeable (without stockpiling focus they have very small stockpiling output, so this +3 has a considerable weight in the final value), it is also too small to allow for interesting IS uses and is not worth the sacrifice (better focus on industry/research).

Bottom line: This tech is only interesting (thanks to the two first effects, the focus one is always worthless) for non-stockpiling species that are attempting some small IS projects, like speeding up a bit distributed, stealth expansion.


techs/production/INTERSTELLAR_ENTANG_FACTORY.focs.txt
- Gives a +0.02*pop to MaxStockpile of every colony.
- Gives a fixed +6 to MaxStockpile of every colony with the stockpile focus.
- Unlocks the construction of the Stockpiling Center.

techs/production/VOID_PREDICTION.focs.txt
- Gives a +0.2*pop to MaxStockpile of every colony with the stockpile focus. That +0.2 (compared with the +0.01 and +0.02 of previous techs) is huge, but it only applies to planets with the stockpile focus, so it will affect only a percentage of your empire's population.


BUILDINGS:

buildings/STOCKPILING_CENTER.focs.txt
- Gives to the colony in which it is built a +0.1*Empire.PPs (grows slowly as long as the (Current)Stockpile meters are kept at colony level).

buildings/INTERSPECIES_ACADEMY.focs.txt
Location restrictions:
- 3 hops away from other Int.Acad.
- Minimum 15 happines (19 if preferred focus is on) on the planet it is built.
- Maximum 6 per empire.
Effects (please correct me):
- +10 stockpile for this colony if stockpile-focused.
- +5 research for this colony if research-focused.

I don't understand the two consecutive location restrictions that begin with "Number low = 0 high = 0". And I don't know how the destruction effect chooses his targets (superfluous academies).


NUMBER CRUNCHING:
TO BE REDONE

I'll try to make calculations for a somewhat average mid-to-late game situation. I encourage you to correct my estimations or formulae.
Say you have 25 planets, 5 homeworlds + 20 non-homeworlds; homeworlds have on average twice the population of an average non-homeworld (therefore, homeworlds are 1/3 of the total empire's population), and the total population is 300 (so 20 for homeworlds and 10 for non-homeworlds). Minimum stockpile will be the starting bonus from species trait + 2 (Capital) + 0.03*300=9 (pop-dep bonuses from the first two techs). Final values for species: BAD: 11+3, AVERAGE: 11+6, GOOD: 11+18, GREAT: 11+60. If then you set all homeworlds to stockpile focus you get + 9*5=45 (fixed bonuses) + 0.2*0.33*300=20 (void pred.), so final values: BAD: 79, AVERAGE: 82, GOOD: 104, GREAT: 146.
In the end, we have a bad/average species with full commitment has the same stockpiling output than a GREAT species with only research commitment (all techs, no stockpiling focus), and that full commitment (all homeworlds to focus) implies a x5 increase for BAD/AVERAGE empires, x3 for GOOD and x2 for GREAT. And the final values (around 100 PP per turn) are good to do big things like pumping out 5 troopers per turn behind enemy lines to fuel up a blitzkrieg. But only for a sizeable empire, this numbers would be way smaller for smaller empires or for those that has not yet got all the techs.


In following posts I show some numbers for different scenarios (more/less planets/population/homeworlds) and for some suggested changes to the stockpile techs, buildings and species trait.

TODO:
- Present them nicer, in a table shared via Google docs or something (neved used that).
Last edited by Oberlus on Wed May 30, 2018 11:45 am, edited 4 times in total.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#2 Post by Ophiuchus »

Oberlus wrote:...Stockpiling Center, which has this effect:

Code: Select all

            scope = And [
                Object id = Source.PlanetID
                Planet
            ]
            activation = Source
            accountinglabel = "BLD_STOCKPILING_CENTER_LABEL"
            effects = [
                SetMaxStockpile value = Value + (0.1 * Statistic Sum value = LocalCandidate.Industry condition = And [
                    ProductionCenter
                    OwnedBy empire = Source.Owner
                ])
            ]
I'm a bit confused with this one, so please help me out:
The enqueuelocation part (skiped from this chunk of code) specifies Capital, so this can only be built in there, right?
In the scope, "Object id = Source.PlanetID" makes it only apply to the colony that has de building?
So, it increases MaxStockpile of the Capital, adding to it... 0.1 * Sum [for each ProductionCenter of the empire] ProductionCenter.IndustryMeter ???
I'm sure I'm getting this or something else wrong, because these numbers would be huge, incredibly more powerful than VOID_PREDICTION (below), right?
Until someone explains this to me, I'll skip this building's effect from calculationss.
If the code is like this i obviously forgot a way to ensure you only get bonus from a single building. Maybe i destroyed it on capture...

And yes, the basic effect is: your empire gets 10% of industry as a bonus to stockpile limit (you can also check the stringtable entries, they should be consistent with the focs code) on the planet the building is built on (only possible on (ex-)capital). So if you have 400 industry, your stockpile limit increases +1 for the next 40 turns.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#3 Post by Ophiuchus »

Thanks for the effort, this is really gonna help the discussion i think.

[quote=Oberlus]...- Present them nicer, in a table (attach an excel).[/quote]
Please consider a google sheet instead, it is much better for online and collaboration use. Easy to access, clone, share, comment...

It works also offline with the right chrome plugin.

Careful though if you wanna get funky with graphs. Last time i checked graphs worked well, but only if you put the data for the graph in a single page.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#4 Post by Ophiuchus »

And the basic reasoning for the population bonus was like boosting bonus to the next level.
So generic supplies makes a bad species average with the next tech it becomes good...
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#5 Post by Ophiuchus »

And you forgot the interspecies design academy.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Reviewing the current Imperial Stockpile mechanics

#6 Post by Dilvish »

Ophiuchus wrote:If the code is like this i obviously forgot a way to ensure you only get bonus from a single building. Maybe i destroyed it on capture...
Yes, there is a destroy on capture clause for the stockpiling center
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Reviewing the current Imperial Stockpile mechanics

#7 Post by Oberlus »

Dilvish wrote:Yes, there is a destroy on capture clause for the stockpiling center
I should have quoted the whole FOCS code, or better place links to it. I'm edditing the OP.
Ophiuchus wrote:Please consider a google sheet instead
I'll do.
Ophiuchus wrote:And you forgot the interspecies design academy.
Right. I'm edditing the OP.
Ophiuchus wrote:And the basic reasoning for the population bonus was like boosting bonus to the next level.
o generic supplies makes a bad species average with the next tech it becomes good...
It makes much sense. In the end, though, the differences between bad and average stockpiling species is rather small. If any of them has less techs or focused colonies than the other then it has worse stockpiling. IMO, if some balance tweaking can't be done to make this change a bit and still work properly (e.g. making BAD=0.1*0.02*pop, a fifth of AVERAGE, would still work the same in mid to late game, and almost the same in early), I think the BAD_STOCKPILING trait could be removed.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#8 Post by Ophiuchus »

Oberlus wrote:IMO, if some balance tweaking can't be done to make this change a bit and still work properly (e.g. making BAD=0.1*0.02*pop, a fifth of AVERAGE, would still work the same in mid to late game, and almost the same in early), I think the BAD_STOCKPILING trait could be removed.
It would probably make a difference if we each tech really boosted by a stockpiling level. So that by researching two techs, your BAD_ species would become GOOD_, but your AVERAGE_SPECIES would become GREAT_.

Of course that boost would be mean rebalancing the numbers.
More like BAD=0.01 AVERAGE=0.02 GOOD=0.05 GREAT=0.1 all further boosts add 0.1
(so after researching generic supplies, laenfa would be 0.1 and sly would be 0.2)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Reviewing the current Imperial Stockpile mechanics

#9 Post by Oberlus »

Ophiuchus wrote:It would probably make a difference if we each tech really boosted by a stockpiling level. So that by researching two techs, your BAD_ species would become GOOD_, but your AVERAGE_SPECIES would become GREAT_.

Of course that boost would be mean rebalancing the numbers.
More like BAD=0.01 AVERAGE=0.02 GOOD=0.05 GREAT=0.1 all further boosts add 0.1
(so after researching generic supplies, laenfa would be 0.1 and sly would be 0.2)
Need to crunch some numbers, no time right now. But a note: this would probably imply the need for Sly to be Ultimate instead of Great, because dividing by two their initial stockpiling capacity would be crippling for them.

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Reviewing the current Imperial Stockpile mechanics

#10 Post by Oberlus »

I'm working on the calc sheets.
To make better analysis of the effects of techs, buildings and focus settings on different scenarios of planets and populations, I'm also making the calculations for PP production from the respective techs, buildings and focus settings. Thus I'll know how much "commitement" or "sacrifice" does it take, in terms of PPs not produced, to reach a certain Stockpile output.

My point now is that I've seen for first time all the effects (population-based or fixed, to all colonies or only to the ones with the specific planetary focus) of the different industry (production) techs and buildings, and ALL them are depending on industry focus except the fixed +5 bonus of adaptive automation.
On the other hand, Stockpile has many non-focused pop-based bonuses, and also that extravagant effect of the Stockpile Center, that gives a 10% of the total empire's industry as a bonus to that planet's Stockpile, also regardless of planetary focus (so empires with many great industry planets will have twice the bonus of other non-industry-gifted empires, regardless of focus commitment and species stockpile trait... I don't like that at all).

I think Stockpile should follow mechanics closer to what Research and Industry do (so more dependent on focus and less unconditional bonuses).
Problem (relatively big) is that would cripple Sly at the beginning. Really cripple them. If they have to change focus to Stockpile to get some tine +4 to Stockpile in exchange of way more PPs you stop producing in your homeworld... Well, that sucks. I'm considering adding a fixed bonus, not focus dependent, to the capital, in the PREDICTIVE_STOCKPILING tech (unlocked at start), so that Great get something like +10, Laenfa +3, average +0 and bad -1.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#11 Post by Ophiuchus »

Oberlus wrote:
Ophiuchus wrote:It would probably make a difference if we each tech really boosted by a stockpiling level. So that by researching two techs, your BAD_ species would become GOOD_, but your AVERAGE_SPECIES would become GREAT_.

Of course that boost would be mean rebalancing the numbers.
More like BAD=0.01 AVERAGE=0.02 GOOD=0.05 GREAT=0.1 all further boosts add 0.1
(so after researching generic supplies, laenfa would be 0.1 and sly would be 0.2)
Need to crunch some numbers, no time right now. But a note: this would probably imply the need for Sly to be Ultimate instead of Great, because dividing by two their initial stockpiling capacity would be crippling for them.
Or they would need to spend 40RP to get back to 0.2 with generic supplies ;)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Reviewing the current Imperial Stockpile mechanics

#12 Post by Oberlus »

Ah, right. You said it, make GENERIC_SUPPLIES up one level the species trait. But how are you planing to do that, changing the species trait itself upon researching the tech? Or with some complex FOCS to add a different amount of pop-based bonus depending of the species trait?

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#13 Post by Ophiuchus »

Oberlus wrote:Ah, right. You said it, make GENERIC_SUPPLIES up one level the species trait. But how are you planing to do that, changing the species trait itself upon researching the tech? Or with some complex FOCS to add a different amount of pop-based bonus depending of the species trait?
Not completely sure yet. I would probably have a look at the weapons stuff again and probably have a macro for to define a constant for each BAD_, GOOD_ level.

"Changing the species trait" would not work as it is shared between the empires.
Maybe i could use an empire meter which includes the species name to track the state of stockpiling, but that also does not sound right.
So probably it will be a conditional thingy.

Best case for use site would be along [IMPROVE_STOCKPILING_LEVEL(Source.Species, 1)] (e.g. if setting stockpile focus or in each tech)

Realistic worst case would be a lookup-table like macro.

As this could take some time and effort, tt would be great to know from your calculations if this actually would help.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5714
Joined: Mon Apr 10, 2017 4:25 pm

Re: Reviewing the current Imperial Stockpile mechanics

#14 Post by Oberlus »

Ophiuchus wrote:
Oberlus wrote:make GENERIC_SUPPLIES up one level the species trait
[...]As this could take some time and effort, tt would be great to know from your calculations if this actually would help.
Oh my, it's complicated even for the spreadsheet (I mean, every other tech/building/species trait requires one line to gather all effect, this requires another table itself).
The more I think about it the less I like it. It certainly isn't KISS, and it is different of any other species trait mechanic.


I've identified a few problematic effects regarding scalability: the species trait bonus and some of the tech and building effects does not require the stockpile bonus. This in late game of big maps is brutal, if you are good or great or have researched the first two techs you can get Stockpile in the hundreds (for max industry production of thousands). That doesn't happen with Industry or Research, and should not happen with Stockpiling.
So I'm also testing to make every pop-based stockpiling effect requiring the focus. As commented before, this cripples the starting turn of Sly, but seems solved by adding a fixed bonus to the Stockpile of the capital depending on the species trait (bad...ultimate: +0, +1, +3, +10, +15). Thus Sly can thrive, industry focused, until they have 5-10 planets before having to research generic supplies to further speed up distributed expansion or production.

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Reviewing the current Imperial Stockpile mechanics

#15 Post by Ophiuchus »

Oberlus wrote:That doesn't happen with Industry or Research, and should not happen with Stockpiling.
Hm. Apples and Oranges? Industry and research give you something directly. Stockpile first has to be charged using industry.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply