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: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Cleaning up gotohand.c (PR#1068)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Mon, 3 Dec 2001 14:26:55 +0000 (GMT)

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

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.

G.

> 
> > You can solve this problem, for example, make land-warmap, search
> through
> > all land units first, than make sea-warmap and search through all
> naval
> > units and through all land units who might use sea transport.  But it
> is
> > not any cleverer than the current situation.
> 
>       Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>   This customer comes into the computer store. "I'm looking for a
> mystery
>   Adventure Game with lots of graphics. You know, something realy
>   challenging". "Well," replied the clerk, "have you tried Windows 98
?" 

________________________________________________________________
Nokia 5510 looks weird sounds great. 
Go to http://uk.promotions.yahoo.com/nokia/ discover and win it! 
The competition ends 16 th of December 2001.


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