[freeciv-ai] Re: Opinions on some AI issues
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 17 Jun 2002, Gregory Berkolaiko wrote:
> I. Technology selection by AI.
> Right now the AI evaluates units (and I
> guess buildings) that it can build to select the build but it also
> evaluates the things it cannot yet build and if they are found useful,
> the want of the enabling techs is bumped up. IMO it is a very good
> philosophy. Unfortunately it is hard to maintain, hard to generalize, it
> encourages spaghetti-coding and slows down the server. Also it is hard to
> weigh importance of musketeers on the same scale as importance of
> Instead I suggest that tech slection be done randomly, based on some
> general tendencies. We can define few general tech directions, like
> Social, Economy, Military. Then we can have base weights for each civ
> plus some situational modifiers (e.g. a lot of cities in danger -- go for
> Military, too many elvii -- go for social, empty coffers -- go for
> economy). The next tech will be selected randomly with more probability
> going to the more desired directions.
> This is a very basic idea. It can be made more complicated (and therefore
> flexible, I hope), by several means:
> 1. Split basic directions
> / \
> Defense Offense
> / \
> Buildings Units
> 2. Each tech can have a precomputed score in each of the directions.
> You combine (scalar product) these with the civs weight and it becomes the
> probability of this tech's selection.
> 3. Each civ can have it's character reflected in the base wieghts.
And these tech weights should be in the rulesets? No, thanks. Rather
calculate these weights in game start. The ruleset author is not in a good
position to know beforehand what tech strategies are going to be good and
which are not.
> III. Danger estimation.
> When evaluating danger, it is important to remember the most dangerous
> units. In order to attack them later. Right now the priority is to
> attack more expensive and less defended units. But choosing to attack a
> caravan over a guarded howitzer can be deadly (another argument in favour
> of fuzziness: AI will always attack one and not the other -- and one can
> exploit it). Of course it is better to kill both :)
No, we must never use ai_fuzzy except for difficulty levels. AI on 'hard's
hould never use ai_fuzzy. It is not a problem that the AI is deterministic
as long as it consistently does the right thing. A non-deterministic AIs
will be near impossible to tune properly.
The current target selection algorithm places too much weight on cost and
too little on threat, agreed.
> IV. Invasions.
> Invasion targets should be selected on a high level. The current
> "everybody is going there so I go there too" attitude is pathetic. But
> what is a good city to attack?
A group of poorly defended cities connected by road or rail is always the
best target. The capital is always the second best target. The nearest
enemy is rarely the best target.
"Attack where the enemy is weak, defend where he is strong."
> V. Ruleset tips.
> Bodyguarding is a great idea. CivIII got it (I think they stole quite a
> few features from FreeCiv, actually). But to see a rifleman guarded by a
> mech.inf. is hilarious! It happens because rifleman had 5A > 5D which
> qualifies him as an attacking unit. And 6A/6D mech.inf. is a defender!
> How do we distinguish an attacking unit from a defending one? We can
> write complicated functions or we can use more role tips in the rulesets.
We can write complicated functions or we can make rulesets complicated and
trust ruleset authors to know how to give the AI good hints. My vote is
for the former. Often ruleset authors don't know what units are good
before their ruleset has been tested a few gazillion times. A calculating
will help here. It is easy change the balance of which unit rocks with a
tiny change with unforseen effects, which will not be reflected in AI
hints, but may be picked up by the complicated function.
Also, for some very complex rulesets, it may not be apparent which units
will be available at the same time as other units are. So it is not
impossible that Riflemen are the best attacking unit. Hardcoding it as a
defender would be wrong in that case.
"It is difficult to catch a black cat in a dark room.
Especially if there is no cat there." - Confucius