Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#13137) ai "stats" aren't initialized
Home

[Freeciv-Dev] (PR#13137) ai "stats" aren't initialized

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13137) ai "stats" aren't initialized
From: "Jason Dorje Short" <jdorje@xxxxxxxxx>
Date: Wed, 18 May 2005 09:03:11 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Each city has an ai structure with a stats structure inside it.  This
tracks, among other things, the number of units by class.  However these
values are never initialized.  ai.stats.units[x] is always 0 (I think
most other fields of ai.stats is too).  This qualifies as a major AI bug
since it means all the carefully crafted AI logic is always bogus.

In fact from what I can see it's not really possible to initialize these
values since you can't easily tell what class a unit belongs to.  There
is no unittype->class field for instance.  You probably have to look at
some combination of move type and unit flags.

That said, unit class is probably not what we want to be looking at
here.  Eventually the unit classes should be ruleset definable so
references to specific types won't be possible.  In the meantime most
stats should probably be done by move type or by unit flags directly
(count the number of units with NUKE ability rather than looking at the
number of UCL_MISSILE units).

-jason





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