Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: [PATCH] advdomestic.c cleanup (PR#1149)
Home

[Freeciv-Dev] Re: [PATCH] advdomestic.c cleanup (PR#1149)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] advdomestic.c cleanup (PR#1149)
From: Ben Webb <ben@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Dec 2001 08:48:11 -0800 (PST)

On Thu, 20 Dec 2001, Petr Baudis wrote:

> Dear diary, on Thu, Dec 20, 2001 at 03:56:35PM CET, I got a letter,
> where Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
>
> > The below is very anti-generalised improvements, right?
> > 
> > > +  /* Count production bonuses generated by various buildings. */
> > > +  if (city_got_building(pcity, B_FACTORY) || impr_type == B_FACTORY) {
> > > +    prodbonus += 50;
> > > +    if (city_got_building(pcity, B_MFG) || impr_type == B_MFG) {
> > > +      prodbonus *= 2;
> > >      }
> Whole pollution_cost was very anti-generalised improvements.

        This is true. However, generalised improvements hasn't touched any 
of the AI code yet (mainly because it looks scary, and I don't want to 
mess with it until I understand it). If and when the base code for 
generalised improvements is added to CVS, however, I will take a look at 
writing some suitable generalised code for the AI.

> But this is step in the right direction, IMHO, as I think it's still much
> better than if B_FACTORY, add 100 if B_MFG, else add 50.

        Point of information: these "magic" numbers are defined in the 
buildings ruleset.

> Generalised improvements is also reason why I'm going to skip ai_build_eval()
> this time, as such an effort hasn't big mean for now.

        Indeed; this is the main target for generalised improvements + AI. 
It's relatively trivial to rewrite with the current impr-gen patches so 
that it uses ruleset information; however, there are a few gotchas (mainly 
with building and effect dependencies, that kind of thing). I'm quite 
happy to rewrite this routine at some point in the not-so-distant future, 
however. Hopefully the other AI cleanup patches will make my job that 
little bit easier when I try to understand the code. ;)

        Ben
-- 
ben@xxxxxxxxxxxxxxxxxxxxxx           http://bellatrix.pcl.ox.ac.uk/~ben/
"We are ready for any unforeseen event that may or may not occur."
        - Vice President Dan Quayle, 9/22/90




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: [PATCH] advdomestic.c cleanup (PR#1149), Ben Webb <=