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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2370) Path finding
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 19 Feb 2003 20:00:45 +0100

On Wed, Feb 19, 2003 at 05:25:17PM +0000, Per I. Mathisen wrote:
> 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.

So now imagine how many more problems you would have if the code would
be correct. For example get_invention sometimes returns the wrong
value. Or generate_warmap generates the warmap for a slightly wrong

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

Yes. But than you can't compare them (warmap and new iterator). But PF
still offers the old access and this way warmap and PF can be

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

You also have this layer in the current code. It is in generate_warmap
and also in really_generate_warmap.


 email: rf13@xxxxxxxxxxxxxxxxx
 "Despite all the medical advances of the 20th century, the mortality 
  rate remains unchanged at 1 death per person."

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