Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2002:
[freeciv-ai] Re: Settler fixes [Was: A better AI Eval buildings 1.1]
Home

[freeciv-ai] Re: Settler fixes [Was: A better AI Eval buildings 1.1]

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: Settler fixes [Was: A better AI Eval buildings 1.1]
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 14 May 2002 15:52:12 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, May 14, 2002 at 11:48:34AM +0200, Per I. Mathisen wrote:
> On Tue, 14 May 2002, Raimar Falke wrote:
> > In the settler management agent (customizable auto settler with city
> > founding ability) I scan the whole known continent for a good spot if
> > a settler is without work.
> 
> I hope you use something akin to the minimap to ensure that two settlers
> don't go for the same city spot.

Of course. Implemented via the attributes.

> > You also can't cache the results from turn to turn because there may
> > be a much better spot just expolored by another unit.
> 
> But I think you can, if the area explored is just big enough. And "big
> enough" is not very much, just an area of, say, 6x6 (less so in the
> beginning). Because the cost of travelling across a larger distance than
> that to settle in a slight better spot is much higher than the benefit.

You can't guarantee this for every possible ruleset. However in the
current SMA code (which uses a linear amortization) you can abort the
path finding if you take more than MORT turns to reach the tile.

> > So I know this needs a lot of CPU but you can ensure that it is the
> > best spot possible at this time.
> 
> Each turn you spend travelling towards this "best spot" is production,
> trade and science lost. Since this means your next settler will be
> finished later, and its city's next settler will be later, etc, the
> repercussions of this decision will magnify each turn until the end. In
> the beginning in particular, fiddling about the "best spot" means certain
> death when faced with an adversary of equal skill.
> 
> > I will see how much of this can be optimized but fast path
> > finding/warmap/goto functions will help a lot.

> The ideal settler will find good spot nearby, and make roads on any
> grassland/plain tiles used on the way there. This is because roads are
> both extremely important to get science and 

> they are cheap to make.

What if the best tile (the one which is used in addition to the
center) is not on the path? Then you would have to wait till the city
grows to size 2 to get the benefit from this road. What if the tiles
in the path are used if the city grows to size n? So it isn't easy to
calculate this and in the current version the SMA will split these
actions.

> I won't  Since
> settler and worker are separate abilities, this is something of a
> challenge to do right.

> Raimar, can you post whatever code/headers/plans you currently have
> for SMA?

The latest SMA version is from last Sep. It is complete but contains
some approximation (very easy city model for city founding, linear
amortize) which may need to improved. Missing is the GUI. And this GUI
will be more complex then the CMA one. The GUI will also need the map
decorations patch so that you can visualize the actions and paths.

The SMA does require the goto agent or any other path finding with a
sane interface. So if we finilize the path finding interface and have
at least one implementation in the CVS I could start to update the SMA
to the current code base (and the current style rules).

        Raimar

--
 email: rf13@xxxxxxxxxxxxxxxxx
  A supercomputer is a computer running an endless loop in just a second


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