Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)
Home

[Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 3 Dec 2001 17:09:18 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Dec 03, 2001 at 02:26:55PM +0000, Gregory Berkolaiko wrote:
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: >
> On Sun, Dec 02, 2001 at 07:24:08PM +0000, Gregory Berkolaiko wrote:
> > > Function like assess_danger(city) will search through _all_ enemy
> > units
> > > and calculate whether they endanger the city.  For this it needs an
> > array
> > > with distances to the city by both land and sea.  This is why both
> > costs
> > > are needed sometimes.
> > > 
> > 
> > > You cannot record them in one array since the distance from A to B
> > can be
> > > different depending on whether you swim or walk.
> > 
> > But the enemy unit can either swim or walk. So you make the decision
> > while you generate the warmap.
> 
> I am sorry if I did not make myself clear.

> The function works as follows:
> 1. It finds the distances from the city to surrounding tiles by land and
> by sea.
> 2. It looks for the enemy units within certain distance and estimates how
> much they endanger the city.
> 
> So in general you have one city and many enemies around.

Such a description should be in the code!

> Are you actually proposing to generate a separate warmap for every unit
> that is near the city?  I do not think it is very clever.

AFAIK for being accurate such an extra work is needed. What properties
does the current code take into account? Move rate, move type and
F_IGTER are considered. What about fuel, F_IGZOC, F_TRIREME and
F_NO_LAND_ATTACK?

If we leave the accuracy constant we have the option to generate two
warmaps: one for land and one for sea (based on the city). This will
AFAIK (please correct me) require not much extra time. What do you
think about this?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "It is not yet possible to change operating system by writing
  to /proc/sys/kernel/ostype."              sysctl(2) man page


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