1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Formula Thread

Discussion in 'Civ6 - Strategy & Tips' started by KrikkitTwo, Oct 21, 2016.

  1. ShinigamiKenji

    ShinigamiKenji Chieftain

    Joined:
    Nov 8, 2016
    Messages:
    921
    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: Feb 12, 2017
  2. KoKid90

    KoKid90 Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    58
    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.
     
  3. ShinigamiKenji

    ShinigamiKenji Chieftain

    Joined:
    Nov 8, 2016
    Messages:
    921
    Probably lacking a division by 100 after the bolded brackets, orsomething like that. Had the same problem with district cost formula.
     
  4. KoKid90

    KoKid90 Chieftain

    Joined:
    Mar 23, 2015
    Messages:
    58
    In either formula, the *100 and /100 are useless as they cancel each other. But yes it seems to provide more believable numbers.
     
  5. ShinigamiKenji

    ShinigamiKenji Chieftain

    Joined:
    Nov 8, 2016
    Messages:
    921
    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.
     
  6. KrikkitTwo

    KrikkitTwo Immortal

    Joined:
    Apr 3, 2004
    Messages:
    12,308
    Yes at then end.. same mistake, thanks for catching.
     
  7. Mettpawwz

    Mettpawwz Chieftain

    Joined:
    Feb 4, 2017
    Messages:
    66
    Gender:
    Male
    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: Apr 21, 2017
  8. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    5,147
  9. Mettpawwz

    Mettpawwz Chieftain

    Joined:
    Feb 4, 2017
    Messages:
    66
    Gender:
    Male
    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.
     
  10. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
    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: Sep 11, 2017
  11. MadDjinn

    MadDjinn Chieftain

    Joined:
    Jan 28, 2011
    Messages:
    4,553
    Future civic was just added recently.
     
  12. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
    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.
     
  13. slowcar

    slowcar stratege

    Joined:
    Jun 19, 2006
    Messages:
    799
    Location:
    hamburg, germany
    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?
     
  14. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    5,147
    I did some checks on district costs before the last patch and the civics is indeed now 61

    nope.... to be more precise
    the current summed combat strength of all units
     

Share This Page