Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: [PATCH2] Re: AI questions
Home

[Freeciv-Dev] Re: [PATCH2] Re: AI questions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Raahul Kumar <raahul_da_man@xxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH2] Re: AI questions
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Sun, 25 Nov 2001 12:48:00 +0100

> >    for (id = 0; id < game.num_impr_types; id++) {
> >      /* selling walls to buy defenders is counterproductive -- Syela */
> > -    if (can_sell_building(pcity, id) && id != B_CITY) {
> > +    /* Selling palace too. Virtually selling of every building with
> > +     * original upkeep 0. We can't exempt all buildings with real
> > +     * upkeep 0 because e.g. B_ASMITHS. --pasky */
> > +    if (can_sell_building(pcity, id) && improvement_types[i].upkeep) {
> 
> This is such a place where more then just the change is required. Yes I would
> agree that the change is reasonable at first sight. However you have to
> understand it. So the question is which improvements make
> "can_sell_building(pcity, id) && improvement_types[i].upkeep" true and aren't
> city walls or the palace. This would be one extra check and a freelog and a
> test run. However you have to keep in mind that can_sell_building depends on
> the city.
Thanks for hints. Anyway, what we have ruleset files for? I checked that in
default/buildings.ruleset, and only city walls, palace, space improvements,
coinage and wonders have upkeep 0.

> So this becames:
> 
>    for (id = 0; id < game.num_impr_types; id++) {
>      if((!is_wonder(id)) && improvement_types[id].upkeep)
      if((can_sell_building(pcity, id) && improvement_types[id].upkeep)
/* rather? We have to check also if it's even already built ;) */
>      {
>         if(id!=B_CITY && id!=B_PALACE)
>            freelog(LOG_NORMAL,"%d",id);
>      }
> 
> Can you test this?
Obviously I can. Anyway, I ran into some weird problems, ending with my test
game around 1760, then it abort()s it seems. I suspect it has nothing to do
with my changes however, I will investigate it too.

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC
Real Users hate Real Programmers.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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