I've been investigating the corruption model under 1.29f, which is a lot easier to do these days thanks to the editor. I've come up with a few, possibly interesting results.
So far, I've only really looked at the distance corruption. Mostly I agree with alexnm's results, so I'll only post the differences here. What I've found out is this:
Distance corrupt tops out at 100% (although the maximum you can be affected by is 95% as always). With a courthouse it is never more than 50%, and with a courthouse and police station it is never more than 26% (a figure which I'll explain in a minute).
Distance corruption is calculated to the nearest 2%, with odd number percentages rounded up. So if the corruption is calculated to be 74.8%, it is stored as 74%, while 75.0% is stored as 76%. 95% is left as 95%
though.
Distance from the capitol is calculated rather strangely. It's not quite the geometric distance from the capitol that counts. You follow the route that a unit would take from the capitol to the town of interest (ignoring terrain, water etc.). Each move NE, NW, SE, SW counts a distance of 1, and each move N, S, E, W counts 1.41... (sqrt(2)). So if the most direct route from your captiol to a town is to move 10 squares SE and then 3 S, the total distance would be 14.23 (more or less). This allows something close to the geometric distance to be calculated, without having to do any square root calculations.
And actually, the distance along the diagonals isn't quite sqrt(2), it's a little larger. My best estimate is close to 1.5 (so cities buily on the NE, SW, NW, SE lines from the captiol have slightly lower corruption than you might expect). But there are complications in this that I don't understand fully yet. There may be some rounding off done to the distance before it is multiplied by the scaling factor to give the percentage. And the distances for very distant cities may not be as large as they ought to be. In practice, this only became noticable in for cities where corruption would be 95% in a real game (with optimal number of cities corruption at its normal level).
To calculate final corruption: the distance corruption percentage is multipled by the total gold production of the city to give a value which is not rounded off (30 gold, with 34% corruption, would give 10.2 gold lost to corruption). The number of cities based corruption is added to this, also as an unrounded number, to give the final total lost to corruption (which *is* then rounded to the nearest integer). In my tests, I set the optimal number of cities to 1000, which gave some very small number. E.g. is the distance based corruption gives 10.2 gold lost (as above), and the OCN corruption is 0.25, then the final corruption is 10.45, i.e. 10. If the OCN corruption is 0.35, then the final corruption is 10.55, which becomes 11. In real games, the OCN corruption is going to be higher than the distance corruption in almost all circumstances.
The capitol (or forbidden palace) has corruption of 4% without a courthouse and 2% with a courthouse.
I would tentatively say that being connected to the palace via road, harbour or whatever multiplies the distance corruption factor by 0.8 (although it can still go to 100% in the absence of a courthouse). The OCN corruption is unaffected by connection to the capitol. I got the factor 0.8 by guessing - the limits I had fixed it between 0.796 and 0.823 (I think), so 0.8 seemed the most sensible value. This may change slightly if I ever figure out just how the distance is really calculated.
Cities at the same distance have the same OCN corruption (as though they were all the nearest out of that group). There is some rounding of distances involved here as well, since I had a group if 5 cities all at slightly different distances, and they all showed the same level of OCN corruption.
I think that that's all I've worked out so far. I doubt any of this is going to affect how we play the game in the slightest, but you never know.
So far, I've only really looked at the distance corruption. Mostly I agree with alexnm's results, so I'll only post the differences here. What I've found out is this:
Distance corrupt tops out at 100% (although the maximum you can be affected by is 95% as always). With a courthouse it is never more than 50%, and with a courthouse and police station it is never more than 26% (a figure which I'll explain in a minute).
Distance corruption is calculated to the nearest 2%, with odd number percentages rounded up. So if the corruption is calculated to be 74.8%, it is stored as 74%, while 75.0% is stored as 76%. 95% is left as 95%
though.
Distance from the capitol is calculated rather strangely. It's not quite the geometric distance from the capitol that counts. You follow the route that a unit would take from the capitol to the town of interest (ignoring terrain, water etc.). Each move NE, NW, SE, SW counts a distance of 1, and each move N, S, E, W counts 1.41... (sqrt(2)). So if the most direct route from your captiol to a town is to move 10 squares SE and then 3 S, the total distance would be 14.23 (more or less). This allows something close to the geometric distance to be calculated, without having to do any square root calculations.
And actually, the distance along the diagonals isn't quite sqrt(2), it's a little larger. My best estimate is close to 1.5 (so cities buily on the NE, SW, NW, SE lines from the captiol have slightly lower corruption than you might expect). But there are complications in this that I don't understand fully yet. There may be some rounding off done to the distance before it is multiplied by the scaling factor to give the percentage. And the distances for very distant cities may not be as large as they ought to be. In practice, this only became noticable in for cities where corruption would be 95% in a real game (with optimal number of cities corruption at its normal level).
To calculate final corruption: the distance corruption percentage is multipled by the total gold production of the city to give a value which is not rounded off (30 gold, with 34% corruption, would give 10.2 gold lost to corruption). The number of cities based corruption is added to this, also as an unrounded number, to give the final total lost to corruption (which *is* then rounded to the nearest integer). In my tests, I set the optimal number of cities to 1000, which gave some very small number. E.g. is the distance based corruption gives 10.2 gold lost (as above), and the OCN corruption is 0.25, then the final corruption is 10.45, i.e. 10. If the OCN corruption is 0.35, then the final corruption is 10.55, which becomes 11. In real games, the OCN corruption is going to be higher than the distance corruption in almost all circumstances.
The capitol (or forbidden palace) has corruption of 4% without a courthouse and 2% with a courthouse.
I would tentatively say that being connected to the palace via road, harbour or whatever multiplies the distance corruption factor by 0.8 (although it can still go to 100% in the absence of a courthouse). The OCN corruption is unaffected by connection to the capitol. I got the factor 0.8 by guessing - the limits I had fixed it between 0.796 and 0.823 (I think), so 0.8 seemed the most sensible value. This may change slightly if I ever figure out just how the distance is really calculated.
Cities at the same distance have the same OCN corruption (as though they were all the nearest out of that group). There is some rounding of distances involved here as well, since I had a group if 5 cities all at slightly different distances, and they all showed the same level of OCN corruption.
I think that that's all I've worked out so far. I doubt any of this is going to affect how we play the game in the slightest, but you never know.
Comment