Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] Re: (PR#10125) Pollu_Prod_Pct
Home

[Freeciv-Dev] Re: (PR#10125) Pollu_Prod_Pct

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10125) Pollu_Prod_Pct
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Sep 2004 10:20:49 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10125 >

Per I. Mathisen wrote:

> I still do not understand
>   1) why its name contains PCT (percent) even though it does not use
> a percentage value

Obviously an error.

>   2) why this strange way of calculating pollution is used
> 
> Could it not be easier solved by using a percentage value? Pollution is
> reduced by the given percentage value. For recycling center, pollution is
> increased by 66% but reduced by 50% if you have a nuclear plant or a hydro
> plant. This is possible using existing effects:
> 
> effect         =
>     { "name", "range", "value", "req_type", "req"
>       "Pollud_Prod_Pct", "Player", 66
>       "Pollud_Prod_Pct", "Player", -50, "Nuclear Plant"
>       "Pollud_Prod_Pct", "Player", -50, "Hydro Plant"
>     }

You're talking about two different things here:

1.  Removing the janitors group.  Vasco and I talked about the necessity 
of having groups.  It is possible to do it without them but takes 
exponentially more effects (and thus, exponentially more time to iterate 
over the effects).  In the above case things look okay for recycling 
plant, but what are your effects for nuclear plant, hydro plant, and 
hoover dam?  What happens if you have both nuclear plant, hoover dam, 
and recycling center at the same time?  It's just not worth the effort 
to figure this out when groups solve it already.

(Replacing a group of size n with effects directly requires 2^n 
additional effects.  This may be simplified in the above cases since 
some buildings may not be able to exist at the same time.)

2.  Replacing the multiplier by a percentage.

The problem with this is that negative percentages do very poorly when 
added.  In the current ruleset this isn't a problem because no two such 
effects can ever be active at the same time.  But imagine if you had two 
-66% effects active at the same time.  What should the result be?

If the issue is that you want a nice round divisible-by-100 number then 
we can make these values into percentages.  The value "3" becomes 300% 
and the value 2 becomes 200%.  But we still need to do it by dividing, 
not adding.

This is ugly and it prevents having effects that increase pollution. 
But until we allow effects to be applied in series rather than in 
parallel, I don't see a way around it.

jason




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