Complete.Org: Mailing Lists: Archives: freeciv-ai: January 2006:
[freeciv-ai] Re: [Freeciv-Dev] (PR#12682) AI Ignores Building Effects fo
Home

[freeciv-ai] Re: [Freeciv-Dev] (PR#12682) AI Ignores Building Effects fo

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: badamson@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] (PR#12682) AI Ignores Building Effects for Tech. Wants
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 8 Jan 2006 06:29:25 -0800
Reply-to: bugs@xxxxxxxxxxx

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

On Mon, 26 Dec 2005, Benedict Adamson wrote:
> The patch increases the tech_want for technologies that enable useful
> improvements (for example, Ceremonial Burial enabling Temple) and for
> technologies that enhance improvements (for example, Mysticism enhances
> Temple). It decreases the tech_want for technologies that will render
> useful improvements obsolete.

This is a very nice patch! Sorry it has taken so long to look at it. I
have some comments:

+  /* WAG */
+  const int tech_want = building_want * pcity->ai.recalc_interval * 14 / 8;

Where do 14 and 8 come from and what to they mean? Please use some
informative defines here instead of plain numbers.

+  int n_needed_techs = 0;
+  int n_needed_improvements = 0;
+  /* For now, we hard-code the maximum number of needed technologies
+   * and improvements at 8 so we can use an efficient array
+   * rather than a slow genlist.
+   * For most rulesets, we expect at most 1 requirement of each.
+   */
+  Tech_type_id needed_techs[8];
+  Impr_type_id needed_improvements[8];

Why not use a specvec here?

+  /* The units of building_want seem to be production
+   * (shields/gold/luxuries) */
+  int building_want[B_LAST];

By 'production' we usually mean shields. The units of building_want are in
some fuzzy and special AI value which does not correspond to any
particular output. I either do not understand or like this comment.

Look at the above and I'll commit.

  - Per





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