1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Do you think you understand corruption (pre-C3C)?

Discussion in 'Civ3 Strategy Articles' started by alexman, Apr 9, 2002.

  1. alexman

    alexman Chieftain

    Joined:
    Feb 28, 2002
    Messages:
    778
    Location:
    Maryland, USA
    Moderator Action: Note: This applies to vanilla Civ3 and Play th World.
    Alexman has created a separate thread covering Conquests/C3C corruption here - AlanH


    Well, after spending some time doing some experiments, I think I do.

    I used the editor to make a series of maps (one for each size), that had only plains. I modified plains to give two food, 25 shields, and 25 commerce, and I removed all commerce bonuses from roads. I also modified the governments to never have tile penalties and bonuses, so we can see only the effect of corruption in the governments.

    Here's what I found:

    FIRST SOME GENERAL COMMENTS

    1) Corruption can never exceed 95%, no matter what.

    2) Corruption calculations do not use Euclidean geometry, nor unit movement points, to get distance. Instead, the distance is based on the shortest path, where each orthogonal move costs 1.0 and each diagonal move costs 1.5, and the total is rounded down to the nearest integer. Another way of writing the distance formula is Distance = floor(max(x,y) + 0.5*min(x,y)), where x and y are the distance in the NW/SE and NE/SW respectively. (Formula discovered by DaviddesJ, rounding discovered by Qitai)

    3) Corruption is divided into corruption due to number of cities, and corruption due to distance. These two components are independent.

    4) The following corruption calculations yield a percentage. To get the actual corruption/waste, multiply the percentage/100 by the total number of shields/commerce on tiles being worked, and round to the nearest integer (verified by DaviddesJ).

    5) Factories, marketplaces, et cetera, multiply the city's shields/commerce after corruption. This means that the number of red (lost) shields/commerce remains unchanged in the city view after you add one of those buildings (but the uncorrupted shields/commerce increase). It does not mean, of course, that you actually reduce the corruption percentage when you build these improvements (but it seems like it does, just because the percentage of red shields/commerce out of the total is visually lower compared to before).

    CORRUPTION DUE TO DISTANCE FROM CAPITAL

    The corruption due to distance, depends on these parameters:

    1) Distance factor, Fd
    This is 3.6 times the distance, divided by the map size. The distance here is the minimum between the distance to the capital and the distance to the Forbidden Palace. So for a standard map size (100x100) this factor would be 0.36 for a city 10 tiles away from the capital (when the FP is more than 10 tiles away). For a tiny map (60x60), it would be 0.6. It looks like the capital is taken as a distance 1 tile (not zero) from itself, that's why there is some corruption there. Communism is a special case, because corruption does not depend on distance. For communism replace the distance factor by the value 1.0.

    2) Government factor, Fg
    The distance factor is multiplied by a factor that depends on government. Here are the values:
    Despotism: 1.0
    Monarchy: 2/3
    Republic: 2/3
    Democracy: 4/9
    Communism: 0.3

    3) Improvement factor, Fi
    The above product is multiplied by 0.5 to the power of N, where N is the number of city improvements that reduce corruption (courthouse and police station). If there is a WLTK celebration, increase N by one for shield waste calculation (but not for commerce lost).

    4) Connection factor, Ft
    This is 0.85 if the city is connected to the capital through roads, harbors, or airports. It is equal to 1.0 if not connected.

    CORRUPTION DUE TO NUMBER OF CITIES
    (Seriously edited since first posted)

    The corruption due to number of cities depends on these parameters:

    1) Optimal number of cities, Nopt
    This is an integer number that depends on map size, and is found in the editor.

    2) OCN (Nopt) multiplier, Fn
    This is a factor that multiplies Nopt, and depends on difficulty level, city improvements, government, WLTKD, FP, and the commercial trait.

    Specifically:
    Fn = d*(1 + g + fp + imp*N + c)/100
    where
    d : percentage of optimal cities for this difficulty level (found in editor)
    fp: zero for no FP, otherwise 0.2 for Communism and 0.1 for other governments
    g : 0.1 if Republic or Democracy, 0.2 if in Communism, 0.0 otherwise
    N : the number of improvements (including WLTKD for waste) as for distance corruption
    imp: 0.1 for Communism, 0.25 otherwise
    c : 0.25 for Commercial civs, 0.0 otherwise

    3) Rank of the city, Ncity
    This is equal to the number of cities that are closer to the capital than this city (including the capital). So Ncity is equal to 0 at the capital, 1 at the closest city to the capital, et cetera.

    The above parameters are combined to get corruption due to number of cities, Fc, in this way:

    Code:
              Ncity / (2*Fn*Nopt),         if Ncity <= Fn*Nopt,
    Fc =     
              Ncity / (Fn*Nopt) - 0.5,     if Ncity > Fn*Nopt,
    
    Again, this is different for Communism than it is for the rest of the governments. For communism Fc is 0.1 times the ratio of ALL cities to (Fn*Nopt).

    The FP gets a whole new set of cities where the number-of-cities factor starts at zero. So placing a FP never increases corruption at mid-range cities, even though there are now more cities closer to a center of your empire (capital or FP) than there were before). Edit: Qitai discovered that there is a bug in the rank calculations for cities closer to the Forbidden Palace than the Capital. In short, for such a city, the rank is given by the number of cities that are closer to the Capital than that city is to the Forbidden Palace. :crazyeye:

    So, if you want to write down the formula for corruption, it will be something like this:

    Corruption% = 100 * (Fd*Fg*Fi*Ft + Fc)

    DONE!

    This formula worked for my test cases. It might not be 100% accurate, but it's pretty close. I think most of my discrepancies were rounding errors. But the real value of this analysis is that it gives an insight of how all these parameters affect corruption.

    For example, you can see that difficulty level does not affect corruption due to distance.

    Also, note that Communism continues to deteriorate as you add cities, up to the limit where all its cities are 95% corrupt!!

    You can also see that Monarchy and Republic are exactly the same in terms of distance corruption, but differ in number-of-cities corruption. (Monarchy does not have the commerce bonus, but that's not corruption)

    When you are well over the optimal number of cities, you can see that it makes no difference if you add a courthouse to a city at the outskirts of your empire, because the corruption due to number of cities can go over 100%. Even if you somehow manage to reduce the distance corruption to by adding buildings, WLTK, and Democracy, if the corruption due to number of cities is over 100% (i.e. you have 1.5 times the modified optimal number), you will have a maxed out corruption (95%) in that city anyway.

    The above formula is implemented in a corruption calculator

    [Edit: updated for PTW]
    [Edit: updated for Nor Me's results]
    [Edit: updated for DaviddesJ distance formula]
    [Edit: updated for DaviddesJ rounding]
    [Edit: updated for Qitai distance rounding]
    [Edit: updated for Qitai's FP rank bug discovery]
     
  2. BillChin

    BillChin Chieftain

    Joined:
    Jan 7, 2002
    Messages:
    494
    Good to know.

    The bit I quoted may be why so many players are frustrated with the current corruption model and why a handful think it is fine and dandy. Players that build large empires and exceed the number of optimal cities have no way to solve the problem. Players that limit the number of cities wonder what the problem is.

    The change I want to see is a minimal level of effectiveness for courthouses and police stations. This change could be done in such as way that it has little effect on game balance while reducing the frustration level of players.

    Another fix, requires more coding. It is a Civil Engineer specialist that produces one shield immune from corruption. Limit to three Engineers per city. This restriction lets players build a few minor improvements in outlying cities (four shields in a city with 3 Engineers) without giving them enough shields to effectively produce military units.

    Thanks again for your thorough analysis.
     
  3. Sir Yelof

    Sir Yelof Chief Gaming Officer

    Joined:
    Feb 15, 2002
    Messages:
    62
    Excellent analysis.

    One thing that I have noticed, anecdotally speaking, is that certain outskirt cities tend to get slightly better as time goes on. I haven't made the time to investigate this with any controlled experiment (I'd rather spend the time playing!) but it's a potential factor that was not covered in your initial efforts.

    I figure that one of several possibilities is the case:
    - Corruption gets better in a city after several turns under your control.
    - Corruption is positively affected by increased culture.
    - Corruption has no time dependency, and the effects I've seen are a result of connecting cities, losing cities to conquerors, changing governments, or any one of a myriad other factors that I lose track of while playing a game that cause that outskirt city's shield production to rise from 1 to 2 or 3.

    Okay, that last one's the most likely. :D But thought I'd check to see if anyone thinks the other two have merit.
    --Yelof
     
  4. Bamspeedy

    Bamspeedy We'll dig up the road!

    Joined:
    Dec 18, 2001
    Messages:
    7,643
    Location:
    Amish Country, Wisconsin, USA
    Quote:

    I figure that one of several possibilities is the case:
    - Corruption gets better in a city after several turns under your control.
    - Corruption is positively affected by increased culture.
    - Corruption has no time dependency, and the effects I've seen are a result of connecting cities, losing cities to conquerors, changing governments, or any one of a myriad other factors that I lose track of while playing a game that cause that outskirt city's shield production to rise from 1 to 2 or 3.

    The last one is more correct. The reason many people see a far flung city going from 1 unwasted shield to 2 is most often due to pure city growth. After building a courthouse you look at a city and it produces 1 out of 5 possible shields. Later on (after the city has grown more and land has been developed), you see that it is now producing 2 shields, but out of a possible 10. So it is still 80% waste. I did a corruption study and I built a courthouse in a far flung city (It had 40%+ waste), 100 turns later the city showed the same results as when I had freshly built the courthouse. Also, like Alexman pointed out about the improvements and money/beakers, is that those improvements only multiply the uncorrupted gold or beakers, so it may appear corruption got better after the improvements, but in reality the lost gold/beakers stayed the same. This is not the case with factories, you get more wasted shields with factories, too, but the % of waste stays the same.
     
  5. alexman

    alexman Chieftain

    Joined:
    Feb 28, 2002
    Messages:
    778
    Location:
    Maryland, USA
    Thanks for that info, Bamspeedy! :goodjob: I wrongly assumed shield improvements work like commerce improvements...
     
  6. alexman

    alexman Chieftain

    Joined:
    Feb 28, 2002
    Messages:
    778
    Location:
    Maryland, USA
    After some additional testing, I revised the formula for corruption due to number of cities, and updated the initial post.

    It turns out that the commercial trait is equivalent to increasing the optimal number of cities by one.

    It also turns out that after the optimal number of cities, the corruption due to number of cities increases at twice the rate as it does before that.
     
  7. chiefpaco

    chiefpaco Chieftain

    Joined:
    Dec 26, 2001
    Messages:
    1,381
    Location:
    Fanatika - Where did everybody go?
    Over in other boards, I see you mention that factories' improvement is subject to corruption. I have tested this & have cases to show otherwise. i.e. their behaviour is similar to marketplaces & banks: multiplying the productive shields, not the total.

    Another note, thanks to Grey Fox for noticing this first, a city with production over 20 (i.e. 21 and above) gets a 2nd shield no matter what. I'm not sure if that's a product accounted for by your formula, but it is behaviour we've witnessed.

    As an example for my 2 statements, a distant city with 20 shields total, has 19 wasted & 1 productive. If I optimize my workers and get another shield, I get 19 wasted and 2 productive. If I then add a factory, I get 19 wasted and 3 productive.
     
  8. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    This is true, I have many (4-5) distant cities with two Production. The thing is to get the total production above 20. Then you will get 2 Shields (Not always though, chiefpaco reported one case when this was not true).

    This can help at times. If you have a 12 Size city that cannot grow (Because you need a Hospital), set as many citizens you can to work mined hills and mountains. This works best when the land is Railroaded, as one grassland tile can support two Citizens.

    Happy tweaking!
     
  9. Beard Rinker

    Beard Rinker Chieftain

    Joined:
    Jan 7, 2002
    Messages:
    180
    Location:
    Victoria BC, Canada
    This is great stuff Alexman, it really clears things up.

    Alexman's first comment about corruption is it can never exceed 95%. This is consistent with what you noticed.

    I ran some numbers through the corruption due to the number of cities formula and found that the number of optimal cities means exactly that. Once you exceed that number, the production and gold lost in all cities cannot be made up by the new city. Before the optimal number, a new city's production and gold can overcome the empire wide penalties of having 1 more city.
     
  10. Grey Fox

    Grey Fox Master of Points

    Joined:
    Dec 19, 2001
    Messages:
    8,726
    Gender:
    Male
    Location:
    Sweden
    Well he never said "Waste". Waste is NOT the same thing as Corruption.

    Waste is loss of shields, and Corruption is loss of Gold.
     
  11. Beard Rinker

    Beard Rinker Chieftain

    Joined:
    Jan 7, 2002
    Messages:
    180
    Location:
    Victoria BC, Canada
    Yes you're right.

    This does imply that the 95% rule applies to waste too.
     
  12. homegrown

    homegrown Missionary of Sorenism

    Joined:
    Jan 5, 2002
    Messages:
    203
    Location:
    Houston TX
    Excellent post.

    Homegrown
    Flogging will continue until morale improves.
    Now playing: Pharaoh | Zeus |Civ III | Sim Golf | Zoo Tycoon

    Are you ready to take the challenge?
    Monthly contests for many of your favorite games.
     
  13. royfurr

    royfurr "Klotzen, nicht Kleckern"

    Joined:
    Nov 21, 2001
    Messages:
    368
    Location:
    USA
    Terrific work, alexman.

    I agree both 100%, and Wholeheartedly, with BillChin. As he has suggested before, having a Specialist that generates a sheild rather that a beaker or tax gold, but with a limit per city of say 3 or so, would alleviate many players frustration due to the endless fields of 1 shield cities on foreign contintents. And it could work without upsetting the Puritans (ie Firaxis's) applecart re: limiting the players advantage over the AI (which ultimately, is what defeating ICS and players tactics is all about). Still, I'd go a little further and beg them to lighten up true corruption (money loss, not shields or waste) as well. At least a little bit. Of course, in a sense this is already done- you can use Taxmen. This, for me, is just additional evidence that the Shield specialist is a Needed Addition to the game.

    Good idea, naming it the Civil Engineer, BillChin!! But, prehaps another name more apropos would be Geologist. After all, geologists help locate and find mineral resources, ie shields. Another possibility might just be "Miner".

    But, getting back OT regarding coruption (OPPS, Excuse me, WASTE), there is still one thing about it I definitely KNOW: It is so frustrating, the way it is done, that it is, for me (and I bet MANY other people), the single most irratating, depressing, plain loss of fun feature, in the game.

    Here's hoping Firaxis introduces Shield specialists to help reduce Waste. Here's hoping they at least mitigate corruption a little, but I'd be happy to at least get the former.

    And heres hoping eyrei doesn't blast this thread with demands that corruptiion AND waste be INCREASED. After all, it is good for you. (hehe eyrei, please be gentle ...)


    AHHHHHHHHHHH!!!! AIIIEEEEE!!!!!!!!!!!


    Splat.
     
  14. SirPleb

    SirPleb Shaken, not stirred.

    Joined:
    Jan 1, 2002
    Messages:
    1,415
    Location:
    Nanaimo BC Canada
    Wow, awesome analysis alexman!
     
  15. majorlee

    majorlee Chieftain

    Joined:
    Jan 27, 2001
    Messages:
    19
    Location:
    Franklin, OH
    Thanks a million times over for your efforts in doing this analysis, Alexman.

    In a later post from your original you state that Commercial trait effectively increases the optimal cities by one. To clarify for my thick brain do you mean that it simply allows those civs to build one additional city before the killer corruption for exceeding the optimal value is triggered...or do you mean that in the calculation one is added to the value created for the number of city style corruption?

    Thanks again...
     
  16. Mr Adeoye

    Mr Adeoye Chieftain

    Joined:
    Mar 26, 2002
    Messages:
    26
    Location:
    England
    this is quite helpful i must admit although there still a few unanswered questions about this very complicated topic of corruption.
     
  17. chiefpaco

    chiefpaco Chieftain

    Joined:
    Dec 26, 2001
    Messages:
    1,381
    Location:
    Fanatika - Where did everybody go?
    I think it's up there in the original post. He stated that it Nopt +=1 for commercial civs. But I'm not alexman, so I can only try to interperet what's there too.
     
  18. CivAl

    CivAl Chieftain

    Joined:
    Jan 1, 2002
    Messages:
    48
    Alexman, if Republic and Monarchy have the same corruption why is one labelled "problematic" and the other "nuisance"?
     
  19. funkymunky

    funkymunky Chieftain

    Joined:
    Dec 14, 2001
    Messages:
    102
    Location:
    Louisville, KY
    I think the study is a very good one. It gives me a better idea of what new strategies I should try. Though personally, I feel that having a road connected to the capital ought to reduce the corruption of a city alot more than 15%. Actually, I would figure that if you're city had airports and seaports that corruption should be even lower, as there is more contact with the main empire. At least that way, it would encourage development while still allowing people to expand their empires.
     
  20. alexman

    alexman Chieftain

    Joined:
    Feb 28, 2002
    Messages:
    778
    Location:
    Maryland, USA
    majorlee: as chiefpaco said, the commercial trait is equivalent to increasing the optimal number of cities by one, after modification for difficulty level. (So the commercial trait is a bit more valuable at higher difficulty levels)

    Mr. Adeoye: What aspects of corruption are still not clear to you?

    CivAI: In my original tests, governments with corruption labeled "problematic" and "nuisance" were identical. Since then, I have seen cases (namely a study by Aeson) where corruption in Monarchy and Republic differ, albeit only by a couple percent. It's possible that I have missed something. The formula is not 100% accurate - it's only meant as a way to see the ways in which various parameters affect corruption. Still, I have yet to see a case where the formula is off by more than a couple percent.

    To All: Thanks for all your positive comments.
     

Share This Page