Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12852) Major bug: AI ignores skill-level directives
Home

[Freeciv-Dev] (PR#12852) Major bug: AI ignores skill-level directives

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12852) Major bug: AI ignores skill-level directives
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Apr 2005 19:25:21 -0700
Reply-to: bugs@xxxxxxxxxxx

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

When you set the difficulty level of an AI, the following code is called:

void set_ai_level_directer(struct player *pplayer, int level)
{
  pplayer->ai.handicap = handicap_of_skill_level(level);
  pplayer->ai.fuzzy = fuzzy_of_skill_level(level);
  pplayer->ai.expand = expansionism_of_skill_level(level);
  pplayer->ai.science_cost = science_cost_of_skill_level(level);
  pplayer->ai.skill_level = level;
}

this says, for instance, that an easy/novice AI should weight expansion
at 20% while a normal/hard AI weights it at 100%.

However the "expand" value is set but completely ignored after that.  In
other words, while novice and easy AIs aren't supposed to expand much at
all, instead they expand just as much as normal and hard players.

This patch should fix it, more or less.  A better fix may be possible.

This is a major bug that affects 2.0 (unless I'm missing something, of
course).  This fix justifies a quick 2.0.1 release.

-jason

? freeciv-2.0.0.tar.gz
? po/postat.pl
Index: ai/advdomestic.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.c,v
retrieving revision 1.120
diff -u -r1.120 advdomestic.c
--- ai/advdomestic.c    29 Sep 2004 02:24:18 -0000      1.120
+++ ai/advdomestic.c    20 Apr 2005 02:21:34 -0000
@@ -161,7 +161,7 @@
   if (unit_type != U_LAST
       && est_food > utype_food_cost(get_unit_type(unit_type), gov)) {
     /* settler_want calculated in settlers.c called from ai_manage_cities() */
-    int want = pcity->ai.settler_want;
+    int want = pcity->ai.settler_want * pplayer->ai.expand;
 
     /* Allowing multiple settlers per city now. I think this is correct.
      * -- Syela */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12852) Major bug: AI ignores skill-level directives, Jason Short <=