Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: [Bug][RFC] Stupid attack behaviour by AI (PR#1340)
Home

[Freeciv-Dev] Re: [Bug][RFC] Stupid attack behaviour by AI (PR#1340)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Bug][RFC] Stupid attack behaviour by AI (PR#1340)
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Sun, 24 Mar 2002 22:57:25 -0500

At 08:56 PM 02/03/23 -0800, Raahul Kumar wrote:
>
>--- "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> wrote:
>> On Sat, 23 Mar 2002, Gregory Berkolaiko wrote:
>> > Raahul Kumar drew my attention to this phenomenon: if you park your, say,
>> > phalanx on a wee mountain outside an AI city then from time to time the
>> > city's gates will burst open and AI will attack you with few phalanxes or
>> > similarly inefficient units.  Seemingly without any real desire to kill
>> you...
>> ...
>> > because reinforcements are counted in the attack but _not_ counted in the
>> > loss.
>> >
>> > So what happens is:
>> > AI accumulates quite a few defensive units.
>> 
>> Why on Earth does the AI build and attack with _defensive_ units?
>
>This is quite a vicious cycle. The answer is in three phases:
>
>The AI system of what to build is prioritised in favour of military units,
and
>further weighted to favour defensive units first. It also checks the nearness
>of enemy units and that phalanx on a mountain outside the city is very near.
>Rather
>than build attacking units the AI builds defensive units because it believes
>that single phalanx will take out 3+ phalanx behind city walls. There is a
bug
>right here. Having enemy units outside the city leads the AI to *ALWAYS*
>build defensive units.

It is not too difficult to phase over from defence to attack by tweaking 
the danger calculations. After a couple defenders have been built it should
start producing attack units. It should not attack with the last one or
two defenders (for bigger cities) unless the battle odds are really in its 
favour. I played with this a bit if you take a look.

These parameters are sensitive (== somewhat chaotic), but it is doable :-).

>There is also a bug in win/loss equation. As Greg described it, the AI
wrongly
>thinks it can destroy a fortified phalanx with four attacking phalanx. The
cost
>to it is far higher than my loss.

Actually, there are other effects than pure combat weights at play here.

It is really dangerous to allow an enemy to keep a fortified defender 
next to one of your cities. It can protect a series of attackers and
result in city loss which can be infinitely more damaging than a few
phalanxes. A purely combat odds AI will lose badly against opponents
that understand some of the more sophisticated advantages/weights.

But, the AI should still improve on its (apparently) sole takeout 
strategy in this case :-).

BTW: can it do a diplomatic buyout yet? This should be an obvious
enhancement to deal with single pesky enemy units.

>Naturally the AI attacks with defensive units because the building order has
>left it with NO ATTACKING UNITS. It will never build any attacking units
>either,
>in spite of the superior win chance of knights/catapault/legion against
>phalanx.
>
>> 
>> Yours,
>> Per
>> 
>> "Capitalism is the extraordinary belief that the nastiest of men,
>> for the nastiest of reasons, will somehow work for the benefit of
>> us all." -- John Maynard Keynes
>> 
>> 
>________________________________________________
>Do You Yahoo!?
>Yahoo! Movies - coverage of the 74th Academy Awards®
>http://movies.yahoo.com/

Cheers,
RossW
=====



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