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

evrymetul

Chieftain
Joined
Sep 28, 2019
Messages
4
It used to be in CIV4GameSpeedInfo.xml, but I'm not having any luck finding it. Anyone know where it is now?
 
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.
 
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.
 
So each step could be 50% more expensive than previous step for example.
 
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.
 
If you have access to the DLL you could change INT to long.
 
If you have access to the DLL you could change INT to long.
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.
 
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.
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.
 
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.
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:
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.
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.
 
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.
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?
 
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.
My deeper point is, it would only buy you another trait or two before overflowing again.
 
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?
upload_2022-1-22_0-21-56.png


upload_2022-1-22_0-24-22.png
 
I should add in a max level cap though, just to make overflow impossible in general.
Eventually it would be nicer to see a 'Greater Culture' sort of mechanism extend things to further potential instead, imo.
 
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:
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.
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:
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:
Top Bottom