[Vanilla] Formula Thread

Is the district cost formula correct? According to it, after the first tech the cost goes up to 600 production. The formula is (diregarding discounts for UD and less than average number): Cost = 60*(1+9*Larger of [100*(Number of Techs/67 OR Number of Civics/50)])

Cost = 60*(1+9*[100*1/67]) = 60*(1+9*[1.49]) = 60*(1+9*1)=60*10 = 600

--

EDIT: Found the mistake after reading the reddit link. It's missing a division by 100. It's thus 65 production after the first tech.

Cost = [60*(1+9*Larger of [100*(Number of Techs/67 OR Number of Civics/50)]/100)]
 
Last edited:
GPP yield=10 ....[5 for Theater+Carnival projects... they give multiple types of GPP]
=10or5*(1+7*Larger of [100*(Number of Techs/67 OR Number of Civics/50)])

Is this the number of GP points awarded at the end of the District project ? There's something I don't get if this is because with about 30 tech researched (approx. in Industrial era), that would provide 3000+ GPP which is impossible.
 
Is this the number of GP points awarded at the end of the District project ? There's something I don't get if this is because with about 30 tech researched (approx. in Industrial era), that would provide 3000+ GPP which is impossible.

Probably lacking a division by 100 after the bolded brackets, orsomething like that. Had the same problem with district cost formula.
 
In either formula, the *100 and /100 are useless as they cancel each other. But yes it seems to provide more believable numbers.
 
In either formula, the *100 and /100 are useless as they cancel each other. But yes it seems to provide more believable numbers.

If one wants to be pedantic, they do not exactly cancel, because the number is multiplied by 100, rounded down, then divided by 100. In the process, the final number might be 1 unit down from if it was just rounded down. But the difference is small enough to be negligible in most cases.
 
Is this the number of GP points awarded at the end of the District project ? There's something I don't get if this is because with about 30 tech researched (approx. in Industrial era), that would provide 3000+ GPP which is impossible.

Yes at then end.. same mistake, thanks for catching.
 
