Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#2370) Path finding
Home

[Freeciv-Dev] Re: (PR#2370) Path finding

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2370) Path finding
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Wed, 19 Feb 2003 17:25:17 +0000 (GMT)

On Wed, 19 Feb 2003, Raimar Falke wrote:
> Maintainability is important in the long run. No doubt about this. But
> correctness is still more important.

And why is that? The current AI has many problems, but I cannot think of
one that can be traced back to lack of exactness.

> This is comparing apples with peaches. Based on pf14.diff is more
> like:

Well, at least to me, much of the point in having a new path-finding was
being able to use a path-iterator. It is also the only way to avoid
significant slowdown of the AI code because of the new and more complex
path-finding code.

> With the pf_get_position Gregory wanted you can remove two lines. The
> init stuff can be folded nicely in a function like ai_get_pf_map. So
> this will look like:
>
>  pf_map_t UPI_map;
>   pf_position pos;
>   UPI_map = ai_get_pf_map(punit);
>   if(pf_get_position(UPI_map, x, y, &pos))
>       return pos.total_BMC;

Yes, no doubt we can hide much of the ugliness of pf behind a layer of
abstraction or two, but that doesn't hide the fact that each such layer is
going to make the result even more complex and less maintainable.

  - Per



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