Calculating Border Growth Speed [Bugs?]

Discussion in 'Community Patch Project' started by Novntis, Oct 18, 2020.

  1. Novntis

    Novntis Chieftain

    Joined:
    Mar 16, 2015
    Messages:
    51
    Does any one know what the exact border growth function implementation is? I can't find it in the game files but some simple tests have revealed some oddities related to GAME_SPEED / the PlotCultureCostModifier.

    Here's some values I've pulled from the latest version on turn 1. These are turns to next tile (first tile) acquisition on Quick/Standard/Epic/Marathon.

    Any civ but Russia: 10/20/30/60
    Russia: 10/15/20/45

    First off, I thought the factor for Quick culture cost scaling was 0.67 but for some reason its 0.5 here which is odd, especially as the others line up with expected 1, 1.5, and 3 scalers. It certainly doesn't seem like the other Quick scalers for growth, building, tile improvements are 0.5, so this just seems like a mistake (I could be wrong though).

    Additionally, the Russian "-25" PlotCultureCostModifier doesn't seem to be applied consistently across all game speeds. On Quick the modifier is "0" and on Epic you're getting a "-33" instead of a "-25". This seems like an unintended consequence of applying era modifiers to border growth costs given the results, but I don't know the formula, so I can't inspect this further myself.

    Also just because its sort of relevent to this discussion, local_culture generated by the updated Epona pantheon doesn't show up in any tooltips so border growth estimates are currently wrong across the board if you have the pantheon.

    I'd be happy to report this all to Github as well if someone can verify this behavior is not intended.
     
  2. Milae

    Milae Prince

    Joined:
    Dec 17, 2019
    Messages:
    327
    Gender:
    Male
    Not sure if you want the full explanation but the short one is that certain values in the game are rounded down by a certain factor. So in this case I'm guessing it's rounded down to the nearest 5. It was definitely done intentionally at some point though I'm not sure if it's still necessary or just a relic from base game.
     
    Novntis likes this.
  3. maxf

    maxf Chieftain

    Joined:
    Jan 4, 2019
    Messages:
    59
    Gender:
    Male
    As I wrote in another thread, I think that the system of reducing the cost of tiles should be changed: not the cost should decrease, but the growth rate should increase. Say, 4 sources of + 25% of the border growth rate should accelerate it 2 times, but not 10 times as now (as far as I understand, there is some lower limit for reducing the cost of tiles, 10 or 15% of initial cost). Or these reductions should not act additively, but multiplicatively: 2 sources of -25% tile's cost reduction should give a total value of 0.75 * 0.75 = 56% of initial value, but not 50% (4 sources 32% instead of current lower limit of 10 or 15%).
    We can got -75% (in case of Russia -100%; with some mods even more) of tile's cost that looks nonsense. Although there is a lower limit of the cost of tiles (10 or 15%), so we can't get absolutely free tiles, I think that this reduction from several sources is very non-proportional, non-balanced, too huge, and this system should be corrected.
     
    Last edited: Oct 19, 2020
    Novntis likes this.
  4. Novntis

    Novntis Chieftain

    Joined:
    Mar 16, 2015
    Messages:
    51
    @Milae You're totally right. There is definitely a floor function in there to increment by 5. I was digging around a bit more earlier today and reversed engineered a formula. Not sure if it's totally correct though.



    If you plug numbers into this to model the situations I referenced above, you'll get the same values I originally postulated were bugged. Not technically bugged, but fairly obtuse.

    Ah makes sense there is a lower limit. I'll have to do some testing with IGE to see what it is, and will update the above formula. I agree this system makes little sense from a scalability standpoint. Making it multiplicative seems more sensible. We can always add another cost reduction to another later game building to get it back down to the lower value if we feel like that was fine. I also never really realized how much impact Sovereignty has on cost scaling. It's really quite huge.

    Edit: Above formula wrong. Doesn't have floor for -% modifiers. Parens in wrong place. And missing GoTE.
     
    Last edited: Oct 20, 2020
  5. maxf

    maxf Chieftain

    Joined:
    Jan 4, 2019
    Messages:
    59
    Gender:
    Male
    @Novntis yes, your formula almost right, but I think that -% tile’s cost modifiers and GSF are applied to the whole tile cost, including CCFP. And I agree that Sovereignty affects also very dramatic. -10 or even -5% Sovereignty’s modifier would quite enough.
     
    Last edited: Oct 19, 2020
    Novntis likes this.
  6. psparky

    psparky Prince

    Joined:
    Feb 24, 2011
    Messages:
    558
    Gender:
    Male
    Yes, Sovereignty would be better described as "culture cost of tiles is reduced massively", rather than "20% (exponentially)" which I expect very few people fully understand. The discount quickly rises to 70% and beyond.

    Given the nature of exponents, I think the discount should apply to the portion greater than 1, rather than to the raw number. So 20% from 1.35 would give 1.28 rather than 1.08.

    However, I understand that border growth is generally considered in a good place at the moment, so it seems unnecessary to tamper with the current system.
     
  7. Novntis

    Novntis Chieftain

    Joined:
    Mar 16, 2015
    Messages:
    51
    Good eye. You're definitely correct. I'll fix this when I add handling for the minimum -% modifier. Had the correct implementation in R for testing numbers, but wrong in LaTeX.

    Yep. Here's a plot of the calculation of culture cost per tile in a non-russian city (on Epic). The blue curves have monuments. The upper two curves have Sovereignty. You can see the difference between one -25% modifier and the x0.8 exponent modifier is massive. I need to generate some dummy culture/border growth per turn numbers to convert this projection to cumulative tiles/yields acquired over 300 turns. I'm not entirely convinced Sovereignty is a good thing long term though for border growth strats. Its conceivable that you'll more or less run out of tiles to expand to either by cost or space limits relatively early if you take every bonus to border growth. Thus you'll burn through your era scaling yields when they're worth less as opposed to having them sustain you later in the game. IF that's how the math shakes out when I do it, then that's probably a good enough reason to reevaluate border growth. Fully investing in a strategy shouldn't hurt the strategy.



    Also does anyone know if border growth still caps at 5 tiles from the city like it does in vanilla?
     
    Last edited: Oct 19, 2020
  8. Milae

    Milae Prince

    Joined:
    Dec 17, 2019
    Messages:
    327
    Gender:
    Male
    Yes it does and it seems to have been hard coded in at 5 now instead of using an xml value as previously.

    I tried to change it because I had a game where my capital ran out of tiles in medieval era lol.
     
    Novntis likes this.
  9. Novntis

    Novntis Chieftain

    Joined:
    Mar 16, 2015
    Messages:
    51
    Thanks, I couldn't remember if cities ran out of tiles or not. I had that same thing happen to my capitol in a russia game a while back, but I didn't know if it had been fixed.

    It's a shame that it works that way. I feel like there really shouldn't be a cap, though I suspect removing it would cause problems. A good alternative logic would be dumping excess border growth from a complete city to the next closest with free tiles if possible. I think its silly that you can run out of yields that early. The mouthfeel on that is pretty bad.

    Edit: Inspected the DLL. Increment by 5, claim range of 5, and -% reduction capped at -85 confirmed.
     
    Last edited: Oct 21, 2020
  10. Nightmare Dusk

    Nightmare Dusk Chieftain

    Joined:
    Sep 16, 2020
    Messages:
    48
    Gender:
    Male
    Location:
    America
    Personally would be fine with there not being a limit to border growth. would be funny, and realistic, for cities to claim huge swaths of ocean in later eras cause all the land is claimed
     
  11. InkAxis

    InkAxis King

    Joined:
    Feb 24, 2020
    Messages:
    648
    Gender:
    Male
    I think what needs to be fixed is the UI. Its very strange that they don't show up there.
     
  12. Milae

    Milae Prince

    Joined:
    Dec 17, 2019
    Messages:
    327
    Gender:
    Male
    Could you point out where in the DLL the claim range is set at 5?
     

Share This Page