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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bh@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#9856) RFC: caravans advisor
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 9 Jan 2005 12:36:30 -0800
Reply-to: bugs@xxxxxxxxxxx

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

On Sun, 9 Jan 2005, Benoit Hudson wrote:
> 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.

Looks nice. Some problems:

        handle_unit_help_build_wonder(pplayer, punit->id);
-      }
+      freelog(LOG_CARAVAN, "%s's caravan %d helped build wonder in %s",
+          pplayer->name, punit->id, wonder_city->name);

This does not look sane. After handle_unit_help_build_wonder() punit has
likely been freed.

You do not touch ai_choose_help_wonder(). What role does it play now?

You do not check if the caravan might have died during goto. This is
necessary (autoattack, huts).

  - Per





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