Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#7230) patrolling tririemes may sink
Home

[Freeciv-Dev] Re: (PR#7230) patrolling tririemes may sink

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jshort@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7230) patrolling tririemes may sink
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Mon, 26 Jan 2004 12:02:10 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7230 >

On Mon, 26 Jan 2004, Jason Short wrote:

> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7230 >
> 
> > [i-freeciv-lists@xxxxxxxxxxxxx - Mon Jan 26 09:34:55 2004]:
> > 
> > On Sun, Jan 25, 2004 at 11:29:48PM -0800, Jason Short wrote:
> > >
> > > <URL: http://rt.freeciv.org/Ticket/Display.html?id=7230 >
> > >
> > > > [i-freeciv-lists@xxxxxxxxxxxxx - Mon Jan 12 15:35:43 2004]:
> > >
> > > > > The simplest solution would be to guarantee that the unit always
> > had the
> > > > > same number of MP at start and end of the route.  This is
> > accomplished
> > > > >   if the unit starts with less-than-full MP
> > > > >     wait at the beginning of the route
> > > > >   else if the unit ends with less-than-full MP
> > > > >     wait at the end of the route
> > > > > this is guaranteed correct but isn't optimal.
> > > >
> > > > I think this solution is acceptable. Especially since the purpose
> > of
> > > > patrol if not to go from A to B in the fastest way but to survey
> > the
> > > > area.
> > >
> > > Perhaps this solution isn't as simple as it seems.  Since it's
> > > distinctly less than optimal, it should only be used for units that
> > have
> > > danger positions.  But how are we to know which units those are?
> > 
> > This is easy: iff is_pos_dangerous (from struct pf_parameter) != NULL.
> 
> OK, here's a patch.
> 
> I really don't like this implementation.  I'd much rather do it right.

1. I don't see where last_order is actually used in send_path_orders.

2. What if the unit finishes the cicle on full MP (say the last segment is
RR).  It would still be forced to finish turn there wouldn't it?

3. When you convert path to the packet (from the bits of code I can see), 
you already have the directions in path->positions[].dir*, no need
to get_direction_for_step.

4. A suggestion for 2 above: instead of ORDER_FINISH_TURN introduce 
ORDER_REFILL_MP.  This will be interpreted at the server at the time of 
execution.  Them you just put this order in front for dangerous patrols 
witout much checking.

5. Applies to 4 and possibly to te current code: at the time of creating 
the path, make sure the PF knows that the unit will have full move points!

Hope it all makes sense.

G.







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