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

-friend alexman or anyone else pls do write a few details of how we can use correctly the corruption calculator ...thanx indeed
-especially how we enter the values in distances!:confused:
 
I'm not going to write a manual for such a simple program, but I would be glad to answer any specific questions. :)

To enter the distance, just count the tiles from the city in question to the capital (or to the FP, whichever is closer). The two numbers you enter are the components of the distance in the orthogonal directions Northwest-to-Southeast and Northeast-to-Southwest.

I recently updated the calculator to use DavidesJ's distance formula.
 
alexman,

I should have posted here before since this thread taught me loads about corruption, I guess I am just a little lazy. :blush:

Thanks also goes to DavidesJ for his distance calculation. I guess the distance formula is the same for all Civ matters, and so I have updated my FlipCalc accordingly too.

Thanks guys! :thumbsup:
 
Originally posted by anarres
Thanks also goes to DavidesJ for his distance calculation. I guess the distance formula is the same for all Civ matters, and so I have updated my FlipCalc accordingly too.

I'm not sure this is true. For example, the number of your cities within a distance of 8 affect the choice of new capital when you lose your capital, but the "distance" used for that purpose is different than the distance used for corruption.

I'm not even absolutely sure that the distance used for number-of-cities corruption is the same as the distance used for distance-to-capital corruption. Although that seems likely, because I've never noticed two cities in the same ring having different corruption levels, even by a tiny amount.

I think different people implemented different parts of the Civ3 code, and they each used their own methodology, so there may not be much internal consistency.

Still, I agree that the corruption distance is probably the "best guess" for how to compute distance for flips. Perhaps it would be possible to set up some test games and test this hypothesis, but it would be quite a bit of work.
 
A detail about corruption that's not mentioned in the main article of this thread is how rounding works. It seems to be this: once the corruption percentage is computed, then multiply it by the shields/turn to compute waste, and round to the nearest integer.

E.g., if corruption is 10%, then there will be no waste if you produce 1-4 shields, 1 waste if you produce 5-14 shields, 2 waste if you produce 15-24 shields, etc. Thus, if you're producing 4 shields then adding a 5th gives you no benefit.
I call these values (at which adding another shield gives no benefit) breakpoints: 4, 14, 24, etc., in this example.

Notice that it's usually a long way from the 1st breakpoint to the 2nd breakpoint, if corruption is low, but after that they are evenly spaced.

P.S. This calculation seems very close, but not 100% exact. It gives about 98% correct results, but occasionally the corruption percentage appears to be 1-2% different from what's calculated using the formulas in this thread. I'm not sure what accounts for that.
 
DaviddesJ,

I am going to set up some tests when I have time, although they will not be totally trivial to perform.

Until then I think is likely that distance to capital or FP is more likely to be the same as the distance used in corruption calcs, and I agree, it is likely that city rank is the same too.

I will let you know either way when I do the tests. :)
 
Originally posted by DaviddesJ
...once the corruption percentage is computed, then multiply it by the shields/turn to compute waste, and round to the nearest integer.

Thanks for verifying that. I suspected that actual corruption was calculated that way, but most of my initial tests involved cities with 100 uncorrupted shields, so I never got to see for sure which way the rounding went. I'll update the initial post. :goodjob:
 
Originally posted by DaviddesJ
I've discovered a correction to the corruption formula posted by alexman.

Distance to the palace or forbidden palace is not computed using Euclidean distance (square roots). Instead, the distance is based on the shortest path, where each orthogonal move costs 1.0 and each diagonal move costs 1.5.

I discovered this because the corruption for a test city at distance (4,3) is not exactly the same as the corruption for a test city at distance (5,0). However, a test city at distance (4,3) has exactly the same corruption as a test city at distance (5,1).

Another way of writing the formula is

Distance = max(x,y) + 0.5*min(x,y)

where x and y are the distance in the NW/SE and NE/SW directions, respectively.

Daviddesj,

Bang-on! :goodjob:

However, it got me thinking: In-Game, all locations are measured in an (X,Y) co-ordinate system. Surely there must be some easy formula to relate the distance between (X1,Y1) & (X2,Y2).

In Civ II, the map locations were given to you in-game when you clicked on a square, and people had spent a lot of time analysing the resutls for such things as trade deliveries. On a hunch, I tried the Civ II formula, and the numbers agree with you observations.

The link that I stole the formula from is here, but the basic formula is as follows:

Stolen from a post by Samson @ 'poly
Distance = (Xdistance + Ydistance)/2 + ( | Xdistance - Ydistance | )/4

If the coordinates of point A are (Xa, Ya) and the coordinates of point B are (Xb, Yb), then the absolute difference between Y coordinates is:

Ydistance = |Ya - Yb|.

Or, in other words, simply subtract the smaller Y value from the larger one.
On a FLAT map, the Xdistance value is found the same way:

Xdistance = |Xa - Xb|.

On a ROUND map, however, there will be two values which express the horizontal distance between two points: |Xa - Xb| and (C - |Xa - Xb|) where C is the circumference of the map. These values represent the X distances between the two points obtained by traveling East or West respectively. The Xdistance value used in calculating Civ2 distances is the smaller of these two numbers. Thus:

Xdistance = SmallerOf( |Xa - Xb| , (C - |Xa - Xb|) )

