Complete.Org: Mailing Lists: Archives: freeciv-ai: June 2004:
[freeciv-ai] Re: Stop ferries from yoyo-ing between cities
Home

[freeciv-ai] Re: Stop ferries from yoyo-ing between cities

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Per Inge Mathisen <per@xxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: Stop ferries from yoyo-ing between cities
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Sun, 13 Jun 2004 15:45:17 -0500 (CDT)

On Sun, 13 Jun 2004, Per Inge Mathisen wrote:

> The reason the patch is fixing something, is that the weighting in
> ai_ferry_find_interested_city() is rather weird, and makes ferries way too
> eager to travel around to find the supposedly "optimal" place to be.
>
> Another patch might actually be
>
> - if (turns >= turns_horizon) {
> + if (turns + pos.turn >= turns_horizon) {
>     UNIT_LOG(LOGLEVEL_FERRY, pferry, "%s is NOT suitable: "
>
> to punish travelling more.

Yes, the behaviour like you describe below is possible.  I think the patch
above is good and you should commit it if you want.

When I get back to Germany I will work on taking ferry building out of
other modules and making it more centralised.  I realised that the code is
ready for it: the need_ferry field will be used to indicate that the city
wants a ferry and then some extra code can decide if it should build one.

> As of now, taking 30 turns traveling over half the world to stay in a city
> that will finish its ferry in 31 turns rather than staying in a city that
> will finish its ferry in 32 turns is a possible result. What will happen
> is that both cities will buy the ferries before 30 turns because they need
> it and the ferry they already have will be smack between the two cities,
> leaving the player with 3 ferries, one too many.
>
> This example does not really explain the yoyo-ing that I've seen, though,
> so I suspect there are more issues here.

Savegames?


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