[freeciv-ai] Re: RFC: Behaviour constants.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
At 04:39 PM 02/12/04 -0600, Mike Kaufman wrote:
>On Wed, Dec 04, 2002 at 10:27:52PM +0000, Gregory Berkolaiko wrote:
>> How can we improve AI without going too deep?
>> This is a legitimate question, and an answer to it is given by various
>> constants and factors and multipliers that the AI code is peppered with.
>> Examples are: what is considered to be a small nation (number of cities)
>> -- used to encourage settler building; what is the default danger for
>> capital; what is food/shield weighting etc.
>I don't have an answer for this one right away. Ross, I imagine should be
>able to expound on this for quite some time.
I have ... read the archives :-) Or a brief summary below.
>> Some of these numbers are defines, some are just plain numbers. What I
>> propose is to collect them all in some .h file included in all AI files,
>> so they can be tweaked in a systematic way. Then tweak them and run
>> pitfights, lots of them. There ar, of course difficulties like "constant
>> is constant for all nations", but they are solvable.
>I would strongly suggest that instead, we create a ruleset file somewhere
>in data/, so that these parameters can be tweaked without recompile. This
>would go a long way toward creating "personalities" for ai. Once we have a
>set of parameters, we can actually do this:
>create Shaka "warmonger"
>create Neville "passive"
>with "warmonger" and such defined in said ruleset file
The ruleset idea is good.
In the ideal world there is a massive function that knows all, computes
all in zero time, and extrapolates this to include all possible future
eventualities also in zero time. This function always wins its games
against mere mortals.
In the practical world there is a simpleton function that wraps all the
nearly constant bits into expansion coefficients for a few function
variables that appear to be significant. Expansion coeficients for
the non-mathies are generally called constants.
The simplest function is a single constant "goodness" or "want" value
for something, but the most typical form is a computed "want" of
several mostly useless things someone thought would be important and
hasn't figured out aren't yet plus a couple that are, but may not be
cleanly expressed as orthogonally varying elements.
GB's idea may help decide which "constants" are useful or not, and which
are constant, or should be tuned/combined to account for critical
conditions. In the end hopefully the massive compute-all will be optimized
by certain practical experiences to understand which things it really
doesn't need to compute, and which ones it does, with relatively simple
orthogonal components that can be tuned by choice of coefficients to
provide different "personalities" or response characteristics.