1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice
  2. Old World has finally been released on GOG and Steam, besides also being available in the Epic store . Come to our Old World forum and discuss with us!
    Dismiss Notice

How do you increase/decrease the amount of culture needed for traits?

Discussion in 'Civ4 - Caveman 2 Cosmos' started by evrymetul, Jan 15, 2022.

  1. evrymetul

    evrymetul Chieftain

    Joined:
    Sep 28, 2019
    Messages:
    4
    Gender:
    Male
    It used to be in CIV4GameSpeedInfo.xml, but I'm not having any luck finding it. Anyone know where it is now?
     
  2. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    It's currently hardcoded.

    You could reduce the culture needed by changing iSpeedPercent in CIV4GameSpeedInfo, but that would change the speed of a huge amount of different things.
     
  3. Somebody613

    Somebody613 Emperor

    Joined:
    Nov 18, 2019
    Messages:
    1,073
    Gender:
    Male
    Tell me about "coincidences", lol.
    I literally today played around with Traits (via Cheat Engine) and found out that you can't go beyond 2+ billion in cost, since it loops over to negative values and gets stuck.
    So I had pretty much the same question:
    How do I control the cost of Traits?
    And look what I see when I logged to ask about it, loool!
    In any case, this really needs a solution, even if it's not that easy to reach such values in a normal game - but it's not impossible, so it's a relevant bug.
     
  4. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,231
    Location:
    Poland
    So each step could be 50% more expensive than previous step for example.
     
  5. Somebody613

    Somebody613 Emperor

    Joined:
    Nov 18, 2019
    Messages:
    1,073
    Gender:
    Male
    My question is how to make it not bump into the "negative value" issue in the first place?
    I remember it used to be split into "small value" and "value in millions" or something, which kinda multiplied it by a huge factor to be usable.
    Because, again, while it's a bit unrealistic to reach such huge values in a normal game, I think it's not impossible under Eternity, so it shouldn't be an issue.
    And I find it sad that I'm limited to merely 18 Traits per gameplay (even with cheats) - but that's me and my "Trait Them All" mentality, loool.
     
  6. PPQ_Purple

    PPQ_Purple Techpriest Engineer

    Joined:
    Oct 11, 2008
    Messages:
    4,716
    If you have access to the DLL you could change INT to long.
     
  7. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    29,033
    Gender:
    Male
    Location:
    Las Vegas
    It already is so you'd have to take even more dramatic action to prevent such overflows, which I assumed at some point would be necessary.
     
  8. PPQ_Purple

    PPQ_Purple Techpriest Engineer

    Joined:
    Oct 11, 2008
    Messages:
    4,716
    Are you sure of that? People here are talking about overflow happening at about 2x10^9 which is what you would expect from a signed 32 bit integer. A long would yield substantially larger limits.
     
  9. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,231
    Location:
    Poland
    It doesn't overflow, but steps become too large at some point as national culture climbs.
    Also that split into millions seems to be replaced with long int already.
     
    Last edited: Jan 21, 2022
  10. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    Any overflows we currently have are indeed overflow in 32 bit integers, we've converted some to 64 bit integers here and there, that doesn't mean we've converted all code spots that need it yet.
     
  11. PPQ_Purple

    PPQ_Purple Techpriest Engineer

    Joined:
    Oct 11, 2008
    Messages:
    4,716
    If you can be sure you don't need negative numbers you can always go all out and use unsigned long. That should give you the full 64 bits of data to work with. You just have to be sure not to get into calculations with things that actually do use negatives. But like, does anything in CIV actually use them?
     
  12. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    29,033
    Gender:
    Male
    Location:
    Las Vegas
    My deeper point is, it would only buy you another trait or two before overflowing again.
     
  13. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    upload_2022-1-22_0-21-56.png

    upload_2022-1-22_0-24-22.png
     
  14. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    My bet is that the overflow seen here is just the string formating issue, that it's just a tooltip text issue.

    I should add in a max level cap though, just to make overflow impossible in general.
     
    raxo2222 and MattCA like this.
  15. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    29,033
    Gender:
    Male
    Location:
    Las Vegas
    Eventually it would be nicer to see a 'Greater Culture' sort of mechanism extend things to further potential instead, imo.
     
  16. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    Yup it was just a text issue, damn it was hard to add enough culture to enough cities to get the negative values in the tooltip, but I got there eventually and went on to fix the string formating so the number wouldn't overflow in tooltip:
    upload_2022-1-22_3-31-46.png

    2 217 600 000 was the value that overflowed that I fixed by simply changing the code that adds the text to the tooltip.
    2 147 483 647 is maximum 32 bit int btw.

    Each city in C2C has a max culture cap of:
    21 474 836
    This is because it internally is scaled up with 100 to reduce rounding errors.
    It's imo a reasonable max cap per city, not much point in transforming it to 64 bit integer.
     
    Last edited: Jan 21, 2022
  17. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    Next SVN will have the fix to this tooltip bug, I also changed the wording a bit:
    upload_2022-1-22_3-49-4.png
     
  18. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    9,231
    Location:
    Poland
    Do capped cities contribute to national culture?
    That is you could just take empire-wide culture income and use it to increase national culture.
     
    Last edited: Jan 22, 2022
  19. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    Yes, a city that has reached its max cap will still contribute to national culture each turn even though it discards the culture for itself.
     
    raxo2222 likes this.
  20. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,838
    Location:
    Norway
    Spoiler Maybe this culture info layout is better? :
    upload_2022-1-22_14-3-32.png

    Easier to compare the numbers when they are aligned.
    Yes, the leadership level is low compared to the culture amounts because I did this test on eternity gamespeed.
     
    Last edited: Jan 22, 2022
    raxo2222 likes this.

Share This Page