Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_de
Home

[Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_de

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Petr Baudis <pasky@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_desire() (PR#1279)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Mon, 25 Feb 2002 06:35:07 -0800 (PST)

--- Petr Baudis <pasky@xxxxxxxxxxx> wrote:
>Dear diary, on Mon, Feb 25, 2002 at 03:11:45PM CET, I got a letter,
> where Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
> > 
> > --- Petr Baudis <pasky@xxxxxxxxxxx> wrote:
> Dear diary, on Mon, Feb 25, 2002 at 01:41:39PM CET, I got a letter,
> where Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
>> --- advmilitary.c    22 Feb 2002 19:32:40 -0000      1.1.1.9
>> +++ advmilitary.c    24 Feb 2002 21:36:20 -0000      1.2
>> @@ -620,7 +620,7 @@
> > > > >                unit_types[i].move_type == HELI_MOVING) && acity &&
> > > > >                acity->ai.invasion == 2) b0 = f * SHIELD_WEIGHTING;
> > > > >        else {
> > > > > -        b0 = (b * a - (f + (acity ? acity->ai.f : 0)) * d) * g *
> > > > > SHIELD_WEIGHTING / (a + g * d);
> > > > > +        b0 = kill_desire(b, a, (f + (acity ? acity->ai.f : 0)), d,
> g);
> > > > >          if (acity && b * acity->ai.a * acity->ai.a > acity->ai.f *
> d)
> > > > >            b0 -= (b * acity->ai.a * acity->ai.a - acity->ai.f * d) *
> > > > >                             g * SHIELD_WEIGHTING / (acity->ai.a *
> > > acity->ai.a
> > > > > + g * d);
> > > > 
> > > > Kill those a,b,c,d. I think you have better names for those.
> > > 
> > > I do (basically it looks that same substitution as in findvictim applies)
> -
> > > however, as I said, it won't be in this patch.
> > 
> > Sounds good. I'm curious about the patches you intend to send in to Freeciv
> > dev. How are you going to split them up ? I want to be ahead of Raimar with
> > insightful comments. Never easy, he seems to be reading the patches and
> > responding first.
> 
> I'm sending the patches as I'm writing them - when one patch is in review,
> work
> virtually stops until it gets finetuned and committed. Then I move on. But so
> far I'm just by hand changing the code according to my old cleanups now,
> changing some decisions which I see as wrong now and doing the cleanup to
> deeper level.
> 
> > > > > --- aiunit.c  23 Feb 2002 21:03:31 -0000      1.1.1.10
> > > > > +++ aiunit.c  24 Feb 2002 21:36:20 -0000      1.45
> > > > > @@ -616,6 +616,30 @@
> > > > >  }
> > > > >  
> > > > > 
> > >
> /**************************************************************************
> > > > > +Compute how much we want to kill certain victim we've chosen.
> > > > > +
> > > > > +Benefit is something like 'attractiveness' of the victim, how nice
> it
> > > would
> > > > > be
> > > > > +to destroy it. Larger value, worse loss for enemy.
> > > > > +
> > > > > +Attack is the total possible attack power we can throw on the
> victim.
> > > Note
> > > > > that
> > > > > +we will even square this.
> > > > > +
> > > > > +Loss is the possible loss when we would lose the unit we want to
> attack.
> > > > > +
> > > > > +Vuln is vulnerability of our unit when attacking the enemy.
> > > > >
> > >
> +**************************************************************************/
> 
> Your mailing thing is doing this, and it's somewhat annoying.. is there any
> way
> how to change this behaviour, please? ;)
>

Yes. I'll change it for any emails I send to you after this one.
 
> > > 
> /**************************************************************************
> > > +Compute how much we want to kill certain victim we've chosen.
> > > +
> > > +Benefit is something like 'attractiveness' of the victim, how nice it
> would
> > > be
> > > +to destroy it. Larger value, worse loss for enemy.
> > > +
> > > +Attack is the total possible attack power we can throw on the victim.
> Note
> > > that
> > > +we will even square this.
> > > +
> > > +Loss is the possible loss when we would lose the unit we want to attack.
> > > +
> > > +Vuln is vulnerability of our unit when attacking the enemy.
> > > +
> > > +Victim count is number of victims stacked in the target tile. FIXME?:
> The
> > > +equation is not accurate as the other values can vary for other units on
> the
> > > +target tile (we take values from best defender), however I believe it's
> > > +accurate just enough now and lost speed isn't worth that.
> > 
> > I can't tell from this comment what happens when a fortress is the target
> tile.
> 
> That depends on the code where kill_desire() is used, kill_desire() itself
> doesn't care. Take findvictim() or find_something_to_kill() as a reference
> context code. It looks some defense value somewhere is computed properly for
> that case and it somehow reflects in the parameters of kill_desire() - at
> least
> I hope so :).


I was hoping someone decides to audit the AI combat code and see if it actually
makes the right decisions  in accordance with the following factors

Attacking 100 units stacked with a mech inf over 1 unit stacked with a musket.
I'm pretty sure the AI code does not weigh large stacks as being sufficiently
good for attacking at all costs.

As for the someone who audits the code, I think you're familiar with him.
You've
probably seen him in the mirror before, and his last name is Baudis.


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com


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