Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12853) AI tech handicap is ignored by the client
Home

[Freeciv-Dev] (PR#12853) AI tech handicap is ignored by the client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12853) AI tech handicap is ignored by the client
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Apr 2005 19:25:23 -0700
Reply-to: bugs@xxxxxxxxxxx

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

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;
}

the science_cost is 250% for novice level.  This is checked in the
common code in tech.c:

  /* FIXME: the is_server is a kludge to unbreak CVS. GB promises
   * to fix correctly a.s.a.p. 2003/5/18 -mck */
  if (is_server && pplayer->ai.control) {
    assert(pplayer->ai.science_cost > 0);
    cost = (cost * pplayer->ai.science_cost) / 100;
  }

the problem (as the FIXME says) is this is only checked by the server.
An is_server check is ugly and this is noe example.  A client could be
connecting watching this novice AI but then they'd see the wrong tech
data.  I think.

Mateusz, you fixed a related bug.  What do you know about this one?

-jason





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