Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277
Home

[Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: Petr Baudis <pasky@xxxxxxxxxxx>, "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: patch: make ai understand peace and alliances (PR#1277)
From: Tony Stuckey <stuckey@xxxxxxxxxxxxxxxxx>
Date: Mon, 25 Feb 2002 10:50:57 -0600

On Mon, Feb 25, 2002 at 05:19:12AM -0800, Raahul Kumar wrote:
> Ah hah. By the way, for Per's info, the AI does establish trade routes. There
> are crap routes though, the AI does not seem to check on city size at all when
> establishing trade routes.I have never seen it establish a trade route with a
> foreign civ.

        Under Civ1 rules (trade routes only give a benefit to the
originating city) the AI should (but does not) preferentially establish
trade routes in enemy cities, to get the higher value.
        Under Civ2 rules, with bidirectional trade routes, establishing
trade routes with your own cities provides the same benefit (cities in the
same nation get half value of cities in different nations, but you just
made 2x trade route numbers) without helping your opponents at all.
        However, one of the reasons why the AI doesn't make trade routes
often is that there is no way to know how long it is until endgame and
calculate a proper value for that.  We could assume a minimum, and that
would make trade route creation more common, but it would also be
inaccurate.  This function would be useful for other purposes as well.

        The AI does check trade route value.  The code is right there in
ai_manage_caravan().  The algorithm is:

        If we're building a wonder, go there and help.
        If we're not, make the best trade route you can on this continent.

        This algorithm was chosen in part because trade route creation is
broken as I recall.  It is checked when a caravan enters any city, rather
than necessarily the city it was destined for.  (The goto arguments about
avoiding cities may now recommence.)  Also, at the time, I don't think that
goto routes across continents were something I understood how to do.

        Again, the AI want values for caravans do not seem to take trade
route value into account, so they are not built often.  The immediate
benefits of establishing a trade route can be quite large -- gold and
science income of more than 50 points.  That alone might be able to justify
building caravans in certain situations.
-- 
Anthony J. Stuckey                              stuckey@xxxxxxxxxxxxxxxxx
"And they said work hard, and die suddenly, because it's fun."
        -Robyn Hitchcock.


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