Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: RFC: Fixing movement code

[Freeciv-Dev] Re: RFC: Fixing movement code

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Petr Baudis <pasky@xxxxxxxxxxx>
Cc: Raahul Kumar <raahul_da_man@xxxxxxxxx>, freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: RFC: Fixing movement code
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Sat, 24 Nov 2001 14:59:40 -0500

Just to add a generic note to some of these comments.

In most cases it really doesn't matter what you do to compute any weights
within fairly broad parameters. 

The choice of parameters is relatively arbitrary and no where near the sort 
of complete analysis a skilled player might apply. It is also highly
subjective as to just how important certain effects might be, or to put
it differently, different strategies or local scenarios should use different 

In general, only rough relative weights are ever worth computing as this
process is incomplete an arbitrary to begin with.

If you choose the 2nd or 3rd best move rather than the absolute best of
nearly equivalent weights that is all that is required. You just need to
make sure you don't choose the 99th best. And if there are special case
criticals, you handle them before going to the weighted selection.

In fact the best AIs introduce a small amount of variance in their weight
selection (e.g. choose the best of 3 random picks into a total list) to
insure they are 1) less predictable, 2) can find their own way out of
algorithmic deadend or stalemate positions, and 3) allow for the fact 
that the coded "best choice" is usually not the best because of the 
coding limitations.

Once, you pick something, then you need to playtest it A LOT to make sure
the parameters and weights you chose don't result in foolishness, or you
catch any criticals or adverse interactions with other parts of the AI.

For the most part the AI is overly complex in both its detail of weight
calculations, and the clarity or lack of in which it is coded. But it is
also the case that there are strong global dependencies between choices
that are largely hidden or decidely non-obvious and these can dramatically
change the overall AI game play if the rebalancing/test step is omitted.

Your clarifications are really good. Concerns about correctness less
useful unless you have stumbled on a critical parameter/condition that
has been overlooked or badly miscoded. And you *always* need to consider
speed/efficiency in these steps as they tend to be done a large number of 


At 05:32 PM 01/11/23 +0100, Petr Baudis wrote:
>> > Basic bonus is 'price' of the victim (build_cost), how valuable it is. In
>> > the city, we increase the bonus by 40, and modified by the health of our
>> > unit (* punit->hp / unit_type(punit)->hp). I don't get why it is
>> > by the health of our unit only in the city, that looks very
misterious.. I
>> > would think it would be more correct to do this everytime, i think i will
>> > try that and run some tests..
>> I agree. In fact, would it not be a smarter thing to use the function (I
>> forget the name) that calculates the odds of winning a battle instead of
>> these complex hard to figure out calcs.
>Yeah.. good idea.
>                               Petr "Pasky" Baudis
>UN*X programmer, UN*X administrator, hobbies = IPv6, IRC
>Real Users hate Real Programmers.
>Public PGP key, geekcode and stuff:

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