Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [Patch] next_step_on_line
Home

[Freeciv-Dev] Re: [Patch] next_step_on_line

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] next_step_on_line
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 6 Oct 2001 18:31:30 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Oct 06, 2001 at 05:12:21PM +0100, Gregory Berkolaiko wrote:
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > 
> > The attached patch is my conclusion to the very long
> > straightest_direction thread. And yes the _optimal_ solution to this
> > whole problem can be put in a 110 lines patch.
> > 
> > It didn't show any failures during my testing.
> > 
> > If there no objections I will apply it and and finally close this
> > thread.
> 
> Please do.
> 
> However the straightest direction is only used for connecting (roads and
> RRs) and I plan to write a more flexible method for it in the nearest
> future.
> 
> The idea is as follows: in freeciv geometry there are, in general, many
> way to build the shortest road between two cities
> ( e.g. (0,0) -> (1,1) -> (1,2)  and (0,0) -> (0,1) -> (1,2) )
> but some of these roads might take longer to build (because of mountains
> or such like).  I would like to write a function which would map the
> future road taking into account future road distance and time to build
> it.
> Advantages:
> 1. Less time to connect cities with roads
> 2. Takes into account existing roads
> 3. One can add additional weighting to the route selection, e.g. to pass
> through other cities, to pass through squares which would get trade bonus
> from the road etc.
> 4? Would make straightest direction obsolete.
> 
> Comments on the idea and suggestions for implementation are welcome.

Sounds very nice. I assume that you know that you can't squezze this
into the existing methods. The callback code you posted seem more like
the right thing to do. You may also have to think about allowing the
user to set/pass parameters to this code. 

But note that this case is a border case in the respect that I (but I
think some others has also agreed to this) don't want further code in
the server. Upgrading the server ai is ok and also upgrading other
existing server methods (into this category belongs your
proposal). But I will not easily accept more features in the server
(for example the proposed pursue mode). At least not in the way this
is currently done. If somebody proposed a framework for this I may
change my opinion or convert him to the agent idea ;)

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Sit, disk, sit. Good boy. Now spin up. Very good. Here's a netscape
  cookie for you. Fetch me some data. Come on, you can do it. No, not that
  data. Bad disk. Bad." 
    -- Calle Dybedahl, alt.sysadmin.recovery


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