Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2003:
[freeciv-ai] Re: [Freeciv-Dev] Re: (PR#4089) Bug in pf

[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]
To: per@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] Re: (PR#4089) Bug in pf
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Wed, 30 Apr 2003 02:20:46 -0700
Reply-to: rt@xxxxxxxxxxxxxx

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->luxury_total
                    + acity->tax_total
                    + 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.


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