Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: how to improve the AI's attack (was: old/bad code in a
Home

[Freeciv-Dev] Re: how to improve the AI's attack (was: old/bad code in a

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx (Freeciv developers)
Subject: [Freeciv-Dev] Re: how to improve the AI's attack (was: old/bad code in autoattack.c (PR#351))
From: Reinier Post <rp@xxxxxxxxxx>
Date: Wed, 3 May 2000 16:07:02 +0200

[Does the AI focus on where to attack?]

>       Yes, but it does chose geographically close cities with a
> preference.  That constitutes "building an easy to defend zone", in an weak
> sense, as everything is more compact.

OK.  Useful but not enough ...
 
> > But it only seems to work on land units!  The AI doesn't protect
> > transports at all.  The remedy: apply the bodyguard code to ships.
> 
>       Right.
>       It also builds too many transports.  I'm not entirely sure why.

Yes, I've noticed that, too.
 
> [...] Remedy, I sassume: upon emptying an enemy city,
> > recheck units already considered to see if they can move in.
> 
>       I think that two passes used to be done, and were removed because
> of the computational expense.

Well, this wouldn't be expensive: the second pass would only happen
whenever an an enemy city was emptied in the first.
 
> >  (AIs don't steal techs, either.)
> 
>       Wrong.  The problem is that Diplomats are a Build Of Last Resort.
> AIs will happily steal techs given the units.  I wrote that code myself.

Ah, great.  I noticed that the AI can bribe units now, I didn't realise
it can also steal techs.
 
>       Part of that is because as you note, the AI produces tens of
> defenders per city.  Population loss is impossible to avoid given enough
> defenders.

But it makes a huge difference if they all attack at once:
every attacker but the first will have a bigger chance, the
previous ones have already weakened the defense.

> > Every city weighs in the economic scale, so destroying cities that
> > could be captured and secured is a serious waste.  It also deprives
> > units of home bases near the front line.
> 
>       But given enough defenders, a capture will never occur.  The AI
> never purposely starves cities to avoid their capture, but a good Defensive
> Player will ensure scorched earth.

True, and the big improvement I expect is in the case where the enemy is
economically/technologically weaker.  Against stronger enemies, attacking
is always very hard, and the AI already defends very well.

> > Remedy: reverse the algorithm for allocating work to units: units
> > shouldn't be looking for tiles to operate on, but tiles should be
> > competing for units to satisfy their needs.  (E.g. enemy cities,
> > whose 'need' it is to be attacked; mountain tops, which 'need' to
> > be occupied for defensive purposes; etc.)  Competition can be fairly
> > local, comparing the requirements of a tile to those of nearby tiles.
> 
>       I think that even making some decisions at the continental level
> rather than the current distributed level will help.

Yes, this idea of tiles competing for units is just something in the
back of my mind, it may not be feasible in practice.  I'm not prepared
to implement it - otherwise I'd be producing code instead of freeciv-dev
messages.

-- 
Reinier



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