Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] (PR#9856) RFC: caravans advisor
Home

[Freeciv-Dev] (PR#9856) RFC: caravans advisor

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#9856) RFC: caravans advisor
From: "Benoit Hudson" <bh@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 Jan 2005 12:03:24 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=9856 >

I modified the AI caravan code to use my caravans advisor.
In an 8-player game to 2000, it didn't crash, and from the 
debugging output, it looked to be making correct decisions:
caravans with nothing to do did nothing (maybe they should
become defenders?); caravans helped build wonders if there
was benefit to doing so; caravans made trade routes when
the trade route was worth more than helping the wonder.

The code has several ways to improve it, but the logic is
already better than the prior code.  My logic:
- compute the best trade route's worth (gold + sci +
   the annual trade bonus, assuming 5% inflation)
- find a wonder; compute its worth as its cost to buy
   now, versus the cost to buy if we add the caravan 
   (no discounting for inflation)
- pick the better one.

By comparison, the current logic is:
- if there's a wonder that won't be done in 2 turns,
   pick it.
- else, find the city with highest trade route and go 
   there (even if we can't reach it, and even if
   we already have a trade route; without
   regard to the time it takes and without regard to
   the one-time payoff).

Attachment: caravan_ai.diff
Description: Binary data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9856) RFC: caravans advisor, Benoit Hudson <=