Complete.Org: Mailing Lists: Archives: freeciv-ai: January 2003:
[freeciv-ai] kill_something_with() stupidities

[freeciv-ai] kill_something_with() stupidities

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] kill_something_with() stupidities
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 28 Jan 2003 19:27:25 +0000 (GMT)


  /* Consider a land attacker */
  unit_type = ai_choose_attacker(pcity, LAND_MOVING);
  if (unit_type >= 0) {
    assert(can_build_unit(pcity, unit_type));
    virtualunit = create_unit_virtual(pplayer, pcity, unit_type, TRUE);
    kill_something_with(pplayer, pcity, virtualunit, choice);

It looks like the unit we're giving to ksw is the unit we're considering
building. But that is deceptive! ksw does its very own evaluation of which
unit it wants to build, essentially throwing away the result from
ai_choose_attacker(), making the latter essentially redundant. The
evaluation done in ksw is also buggy, allowing forbidden units to be built
by AI, which I discovered after several hours of debugging a non-AI patch.

This is all bad. The same goes for sea attackers.

  - Per

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