Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] Re: (PR#6131) bunch of changes to AI wall, coastal & SAM c
Home

[Freeciv-Dev] Re: (PR#6131) bunch of changes to AI wall, coastal & SAM c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6131) bunch of changes to AI wall, coastal & SAM code
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Fri, 12 Sep 2003 04:56:38 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Wed, 10 Sep 2003, Per I. Mathisen wrote:

> I looked hard at a savegame pille sent me this evening, trying to figure
> out why the AI wasn't building SAMs to counter pille's massive air fleets,
> which he used to successfully beat 15 teamed hard AIs (!!). Turned out
> there was more than one reason. A lot more.

Apart from funit bug (committed) and maybe worstenemy patch, the patches 
try to rectify a system which isn't functional.  I think it's a waste of 
time.  We should concentrate on structural changes instead.  Take building 
of the city walls for example.  This is decided / reevaluated in three 
different places!  It's impossible to trace what decisions are taken and 
why!

Same goes for adjustattackers patch IMO.  It fixes the symptom without 
trying to investigate why the units do get stuck in the city.  Here more 
debugging and investigation is needed.  I will post my thoughts on 
defensive improvement selection in a separate email to freeciv-ai.

G.

> worstenemy: This is based on an idea from pille. We look at all a player's
> active units, where active is defined as moved in last turn, and figure
> out if he is going for land, sea or air primarily. Then we adjust want for
> coastal and SAM accordingly. (We don't touch walls here.)
> 
> rewritewall: This is a first attempt to rewrite the final instance
> wall/sam/coastal deciding code, which was hideous. I made the logic a bit
> simpler, and also made sure that we build coastal or SAM instead of wall
> when there are wanted higher (previously we would build wall first no
> matter what...).
> 
> no_overwrite_defense: In assess_danger(), we might overwrite the want for
> wall, coastal and SAM by a _smaller_ value than given to them by the
> threat code. Bad!
> 
> funitbug: This is a really awful bug. Basically we create an empty virtual
> unit, and then do a lot of checks on it, when we really should be checking
> the real unit (punit). No wonder SAM never worked!
> 
> adjustattackers: Sometimes units start pouring out attacking units, but
> don't find any place to send them afterwards. This can be for various
> reasons, I guess. In any case, if we support loads of units that just sit
> there, desire more of them less.
> 
> consider_defense: Another bug, I think. In the general buildings code, we
> massage away any buildings requiring upkeep that have low want. This way
> we massage wall, coastal and SAM down to zero want, and later cause
> assess_danger() to skip considering these, since it checks if previous
> code wanted them at least 1 point of want!
> 
> 
> Overall result: We now build lots of more SAM when the enemy has lots of
> air units. We also build less attackers in typical "caught in
> build-attackers-loop" cities.
> 
> Possible problems: I've changed rather critical code that has worked so-so
> for some time now. Some more playtesting is needed. Please help out.
> 
>   - Per
> 
> 




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