Social Policy cost

(ROUNDDOWN( (100-33)/100, 1))

Thats a bit strange, this statement simply equals a constant 0.6

In turn that would mean the representation bonus gives a 40% per town reduction, is that correct or are the brackets wrong and should it round down after multiplying for number of cities ?

(resulting in 0.6 ; 1.3 ; 2.0 etc instead 0f 0.6 ; 1.2 ; 1.8....)

Assuming it should be rounded after multiplying for number of cities i changed it a bit and ended up with this:

if representation: =FLOOR(ROUNDDOWN(25+(3*([policies so far]))^2,01)*(1+(ROUNDDOWN(6,7*([cities]-1))/100));5)
if not representation: FLOOR(ROUNDDOWN(25+(3*([policies so far]))^2,01)*(1+(10*(([cities]-1)/100)));5)

Threw that in open office calc and made some screenshots:



Too lazy to find a file storage where i can upload the open office calc file now.
 
It is an effective 40% discount, based on my testing and what I could glean from the source code (disclaimer: I have very, very poor command of C++). That was not the case in vanilla (originally 30%) or pre-BNW-patch (15%), where Representation's -33 integer discount would, if left unrounded, result in a per-city social policy cost of 20.1% and 10.05%, respectively. All of this appears to be a function of C++ integer division and rounding (truncation towards zero, etc.; given the age of the base game, I suspect they used C++98 or 03, but I haven't checked). Anyway, based on all of that, another poster suggested a slightly different Excel formula. See: http://forums.civfanatics.com/showpost.php?p=13818117&postcount=23. I haven't gone back to validate the suggested alternative formula with in-game testing.

