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: rf13@xxxxxxxxxxxxxxxxxxxxxx, freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] Cleanup of tile_move_cost_ai
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Sun, 7 Oct 2001 15:08:39 +0100 (BST)

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

Best,
G.

> 
> It doesn't change any behavior. Well at least I hope so ;)
> 
>       Raimar


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie


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