Hi everyone. excellent work alexman. How did come up with this formula? Must have been a lot of work. Anyway, I checked it in my current game and it consistently gives me more corruption than there actually is. Here's an example:
I'm republic, marla's huge map (size 254x204, I took 254 for my calculations), optimal number of ciites =32, the difficulty factor (deity) is 0.69 so my final Nopt=22. I have a forbidden Palace in the middle of the United States and my capital is far in Europe. Let's look at the 8'th farthest city (from the forb palace). The city is connected and its actual distance is 6 tiles south-east and 3 tiles south-west. This gives a distance of sqrt(6^2+3^2)=6.71 (right?). I've sold everything in the city (and the city is not in WLTKD). So, your formula says the corruption should be
0.85( 3.6*6.71*(2/3)/254 + 8/(22*2) )= 20.8%
So, out of 28 shields and 54 commerce from terrain, I should lose 6 shields and 11 commerce. However, I only lose 5 shields and 9 commerce.
Now if I leave a courthouse in the city. The fomula gives 18.1% of corruption. So, I should be losing 5 shields and 10 commerce. However, I'm only losing 4 shields and 7 commerce (in other words, the formula is off by 3 commerce).
So, I did the same calculation for 17 cities and in almost every case, the formula is off, but never by much. So the formula works well but (if my calculations correspond to what you had in mind) is not perfect (yes I know you said that). So I thought eh, why not try to improve it. Here's where it gets interesting.
Basically, your formula says that for a fixed map, fixed government, for cities with no improvement, cities not in WLTKD, connected to the network and having a rank less than Nopt, you should get
A*distance+B*rank
corruption, where A=0.85*3.6*(2/3)/254 and B=0.85/44 (in my case). What I tried was to input my 17 sets of data and try to find constants A and B which would work better. To my great surprise, no pair of constants work! In other words, if I take any numbers A, B between 0 and 3, take A*dist+B*rank as the corruption formula and calculate the difference between the predicted corruptions and the actual ones, there is always a difference (over all the cities, with waste and corruption, I get a total over 19).
I'm not sure if I'm clear (or helpful) but it seems like there is another term in the formula (time maybe?). I have no idea. Anyway, I'll definitely work on this a lot more after my exam... Sorry for not giving an answer and criticizing like this. Overall, the formula works quite well, it's off in about half the cases and even when it is off, it's usually by one or two (shields or commerce) so that's very good. I just wish we had the perfect formula.
I'm republic, marla's huge map (size 254x204, I took 254 for my calculations), optimal number of ciites =32, the difficulty factor (deity) is 0.69 so my final Nopt=22. I have a forbidden Palace in the middle of the United States and my capital is far in Europe. Let's look at the 8'th farthest city (from the forb palace). The city is connected and its actual distance is 6 tiles south-east and 3 tiles south-west. This gives a distance of sqrt(6^2+3^2)=6.71 (right?). I've sold everything in the city (and the city is not in WLTKD). So, your formula says the corruption should be
0.85( 3.6*6.71*(2/3)/254 + 8/(22*2) )= 20.8%
So, out of 28 shields and 54 commerce from terrain, I should lose 6 shields and 11 commerce. However, I only lose 5 shields and 9 commerce.
Now if I leave a courthouse in the city. The fomula gives 18.1% of corruption. So, I should be losing 5 shields and 10 commerce. However, I'm only losing 4 shields and 7 commerce (in other words, the formula is off by 3 commerce).
So, I did the same calculation for 17 cities and in almost every case, the formula is off, but never by much. So the formula works well but (if my calculations correspond to what you had in mind) is not perfect (yes I know you said that). So I thought eh, why not try to improve it. Here's where it gets interesting.
Basically, your formula says that for a fixed map, fixed government, for cities with no improvement, cities not in WLTKD, connected to the network and having a rank less than Nopt, you should get
A*distance+B*rank
corruption, where A=0.85*3.6*(2/3)/254 and B=0.85/44 (in my case). What I tried was to input my 17 sets of data and try to find constants A and B which would work better. To my great surprise, no pair of constants work! In other words, if I take any numbers A, B between 0 and 3, take A*dist+B*rank as the corruption formula and calculate the difference between the predicted corruptions and the actual ones, there is always a difference (over all the cities, with waste and corruption, I get a total over 19).
I'm not sure if I'm clear (or helpful) but it seems like there is another term in the formula (time maybe?). I have no idea. Anyway, I'll definitely work on this a lot more after my exam... Sorry for not giving an answer and criticizing like this. Overall, the formula works quite well, it's off in about half the cases and even when it is off, it's usually by one or two (shields or commerce) so that's very good. I just wish we had the perfect formula.