Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] Re: Corruption Handling - Possible bug?
Home

[Freeciv-Dev] Re: Corruption Handling - Possible bug?

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Davide Pagnin <nightmare@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Corruption Handling - Possible bug?
From: Tony Stuckey <stuckey@xxxxxxxxxxxxxxxxx>
Date: Sun, 9 Jun 2002 11:18:33 -0500

On Sat, Jun 08, 2002 at 06:51:50PM +0200, Davide Pagnin wrote:
> What I want to point out is that, corruption handling is rather
> counterintuitive, and above all, the government parameters have effects
> that are not easy understandable.
> 
> Now to the points:
> 
> 1. How fixed_corruption_distance, corruption_distance_factor and
> extra_corruption_factor are supposed to work?

        fixed_corruption_distance is the Communism effect.  "Corruption is
equal and low across the entire faction".
        CDF is set to 0-2 in governments.ruleset, and ECF is set to 0-3.
CDF would be a scale factor for how fast corruption should increase as you
get further out, and ECF would be a step offset at distance 1, as well as a
small extension to max_distance as you noted.

> At the moment, effects of corruption_distance_factor and
> extra_corruption_factor, are applied after the distance calculation,
> thus they are applied even if fixed_corruption_distance is set.
> This seems to me, rather counterintuitive.

        Agreed.

> And more, it is clear, reading the code, that 36 is the maximum fixed
> distance, BUT, extra_corruption_factor and corruption_distance_factor,
> are applied AFTER distance calculation, thus it they are different from
> zero, the real maximum distance may be different from 36.

        Correct.

> Obviously, the hard-coded 36 is a bad thing and would be very nice to
> have it as a parameter in game.ruleset.

        Yes, hard coded limits should be replaced with either #defines or
some other mechanism.  IMHO, Corruption distance should be map size
dependent.  36 is somewhere close to the max for CivII (32?).

> Mine proposal, is to have extra_corruption_factor and
> corruption_distance_factor, apply only in the case fixed_distance_factor
> is not set, and moreover, to apply them BEFORE the capping of the 36
> maximum factor, and if this factor became a game variable, we can call
> it maximum_corruption_distance_factor, without confusion.

        All good points, IMHO.

> 2. This is another matter, related to corruption, but less disputable
> IMHO. Reading manual, Courthouse effect is to half the corruption in a
> city. When the corruption is low, the actual code is behaves correctly,
> but when corruption is set to a greater degree and the city is distance
> from the capital is big, strange things may happen.
> Imagine a city with output of 10 arrows, all of them taken from
> corruption. I expect that after having built the courthouse, total
> corruption is reduced to 5, but this is not the case if val is MORE than
> total trade in the city, as can be easily seen reading the code.
> Thus, my proposal is to put an if before courthouse effect, for capping
> the val value. (if (val>trade) val=trade;)

        This would be a real bug.
-- 
Anthony J. Stuckey                              stuckey@xxxxxxxxxxxxxxxxx

'Finally, the Navy stated that [...] "However, use of the area as a live
fire range has the beneficial effect of reducing the negative impacts of
human intrusion."' - Center For Biological Diversity v Pirie and Rumsfeld


[Prev in Thread] Current Thread [Next in Thread]