[Freeciv-Dev] Re: Path-finding code (with danger).
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
path_finding.c.gz
Description: GNU Zip compressed data
|
|