Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2002:
[Freeciv-Dev] Re: Path-finding code (with danger).
Home

[Freeciv-Dev] Re: Path-finding code (with danger).

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Development List <freeciv-dev@xxxxxxxxxxx>
Cc: Raimar Falke <rf13@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Path-finding code (with danger).
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 13 Oct 2002 19:50:41 +0100 (BST)

I thought a bit and decided to do the following:

* allow any extra costs anywhere
* however across dangerous region the priority will be given to finding 
_a_ route, not to finding the _best_ (COP-wise) route
* the route found will most likely be the best though and if the extra 
cost is low (or zero), it is guaranteed to be the best

I also did some simplifications, by finding a better way to manage waiting 
tiles and other things.

Changed path_finding.c is attached (the rest of the stuff is unchanged).

G.

On Sat, 12 Oct 2002, Gregory Berkolaiko wrote:

> Hi Raimar, (and others, please don't feel excluded:)
> 
> Attached are my latest path_finding.[ch] and a tiny patch to wire it to 
> the explorer code.  Load the attached game, hit "X" on any unit, a path is 
> found to (21,40).  Grassland is considered dangerous, tiles with x-coord 
> >= 20 give 6000 extra cost.  Just for testing.
> 
> It's fully functional.  Dangerous tiles don't give extra costs.  Paths 
> seem to be right.  There is a problem though: because dangerous tiles 
> don't give extras, a path actually prefers to pass through danger :(
> 
> Three solutions to that:
> 1. Ignore it
> 2. Try to find paths across danger taking into account COP as well.  I 
> have an idea, need to check it.
> 3. Ignore extra cost on _all_ tiles unless we stay there overnight.  Can 
> we do it?
> 
> In any case, please read, comment (in the code and otherwise) and change 
> what you feel should be changed.  Whatever we decide to do about 
> danger+extra, I feel we should speedily go towards inclusion.  And I won't 
> have much time in the next weeks, so please help me.
> 
> Best wishes,
> G.

Attachment: path_finding.c.gz
Description: GNU Zip compressed data


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