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: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Cc: Freeciv Development List <freeciv-dev@xxxxxxxxxxx>, "Per I. Mathisen" <per@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: (PR#2370) Path finding
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Tue, 18 Feb 2003 11:27:35 +0000 (GMT)

On Tue, 18 Feb 2003, Raimar Falke wrote:

> On Tue, Feb 18, 2003 at 10:45:14AM +0000, Per I. Mathisen wrote:
> > > I'm pretty sure that you really don't want:
> > > +  movecost = UPI_pos.BMC_of_next_step;
> > > but rather
> > > +  movecost = UPI_pos.total_BMC;
> > 
> > So total_BMC is cost of path so far? I see.
> 
> You read path_finding.h?
> 
>     /* 
>      * Total BMC required to reach this position. Undefined if a turn
>      * mode other than TM_NONE or TM_CAPPED is used.
>      */
>   int total_BMC;

And we can also define total_BMC in other modes too, if needed.  Raimar is 
against it on ideological grounds, but to code it is to change two lines.

> > Another issue: The diplomat bribe code I hacked up pretty bad. Now that I
> > slept on these changes, I realized it was the wrong thing to do. Instead,
> > there should be a way to get pf_next() to iterate over tiles that overlap
> > into the ocean. This is also needed for ferry code, where units will have
> > to consider potential ferry pick-up points. Also the reverse is needed for
> > ferries (overlap one tile into land). Can you look at this issue while I
> > go back and try making pf14 work again?
> 
> I'm really against adding something like this to the generic
> PF-code. You can't assign a cost to such a move. Do something like:
> 
> while pos_f=get_next_pos(map_f):
>   for i in square_iterate(pos_f, 1)
>     do something with i

crap.
This is precisely why I was putting cost_fn call-backs there.  It can and 
should be done via those.

With clever call-backs we can do complicated paths like transporter takes
Mech Inf to beachhead, Mech Inf disembarks and moves to occupy a city next
door, all in one go!

G.




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