This still needs testing, but according to a chinese website (http://webcache.googleusercontent.c...ml+&cd=7&hl=en&ct=clnk&gl=uk&client=firefox-b) the formula for COST_PROGRESSION_GAME_PROGRESS is:

Base Cost * (1 + ( (Progression Parameter / 100) - 1) * (GameCompletion% / 100) )

So as an example with the Trader at the very end of the game:

40 * ( 1 + ( (400 / 100) - 1) * (100 / 100) ) = 160 Production

If anyone could just check that Traders cap out at 160 hammers I'd say that that's probably the correct formula for COST_PROGRESSION_GAME_PROGRESS.
Admittedly, I have no idea what the GameCompletion% is based on, maybe techs or civics?
 
Last edited:
I mean, the base cost and progression parameter can be found in the game files (for the Trader in the Units table). It's the GameCompletion% that I couldn't find any information on after googling it for a few minutes, but I imagine it's still useful to have the formula around as you can approximate GameCompletion%, and at least that way you know what the production cost caps out at so you can set the Progression Parameter accordingly. Still though, I haven't had a chance to test it yet, so it's unverified right now.
 
Based on this thread and a district cost thread on Reddit, I think I have worked out the COST_PROGRESSION_GAME_PROGRESS formula. It looks like it is essentially the same as the district cost formula, but with a variable scale and no below-average discount. The value is the fraction of techs or civics complete (whichever is more), expressed as a whole number percentage.

techProgress = # techs / 68
civicProgress = # civics / 51
progress = math.floor(100 * math.max(techProgress, civicProgress))​

The maximum cost is based on the PointProgressionParam1 value, which is a percentage of base cost:

maxCost = baseCost * param / 100​

The total cost is then a linear interpolation from base to maximum cost (rounded down):

cost = lerp(baseCost, maxCost, progress / 100)​

The COST_PROGRESSION_NUM_UNDER_AVG_PLUS_TECH formula seems to work the same way, except that the maximum cost is always 1000% (like the Aqueduct and Neighborhood districts). For this progression, the parameter is instead the per cent discount for having fewer than the average number of districts of the type. For the current game rules, that is a 40% discount for all districts.

discountCost = math.floor(baseCost * (1 - param / 100))​

I am testing this against save files from a game I just finished. So far the values work out for specialty district costs, aqueduct costs, and district project costs. I have one save with 44/68 techs progress:

progress = math.floor(100 * 44 / 68) = 64%

specialty district / neighborhood
baseCost = 54
maxCost = 54 * 1000% = 540
cost = lerp(54, 540, 64%) = 356

discounted specialty district
discountCost = math.floor(54 * 0.6) = 32
maxCost = 32 * 1000% = 320
cost = lerp(32, 320, 64%) = 216

aqueduct
baseCost = 36
maxCost = 36 * 1000% = 360
cost = lerp(36, 360, 64%) = 243

district project
baseCost = 25
maxCost = 25 * 1500% = 375
cost = lerp(25, 375, 64%) = 249​

These exactly match the values in my production panel.

EDIT: After measuring a few games, I noticed that some of my numbers were off by one, so I verified counts, and it appears that my example should have been 44/68 = 64% instead of 43/67 = 64%. I suspect that the older threads are missing a tech that wasn't there at launch, perhaps Future Tech? Some of the numbers change depending on exactly how you multiply and round, and this model seems most consistent with my measurements so far.
 
Last edited:
I knew about the new Future Civic change, but I don't have any saved games handy where civic progress is ahead of tech progress, so I cannot easily check the denominator for civics. I'm not 100% sure about the tech denominator either, but 68 seems to fit results better than 67 for the games I was able to check in a few minutes. I suppose the ideal thing would be to use the Tuner to force tech & civic progress from 0 to 100%. Because right now I'm pretty certain I have the formulas down, but I'm not totally certain of the limits.
 
Does somebody have a formula for the military score? I guess it is the summed combat stength of all units, but do promotions and gold figure into it, too?
 
cannot easily check the denominator for civics
I did some checks on district costs before the last patch and the civics is indeed now 61

but do promotions and gold figure into it, too?
nope.... to be more precise
the current summed combat strength of all units
 
The last post on this thread was almost one year ago and I'm sure there has been some improvements made to the knowledge of civ vi formulae, I myself have an update anyway. Is there another place for consolidated info or is it here but very ad hoc?
 
So my contribution (via cross-referenced material thanks @Victoria) is that

Loyalty pressure from nearby citizens is:

Domestic Pressure = Domestic Age Factor * Sum of [ each Domestic Population * (10 - Distance Away) ]
Foreign Pressure = Sum of [ each Foreign Population * (10 - Distance Away) * Foreign Age Factor ]


Loyalty Pressure = 10 * (Domestic - Foreign) / ( min[Domestic, Foreign] + 0.5 )
  • Age Factors = 1.0 (Normal Age), 1.5 (Golden Age), 0.5 (Dark Age)
  • The specific city in question exerts its own domestic pressure where its distance away is zero.
  • City-States / Free Cities do not contribute to Foreign Pressure, but exert their own Domestic Pressure.
  • Bread and Circuses doubles the population count for a city.
  • The Capital, as a separate item, emulates a city (domestic or foreign) with an identical population and tile placement to the city which is the capital only the age factor is always 1.0, either domestically or foreign. Bread and Circuses does not double the effect of capital, only of the underlying city.
  • The 0.5 I have found to be a divide by zero fix, and corrects some of the rounding problems seen in previous threads.
  • Loyalty pressure is capped at +- 20, so technically is: min[20, max[-20, loyalty pressure]]
Interestingly, the reason why a dark age is such a penalty is due to the "minimum" operator. If two civs are in balance in normal ages i.e. domestic = 20 = foreign then you have no citizen loyalty pressure. But if you dip to a dark age then the denominator falls to 10 and emphasises the penalty: your loyalty becomes -10. But if your opposition entered a golden age and exerted 30 foreign pressure the denominator remains the same so your pressure is only -5.

I would appreciate if anyone finds a case where this formula doesn't work in case it needs tweaking..


Religious Citizens in a City:


When a city grows in population 50 pressure is added to the majority religion. If there is no majority religion, it is added to Atheist/Pantheon pressure (however you like to call it). Since Atheist/Pantheon pressure cannot be removed, either by starvation, inquisitors, apostles, conquer etc. it will always be a multiple of 50. The other religious pressure values can usually be seen on in-game hover and fluctuate based on in game actions.

Citizens of Specific Religion (or Atheists) = ROUND(Population * Specific Pressure / [ Sum of all Religious Pressure and Atheist/Pantheon Pressure])

In the case the sum of each rounded value is not equal to the total population (occasionally it can be higher or lower by one) then on the side which has been over-rounded, i.e if the total is 16 when the population is actually 15, the value which was rounded up the most will be reduced by one so there is always consistency.
 
I'd very much appreciate any in-depth description of the current production overflow mechanics. I welcome the recent change to get rid of the exploit (like build 99% of walls or a ship, then chop a forest/resource with the +100% Policy Card and Magnus active, then use the massive production overflow carried over to get a huge chunk of a Wonder completed the next turn), but my gut feeling when playing nowadays is that "I don't know if/when there will be anything at all that will be carried over". :confused:
Hoping for the help of motivated smart people! :D
 
Top Bottom