[Freeciv-Dev] Re: (PR#14170) Replace "Trade_revenue_reduce" tech flag wi
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=14170 >
Mateusz Stefek wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=14170 >
>
>>[jdorje - Mon Oct 03 17:00:27 2005]:
>
>
>>This should definitely be an effect. But where do you get 1.189? The
>>fourth root of 2? But why isn't this just 2/3 (or 1.5 if you want to
>>invert it)? If you want to change the logic around, change it to be
>>simpler: a power of 2, in centimes (so a value of -100 means cutting
>>the
>>trade in half).
>>
>> tb = (double)tb * pow(2, (double)bonus / 100.0);
>>
>>then for the current case where each cuts it by 33% you'd want -58 I
>>think (log2(2/3) = log(2/3) / log(2) ~= -0.5849).
>
> OK.
Patch looks fine. I *think* the math is correct and -58 corresponds to
the current -33% penalty, but there should be a comment added in the
rulesets to this effect. Another thing you might consider is if
centimes are accurate enough or if millimes (?) are needed (so it would
be -585). Somewhere there will be a rounding error and someone will get
confused.
-jason
|
|