Announcement

Collapse
No announcement yet.

Everything you wanted to know about corruption

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Everything you wanted to know about corruption

    This thread is somewhat difficult to follow if you are not already familiar with the concept of corruption. There is another, more user-friendly, FAQ in the general forum.

    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.

    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]
    Last edited by alexman; September 10, 2003, 18:29.

  • #2
    Great post!

    It might not solve the problem, but at least it's defined.

    I've always thought "waste" is a bigger problem then corruption, so I think it's funny no one ever complains about the "waste problem."

    Yes, they're both covered under corruption here, I know.

    A day without playing Civ3??? Was someone dying or something?

    Comment


    • #3
      Agreed, great post alexman. I have some questions though. Are you sure there was no Corruption decrease for Commercial civs? You were able to discover all these factors, but none for Commercial civs? Where then does the purported Commercial bonus to Corruption apply?


      Dominae
      And her eyes have all the seeming of a demon's that is dreaming...

      Comment


      • #4
        great post.

        i often wondered if the FP had an effect on communism, now i know it doesnt.

        will firaxis confirm there is no commercial civ bonus to corruption?
        "I've lived too long with pain. I won't know who I am without it. We have to leave this place, I am almost happy here."
        - Ender, from Ender's Game by Orson Scott Card

        Comment


        • #5
          Re: Everything you ever wanted to know about corruption

          Originally posted by alexman
          5) I could not find any effect whatsoever of the commercial civ trait on corruption!!!
          Quite bad news . If Firaxis confirm it (I doubt they will) I think I will give up with India to come back to Babs.

          However, it's a great work !
          Nym
          "Der Krieg ist die bloße Fortsetzung der Politik mit anderen Mitteln." (Carl von Clausewitz, Vom Kriege)

          Comment


          • #6
            Interesting post. Nice work too. I've been wondering how it worked precisely & just starting to set up some tests too! Anyway, great stuff.

            Aeson recently did a test showing that corruption by number of cities decreased for a commercial civ. The results were posted here:



            Maybe take a look & see if you agree. I'm not sure what you've done exactly, nor am I sure what Aeson did exactly, so I can't speak for you guys, but anyway...

            I'm also not sure I've seen conflicting reports on the effect of connecting your city to your empire or the corruption reducing buildings' effectiveness, I will double-check.

            Comment


            • #7
              Wow, this is great.

              One point. The commercial bonus kicks in at higher city sizes; it's something like an extra 1 commerce (over non-commercial civs) at size 12. There are a couple of threads on this (Dan posted in one of them), one of which you'll probably find if you search for 'commercial' and 'bonus' etc.

              Comment


              • #8
                Excellent work at the CivLab, alexman! It harkens back to the CivII days and the Great Library in the CivII Strategy forum. It's good to see this sort of work done instead of more whining...
                The first President of the first Apolyton Democracy Game (CivII, that is)

                The gift of speech is given to many,
                intelligence to few.

                Comment


                • #9
                  I have to give a big

                  Comment


                  • #10
                    Wow. I'm sure impressed. Good post.

                    Comment


                    • #11
                      Commercial Civs

                      Yes, for commercial civs, I'm sure that there was no benefit in my tests, and I was not pleased by this at all. Already the fact that all civs get a bonus commerce in cities over size 6 reduces the value of commercial civs a lot. Maybe (even though I think it would be stupid to do it that way) their bonus comes into effect under conditions that I never tested. For example, I never tested commercial civs with a large number of cities. It was much easier to get the number-of-cities corruption results by setting the "optimal number of cities" value in the editor to something very low once I figured out the corruption model for non-commercial civs. I also never had a city population larger than 7. Who knows what Firaxis did, but I think it must be a bug.

                      I had seen Aeson's tests before doing this, and I really can't say why we don't get the same results for commercial civs. I tried to isolate the various causes of corruption as much as I could. For example, to test the effect of distance corruption, I did all my tests with optimal number of cities=1000. Then, once I figured out that aspect of it, I picked a city at a fixed distance from the capital and started adding cities (closer and farther from the capital) to see what number of cities did to their corruption. This part of my test was similar to Aeson's, so we should have gotten similar results. On the other hand, Aeson's tests for commercial and non-commercial civs show different amounts of base commerce (without corruption) for a size 2 city under the same government. Where is the extra commerce coming from?

                      Aeson, (or even Firaxis) what do you think of all this?

                      Comment


                      • #12
                        okay, so corruption is maxed at 95%... BUT the amount of corruption calculated for the city can exceed 100% as evidenced by the fact that cities with a courthouse AND police station very far away from the center of the civ still have a corruption rate of 95%.

                        i generally don't mind an insane level of corruption. i have no problem with 95% at the extreme. but i maintain that the 95% should be adjusted by courthouses and police stations... ALWAYS. there should be a visible effect when building these structures. especially if you are going to rush build one. otherwise in the present model, they are completely worthless structures except for a VERY few cities a reasonable distance from the capital.

                        or maybe it's just me.
                        the shows in my mind are almost always better... The Maxx

                        Comment


                        • #13
                          I think math was a secondary concern for these guys. I would be willing bet money they never even knew that corruption got over 100%. How the hell can you have more than 100% of something like corruption???
                          [c3c] 1.22(f?)
                          For better barbarians, add NoAIPatrol=0 to conquests.ini (see this thread )

                          Comment


                          • #14
                            Thank you, alexman!
                            Interesting and useful work.
                            I have started a study of corruption and waste under communism (willing to publish some results when it will be a bit more complete). One good point: your results don't contradict mine .
                            Aux bords mystérieux du monde occidental

                            Comment


                            • #15
                              Originally posted by watorrey
                              I think math was a secondary concern for these guys. I would be willing bet money they never even knew that corruption got over 100%. How the hell can you have more than 100% of something like corruption???
                              Oh, go keep your *****ing to threads I don't read! In case you guys don't remember, this is the same guy who complained that the hard difficulty levels are too hard.


                              Anyway, after that reprimand, to alexman. Excellent research. Of course, Firaxis could just tell us...
                              "You're the biggest user of hindsight that I've ever known. Your favorite team, in any sport, is the one that just won. If you were a woman, you'd likely be a slut." - Slowwhand, to Imran

                              Eschewing silly games since December 4, 2005

                              Comment

                              Working...
                              X