[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 >
>
> This patch replaces the "Trade_revenue_reduce" tech flag with proper effect.
> -
> - /* Check for technologies that reduce trade revenues. */
> - for (i = 0; i < num_known_tech_with_flag(city_owner(pc1),
> - TF_TRADE_REVENUE_REDUCE); i++) {
> - tb = (tb * 2) / 3;
> - }
> +
> + /* Trade_revenue_bonus increases revenue by 18.9% (pow(1.189, 4) ~= 2.0) */
> + bonus = get_city_bonus(pc1, EFT_TRADE_REVENUE_BONUS);
> +
> + tb = (float)tb * pow(1.189, bonus);
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).
As a separate question, is this really a good feature? Should we
consider removing this from the rulesets? Why does trade drop by
discrete increments when a tech is discovered that logically should
*increase* trade?
-jason
- [Freeciv-Dev] Re: (PR#14170) Replace "Trade_revenue_reduce" tech flag with proper effect,
Jason Short <=
|
|