9051
- Fix to Realistic Culture Spread
- Adds CommercePerPopChanges and YieldPerPopChanges tags to BuildingInfos
These look to be working properly with one exception. And I think I'll need some help with it. If you look at the screenshot, you'll see that when you hover over a building, any qualifying adjustments to the base Yields and Commerces from a per population tag will show up as calculated in. (In this example, the commerce amount has been modified to reflect +11 commerce). However, in the single line listing in the building list itself, the modified commerce isn't showing as adjusted... still showing +10 (the base). This I think is taking place in python. The python must be calling to the correct amount for commerces because the culture would only be +2 if it wasn't properly calculating on that line. So it's only yields that need to be adjusted.
@DH: Would you be able to identify where this is taking place and modify the output there?
The way this tag works is to basically take the tag value given, such as in this example:
Code:
<YieldPerPopChanges>
<iYield>1</iYield>
<iYield>0</iYield>
<iYield>100</iYield>
</YieldPerPopChanges>
<CommercePerPopChanges>
<iCommerce>0</iCommerce>
<iCommerce>1</iCommerce>
<iCommerce>100</iCommerce>
<iCommerce>0</iCommerce>
</CommercePerPopChanges>
Then multiply that amount by the population of the city (this updates as the city grows) then divide by 100.
This means that in the above example, with the YieldPerPopChanges, the 1 would mean .01 additional .01 food per population and the 100 would mean +1 Commerce per population.
Important Note!: The end result rounds down to the nearest integer so the Food bonus wouldn't make a difference at all until the population of the city reaches 100. But the Commerce bonus in this example would be effective with every population increase and a city of 100 population would be getting +100 Commerce from a building with such a tag use.
Would've liked to make it add in more granularly but the way the code is setup made taking such a step a massive pain so this is pretty much a necessary evil that it will always round down to the nearest integer.
Anyhow, @Faustmouse: You asked for this tag a year or two ago... here you go!
These tags could be very useful for improving the way some of our buildings work to achieve better mod balance. But beware.. they could also be extraordinarily IMbalancing if not used with care.
Oh... and no, the xml adjustment to test this with the palace is
not committed