If you're comfortable trying to figure out C++ source, feel free to dive into \Sid Meier's Civilization V SDK\CvGameCoreSource\CvGameCoreDLL_Expansion2\ CvPolicyClasses.cpp (portion beginning with /// How much will the next policy cost). I would certainly welcome your thoughts.
 
It is hard to work with a screen shot of tables, but it looks to me that for an empire of X number of cities, about every 10th policy is a freebie over and beyond what you get with Representation! That seems remarkably good!

From that other thread:
Basically, you'll always need to wait for Information Era before getting your free policy's worth of saved up culture.
Was Delnar off by that much?
 
It is hard to work with a screen shot of tables, but it looks to me that for an empire of X number of cities, about every 10th policy is a freebie over and beyond what you get with Representation! That seems remarkably good!

From that other thread:

Was Delnar off by that much?

I think you havent interpreted the data correctly. The 10th policy being the price of the 9th doesnt mean you got 1 for free.

If we look at 6 cities the differences for each policy are:
0: 5 culture
1: 5 culture
2: 10 culture
3: 20
4: 30
5: 40
6: 60
7: 80
8: 105
9: 135

That adds up to a total of 490 culture by the time you are at your 10th policy. That is not even half of what the 10th policy costs.

Of course, the numbers in my screenshot are wrong since they are based on 33% discount instead of what apparently should be 40%.

maybe someday in the future ill throw all the different excel functionalities i have made in 1 file, make them user friendly and upload it.
(prediction of GPPs in your multiple cities so you can time your gardens, prediction of science output based on your growing cities, calculation of total beakers needed to reach certain techs)
Im lazy though and making stuff user friendly is always 10x more work than the actual functionality. :p
 
I checked through the code and the formula is pretty much like the one described by Browd, but since all operations are made with integer values (meaning that results get rounded down) thing are just little different.

The mathematical formula, before adding other multipliers is:

Cost= (25 + (NumPolicies * 3)^2.01) * (1+(NumCities - 1) * (NumCitiesPolicyCostMod* (100 + PolicyModDiscount)/100) /100)

Where:
NumPolicies = number of current SP you have (without including any free policies)
NumCities = number of cities you have (minus puppets). This is the maximum numbers of annexed cities you ever had, so if you lose or sell a city this number stays up.
NumCitiesPolicyCostMod = Modifier for policy cost regarding number of cities. It is 15 for all maps except Large where it is 10, and Huge were it is 7.5. There is a bug here, because this number is supposed to be an integer value, so I think for huge it is actually 7, even though the XML value says 7.5. This was in Vanilla, in BNW this value is 10 for all maps except Large where it is 7 and Huge where it is 5
PolicyModDiscount = Representation discount, it is 0 normally and -33 with representation.

But since the operations result are truncated, and depending on the order in which these operations are made, the actual formula in Excel would be:
(Cost)= 25 + ROUNDDOWN(POWER(NumPolicies * 3, 2.01), 0) +
ROUNDDOWN(((25 + ROUNDDOWN(POWER(NumPolicies * 3, 2.01), 0)) * (NumCities - 1) * ROUNDDOWN(NumCitiesPolicyCostMod* (100 + PolicyModDiscount)/100, 0))/100,0)

This is before adding other multipliers. The first one to be added is PolicyCostModifier, which is 0 normally and -10 with Cristo Redentor:

Cost = ROUNDDOWN((Cost * (100+ PolicyCostModifier))/100,0)

Then game speed is factored in:

Cost = ROUNDDOWN((Cost * CulturePercent)/100,0)

CulturePrecent is:
67 for Quick Speed
100 for Standard Speed
150 for Epic Speed
300 for Marathon Speed

The last modifier is the Handicap modifier:

Cost = ROUNDDOWN((Cost * PolicyPercent)/100,0)

PolicyPercent is:
50 for Settler,
67 for Chieftain
85 for Warold
100 for Price, King, Emperor, Immortal and Deity
75 the default AI handicap (I don't know exactly what this means)


Finally the result gets rounded down to the nearest multiple of 5, so

Cost = FLOOR(cost,5);


Now to get back to what representation actually does:
ROUNDDOWN(NumCitiesPolicyCostMod* (100 + PolicyModDiscount)/100, 0)

For a standard map or smaller this is 15 without representation, and 10 with representation so exactly 33% reduction.
For large it is 10 normally and 6 with representation so an actual 40% reduction
For huge it is 7 normally and 4 with representation so 42% reduction


For a standard map or smaller this is 10 without representation, and 6 with representation so 40% reduction.
For large it is 7 normally and 4 with representation so an approximately 42% reduction
For huge it is 5 normally and 2 with representation so 40% reduction

I did some math for 8 cities standard size and speed, and for the first 15 policies it's roughly a 20% reduction in total cost of the SP. What I found interesting is that for 8 Cities the 11 th SP cost with representation is exactly the cost of the 10th SP without representation (1955), and from that point forward you get an advantage.

After recalculating using the correct formula with 8 cities, standard size and speed, representation gives roughly 17% reduction in the total cost of each SP. Assuming 8 cities and representation being the 5th policy taken, it is only after the 17th policy that you get a free one. 24015 culture is spent to get policies 5 to 17 if no representation. By taking representation as the 5th policy, 23970 culture is spent to get policies 5 to 18, so the 18th was free and there is even a small amount of culture left.
 
I checked through the code and the formula is pretty much like the one described by Browd,
For a standard map or smaller this is 15 without representation, and 10 with representation so exactly 33% reduction.

Im sorry, i didnt totally work out all your math, but you do you not agree that browds formula higher up indicates 40% reduction instead of 33% ?

Ill check it better some time when i feel like it.
I might also learn how to work with the scenario builder or whatever so that i can test stuff without having to click trough long games.
 
Im sorry, i didnt totally work out all your math, but you do you not agree that browds formula higher up indicates 40% reduction instead of 33% ?

Ill check it better some time when i feel like it.
I might also learn how to work with the scenario builder or whatever so that i can test stuff without having to click trough long games.
Browds formula is right. Apparently I was looking in the old XML where the value for NumCitiesPolicyCostMod is 15 for standard maps (10 and 7.5 for large and huge maps). After further investigating I see that the variable storing this value is initialized to 10, and for standard maps the formula works. However I tested it for huge maps and the culture costs are lower. I don't see where this is modified in the code, but after testing, i determined this value is 7 for large maps and 5 for huge maps.

Because of the (silly) way the calculations are performed, representation actually gives:
40% discount for standard size or lower (each city increases cost roughly for 6% instead of 10%)
42% discount for large maps (each city increases cost roughly for 4% instead of 7%)
40% discount for huge maps (each city increases cost roughly for 3% instead of 5%)
 
If you were talking about this (HANDICAP_AI_DEFAULT) from the CIV5HandicapInfos.xml file, it is what the AI player's play at in BNW instead of the pre-BNW 'Chieftain' level.

At the very bottom of file GlobalAIDefines.xml in folder C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Gameplay\XML\AI there is this bit of code for BNW:
Code:
<PostDefines>
	<Row Name="AI_HANDICAP">
		<Key>HANDICAP_AI_DEFAULT</Key>
		<Table>HandicapInfos</Table>
	</Row>
</PostDefines>
which for pre-BNW was:
Code:
<PostDefines>
	<Row Name="AI_HANDICAP">
		<Key>HANDICAP_CHIEFTAIN</Key>
		<Table>HandicapInfos</Table>
	</Row>
</PostDefines>
 
Top Bottom