Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2003:
[freeciv-ai] Re: [RFC] Ferry code
Home

[freeciv-ai] Re: [RFC] Ferry code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [RFC] Ferry code
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Sat, 5 Apr 2003 09:57:14 +0200

On Fri, Apr 04, 2003 at 11:23:35PM +0100, Gregory Berkolaiko wrote:
> I thought lots about the ferry code (no, really!) and here is the outline of 
> my
> proposal.
> 
> Setup: unit U on continent 1 wants to move to Z on continent 2.
> 
> We make a big map for U to go to all coastal towns T(i) on 1 where it will 
> spend
> approx N(i) turns waiting, then from each town we calculate paths to all coast
> tiles of continent 2, from all coastal tiles we calculate all paths to Z.  
> This
> calculation is not much costlier than normal map for one unit btw!
> 
> As an ingredient we will need these numbers N(i) which I think we should just
> WAGuess (maybe taking into account boats which are "registered" at that city 
> and
> the production output of the city).
> 
> Once a route has been decided (say, U will walk to Geneva from which it will
> sail to  Paris from which it will walk to London), U sets London to be it's
> ultimate dest and Geneva to be it's waypoint.  
> 
> U contacts Geneva and attempts to book a boat.  If Geneva can find a boat, B, 
> U
> will be told of B's ID and B will be ordered to go to Geneva and will be told 
> of
> U's ID.  Thereafter, each turn both U and B will check if the other is still 
> in
> existence and still on their way to Geneva, otherwise they will be "released".
> 
> If Geneva cannot find a boat, it will make a mental note of "need a boat for 
> U".
>  Thereafter, each turn Geneva will check if U is still alive and on the way to
> Geneva.  If this is the case, Geneva will try to build set the boat as the
> production for this turn.  Otherwise, the note will be deleted.
> 
> 
> There are two points where present code might not be ready for this:
> 1. Making sure that once a unit is on the way somewhere, it will not suddenly
> change it's mind and go exploring instead.  Per, what's the situation now?
> 2. Making sure that a boat is built unless the city has something really 
> urgent
> to do.  For this, I think, we need a system of urgency categories for a 
> build. 
> I suggest: 1 - normal, 2 - boat, 3 - civil urgency (aka unrest), 4 - military
> urgency.
> 
> Future expansions:
> 1. The boat does not have to be built in Geneva.  It can be put in a "global
> queue" with the note that it is needed in Geneva and then "global advisor" 
> will
> assign it to a nearby coastal city.
> 2. Once B and U are in liaison, they can agree on another more convenient 
> pickup
> location.  Raahul is working on it ;)
> 3. We can keep a tab on how busy each port has been and how long were the
> delays.  This can be fedback to (a) numbers N(i) and (b) free boats to tell 
> them
> to go to busy ports looking for an odd job.

Alternative proposal:
 - search a pickup point P. Simple version1: draw a line between U and
 Z and P is the last point of the continent in which U stands. Simple
 version2: choose the nearest ocean.
 - search a dropoff point O. Analog to P
 - there is a global boat management. You book now a boat and want it
 to come to P.
 - you fine-tune the pickup point in relation to the boat

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Like the ad says, at 300 dpi you can tell she's wearing a
  swimsuit. At 600 dpi you can tell it's wet. At 1200 dpi you
  can tell it's painted on. I suppose at 2400 dpi you can tell
  if the paint is giving her a rash."
    -- Joshua R. Poulson



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