Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [Patch] Cleanup of attack power calculations
Home

[Freeciv-Dev] Re: [Patch] Cleanup of attack power calculations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] Cleanup of attack power calculations
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Feb 2002 17:53:16 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Feb 26, 2002 at 04:24:16PM +0000, Gregory Berkolaiko wrote:
>  --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> > On Tue, Feb 26, 2002 at 01:01:26PM +0000, Gregory Berkolaiko wrote:
> > > Everything is fine with the patch but I think you should do the renaming
> > > suggested by you in email to Mike.  Don't leave until tomorrow... (what
> > you
> > > can do day after tomorrow).
> > 
> > I'm not cleaning up the AI. I don't want to define the interface of an
> > AI file.
> 
> You are not cleaning the AI???  What is it you are doing then?

I'm cleaning up/try to understand combat.c. The AI is the main user of
combat.c. But this gets silly.

> > > Possibly you should consider changing belligerence to attack_rating (in
> > > analogy to defence_rating used in combat.c).  "Belligerence" isn't one of
> > the
> > > commonest words...
> > > 
> > > Two comments below.
> > 
> > > > +      a = base_unit_belligerence_primitive(i, FALSE, SINGLE_MOVE,
> > > > +                                          unit_types[i].hp);
> > > 
> > > why don't you feed 
> > > (m == LAND_MOVING || player_knows_improvement_tech(pplayer, B_PORT)
> > > as a parameter to base_unit_belligerence_primitive??
> > 
> > It looks like do_make_unit_veteran is the right thing.
> 
> no it isn't

Indead. 

But this is the only case where this factor would be needed.

> > > > @@ -1057,9 +1060,9 @@
> > > >      d_val = stack_attack_value(dest_x, dest_y) * 30;
> > > >      if ((dcity = map_get_city(dest_x, dest_y))) {
> > > >        d_type = ai_choose_defender_versus(dcity, punit->type);
> > > > -      j = unit_types[d_type].hp * (do_make_unit_veteran(dcity, d_type)
> > ? 15
> > > > : 10) *
> > > > -          unit_types[d_type].attack_strength;
> > > > -      d_val += j;
> > > > +      d_val += base_get_attack_power(d_type,
> > > > +                                    do_make_unit_veteran(dcity, 
> > > > d_type),
> > > > +                                    SINGLE_MOVE) * 
> > > > unit_types[d_type].hp;
> > > 
> > > Here (as everywhere else) there should be belligerence instead of just
> > > attack*hp (compare to stack_attack_value above).  I suspect it's a
> > historical
> > > thing:  firepower wasn't in Civ I.  Firepower is completely missing in
> > > gotohand.c, for example.
> > 
> > Not in the scope of this patch.
> 
> Look, if you try to do a job, might as well do it properly.  Do you want 5
> patches changing the same lines back and forth?  I thought this is what you
> dreaded.

> If you are not prepared to do it properly, then commit the patch, it's an
> improvement anyway.  Others will finish what you left hanging.

Ok.

> P.S. I remember you saying, I quote, "strong indication for me to fix the
> things if you notice them (even if there aren't part of the original authors
> intentions)".  It seems you forget what you say...  

I had this in mind as I said: write down the problems which were
identified in the todo list.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Q:  Do you know what the death rate around here is?
 A:  One per person.


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