[Freeciv-Dev] Re: [Patch] Cleanup of tile_move_cost_ai
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, Oct 07, 2001 at 03:08:39PM +0100, Gregory Berkolaiko wrote:
> --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > I thought about using the move_cost field of struct tile for the goto
> > agent. However I had hard time to understand tile_move_cost_ai and the
> > (to me mysterious) -3. The attached patch should allow others not the
> > fall into this.
>
> The attached patch shows that you understood it correctly.
> The meaning (my guess) of -3 was
> 1. Minus sign to distinguish from land moving
> 2. 3 == SINGLE_MOVE for sea units
>
> However you and Raahul are right, property (2) is never used.
>
> While you are hacking into tile_move_cost_ai, maybe you can think about
> the following:
> separate move_cost into sea_move_cost and land_move_cost with the
> following properties:
>
> land_move_cost is
> 1. the same as move_cost between two land tiles,
> 2. MAXCOST between two ocean tiles and land -> sea
> 3. landing cost for sea -> land
>
> sea_move_cost is
> 1. SINGLE_MOVE for all allowed moves (sea <-> sea and sea <-> city)
> 2. MAXCOST for the rest.
>
> This would speed up the warmap generation a fair bit and will be
> generally easier to comprehend.
>
> I am planning to do it myself some time but it is hard to me to judge the
> impact of the change to the code outside goto stuff.
No. I won't do this. I now know that I can't use the move_cost field
of the tile struct for the goto agent and I won't touch
tile_move_cost_ai again.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Heuer's Law: Any feature is a bug unless it can be turned off."
|
|