This calculation is easier to do in practice than it is to formally describe.
For example, given two points A(23, 71) and B( 84, 12) on a medium map (50 x 80),
where the circumference is 100:

Ydistance = 71 - 12 = 59.
Xdistance = SmallerOf( 84 - 23 , 100 - (84-23) = SmallerOf( 61, 39) = 39
Distance = (39 + 59)/2 + (|39 - 59|)/4 = 98/2 + 20/4 = 49 + 5 = 54

The important thing to note is that a move NW decreases both X & Y by 1, and a move SE increases both by 1.

A move NE increases X by 1 and decreases Y by 1.
A move SW decreases X by 1, and increases Y by 1.


The easy way to remember this: X increases with any move towards the right; Y increases with any move down. :)
 
Thanks for digging that up. It's nice to know how Civ2 worked, but in Civ3 that distance formula is clearly not in agreement with what DaviddesJ has found.

Take x greater than y.

Then DaviddesJ's formula gives:
Distance = x + y/2

And Samson's formula for civ2 gives:
Distance = (x+y)/2 + (x-y)/4 = 3x/4 + y/4

These two are clearly not the same for all x > y

As for that round map business, it is already implied in DaviddesJ's formula by the way he defines x and y.
 
That's because Daviddesj's X & Y are not the Samson / Civ internal X & Y.

Daviddesj's X & Y are the number of squares moved in a given direction; the Civ one is a location reference.

Eg:

Consider a move 3 squares SE and 1 square NE. Daviddesj's formula gives the distance = (Max(3,1) + 0.5 * Min(3,1)) = 3.5.

For the Samson formula, assume you start at (X,Y) = (0,0). This move would take you to (4,2).

Y Distance = (2-0) = 2
X Distance = min(4 and 100-4) = 4

Thus distance = (4 + 2) / 2 + abs(4-2)/4
= 3 + 0.5 = 3.5
 
Sure, the formulas are equivalent. Maybe I shouldn't have used "X" and "Y" as the variables, when I described the calculation. (I wasn't aware that the game uses them internally in a different way. Are X and Y ever displayed in the game, or only stored internally?)

Anyway, the most useful thing to remember is the underlying explanation of how to determine the distance: take the shortest path, where NW/NE/SW/SE moves count 1.0 and N/E/S/W moves count 1.5. Both formulas are both just different ways of expressing that rule mathematically.
 
Originally posted by DaviddesJ
Sure, the formulas are equivalent. Maybe I shouldn't have used "X" and "Y" as the variables, when I described the calculation. (I wasn't aware that the game uses them internally in a different way. Are X and Y ever displayed in the game, or only stored internally?)

They are used extensively internally. However, the only real way to see them (easily) is via the editor. Open the editor, move the mouse around the screen and you will see the x,y locations. :)
 
Originally posted by ainwood
They are used extensively internally. However, the only real way to see them (easily) is via the editor. Open the editor, move the mouse around the screen and you will see the x,y locations. :)
You can also show them in the editor via the View->Grid Coordinates menu item (or Ctrl+Shift+G for you keyboard freaks:)).
 
Oops, my bad. I didn't realize how the civ coordinate system was set up. I was assuming it was aligned with the NE/SW, NW/SE directions.
 
Hi, in the latter stages of the game when I have loads of cities spread over a large area, I move my capital city around gradually. This kills corruption in the cities nearby and corruption doesnt seem to increase that much in the cities that used to be around the capital, maybe because they have become large with extensive improvements.
 
Well, of course the courthouses would reduce corruption, but the libraries/marketplaces would also make it 'appear' that you have better corruption, because those improvements are multiplying the uncorrupted gold. So when you moved the palace all those cities will get a little more corruption (and the increased corruption doesn't get multiplied by the buildings, so you really are losing more commerce).

Yes, moving the palace around may help you build up areas faster, so your complete civ gets built up with all the improvements (eventually). But most times it just is not worth the shields/time to keep moving the palace several times. You don't need every one of your cities in the world to have all the improvements to win the game. Just 2 solid good cores (palace/forbidden palace) is all you need.
 
Originally posted by Bamspeedy
Yes, moving the palace around may help you build up areas faster, so your complete civ gets built up with all the improvements (eventually). But most times it just is not worth the shields/time to keep moving the palace several times.
Another way, unless your empire is excessively large, is to change governments to Communism while you build your Courthouses/Police Stations, then change back to your preferred government when they are built. Obviously this works best on a Religious Civ, but it would probably be preferable to moving the Palace around for a non-religious civ.
 
ACtually when I get two leaders per turn and use them to build Tanks or Modern Armor I would move the Palace around to build those marketplaces sooner. I would actually lose some money with this move but it would be OK for milking purposes
 
By the time I'm building marketplaces in all those high-corrupt cities, I have all of that area irrigated, so having those cities produce just a few more shields isn't worth all the increased corruption from your core cities that already have marketplace/bank/etc.

Dianthus, that may work with some play styles. But when you have 400+ cities, the best city in communism produces only about 6 shields/turn no matter how big it is, or how heavy it is mined.
 
Originally posted by Bamspeedy
Dianthus, that may work with some play styles. But when you have 400+ cities, the best city in communism produces only about 6 shields/turn no matter how big it is, or how heavy it is mined.
Hence my "unless your empire is excessively large" at the start of the post :)
 
Top Bottom