[Freeciv-Dev] Re: (PR#2370) Path finding
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
- [Freeciv-Dev] Re: (PR#2370) Path finding, (continued)
[Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/13
[Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/16
[Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/17
[Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/17
[Freeciv-Dev] Re: (PR#2370) Path finding,
Gregory Berkolaiko <=
[Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/18
[Freeciv-Dev] Re: (PR#2370) Path finding, Gregory Berkolaiko, 2003/02/19
|
|