Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [Patch] Cleanup of tile_move_cost_ai
Home

[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]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] Cleanup of tile_move_cost_ai
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 7 Oct 2001 18:19:47 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

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."


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