Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2002:
[Freeciv-Dev] Re: patch rfc: stop ai from building useless wall, sam, co
Home

[Freeciv-Dev] Re: patch rfc: stop ai from building useless wall, sam, co

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: patch rfc: stop ai from building useless wall, sam, costal and sdi (PR#199)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Thu, 4 Apr 2002 04:11:49 -0800 (PST)

--- "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> wrote:
> On Wed, 3 Apr 2002, Raahul Kumar wrote:
> > There are lots of other kludges elsewhere in the code that raise the
> priority of building walls. This patch has not touched them all.
> 
> I thought they didn't need to be... I'll double check that, but the patch
> seemed to work fine as is.

I'm saying that the AI will still build more city walls than strictly required.


> > Since when was H_SUB added? Does it work?
> 
> Always been there, never worked. Documented in my latest suggestion for
> new README.AI

For the future.


> > > +  FIXME 2: We should check if many of the enemies units on a continent
> > > +  have the F_IGWALL ability, and drop want for city walls if that is the
> > > +  case. - Per
> ...
> > Wrong check. Test if enemy units on continent are good attack units vs
> unwalled defenders.
> 
> I'm in the dark here. Can you suggest some kind of algorithm which would
> make sense in this case?

It depends on the value of the city. I don't have a sensible algorithm.
Probably going on proximity, if their win_chance vs nearest city to enemy units
is > 50%,
and attackers are not igwall, then build city walls. Every time we lose a city 
to units that are non igwall, we increase the desirability of city walls. 
 
> > > +  players_iterate(aplayer) {
> > > +    if (pplayers_allied(pplayer, aplayer)) {
> > > +      /* Just allies, we don't trust peace treaties _that_ much */
> > > +      continue;
> > > +    }
> >
> > Do not agree. When you introduce active diplomacy, AI can break alliances.
> 
<snip>
> Besides, we can always introduce prepare_break_treaty(...) or some other
> function to modify this and other places of allied trust later. But I am
> not sure it is worth it.
> 
> Too much paranoia is not good for the AI.

The computer is your friend. Only commie mutant traitors do not trust the
computer.

Ok, you've convinced me. The computer is my friend. I will turn in my friends
for speaking out against the computer.

<snip>

> > > +      /* The next idea is that if our enemies don't have any offensive
> > > +         airborne units, we don't have to worry. Go on the offensive! */
> > > +      if (unit_type(punit)->attack_strength > 0 && (is_air_unit(punit)
> > > +                                                   
> ||is_heli_unit(punit)))
> ...
> > If they have only 5 airborne units, I never bother building SAMs. If the
> enemy does have large number(>5) air units, do build sams.
> 
> 5 is just an arbitrary number. Do you have an algorithm to suggest that
> would make better sense? (BTW I should check attack_strength > 1 instead
> of 0.)

I'd suggest the use of win chance here. Most aircraft until stealth bombers are
pretty crap attackers. If there are enemy aircraft within 3 turns, with => 50 %
chance of winning against any city's defenders, build SAM. We don't panic if we
see a single fighter against our mech inf. On the other hand, with 12 Stealths
against our single riflemen it is panic time. 
 
> > The patch looks ok. I'll have to playtest it to see if there is an
> improvement.Is there any way of running two servers, one running unpatched
>CVS, one with your patch, so I can see which AI comes on top?
> 
> Not unless you add another difficulty level with H_DEFENSIVE to it, and
> then pit 'hard' and 'hard+defensive' against each other. I watched a few
> 'hard' vs 'easy' pitfights, as that will show the new code in action very
> well.

I suggest you do that. It will be very interesting to see how often your AI
comes out on top. I'd also want to see 'medium' vs 'medium + defensive'.
Sending in those kind of nos will convince everyone your patch is the bomb.

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


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