[freeciv-ai] Re: [Freeciv-Dev] Re: (PR#4089) Bug in pf
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 28 Apr 2003, Per I. Mathisen wrote:
> > It works for me... Please supply a savegame.
> Supplied. Apply the diff to see what the problem is. "ttd" means "time to
> destination", and it is this number which is totally dead wrong.
Applied the diff, change it around a bit (to see what number is returned
by find_city_to_diplomat before it's divided by dip->move_rate).
I don't see anything wrong. Yes, the want is a bit high, but it's no
fault of PF, the distances are all correct. The typical printout is
2: noname,Istana: Diplomat is desired with want 1570 (was 100) to spy in
Kabul (incite want 4116, tech theft want 0, dist 18)
And indeed the distance is 18 and time_to_dest (without WAG-corrections)
is 18/move_rate = 3.
The want is high because incite want is high. This is how you calculate
gain_incite = acity->food_prod * FOOD_WEIGHTING
+ acity->shield_prod * SHIELD_WEIGHTING
+ acity->science_total) * TRADE_WEIGHTING;
gain_incite *= SHIELD_WEIGHTING; /* WAG cost to take city otherwise */
gain_incite -= incite_cost;
Well, what else did you expect, you multiply the city stats by
SHIELD_WEIGHTING squared (on average). The stats of this particular city
(Kabul, size 2) were 8/2/5 giving (8*20 + 2*17 + 5*12)*17 = 4182
And incite_cost is not even multiplied by the TRADE_WEIGHTING !! But it's
ridiculously small anyway, 66 in this case. All because the map is huge
and there are cities well away from the capital (this one is 12 away and
has no defenders).
So with this incite_cost it is well worth building diplomats, cities are
dirt cheap. I see no bug.
- [freeciv-ai] Re: [Freeciv-Dev] Re: (PR#4089) Bug in pf,
Gregory Berkolaiko <=