Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_c
Home

[Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7236) removal of most direct references to build_cost
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Mon, 2 Feb 2004 03:48:36 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7236 >

On Mon, 2 Feb 2004, Raimar Falke wrote:
> > ai/aicity.c, line ~452:
> >
> >   if (bestchoice.type == CT_ATTACKER
> >       && buycost > unit_types[bestchoice.choice].build_cost * 2) {
> >      /* Too expensive for an offensive unit */
> >      continue;
> >   }
> >
> > I chose unit_buy_gold_cost here because buycost is a gold cost.

Correct.

> > server/cityturn.c, line ~1200
> >
> >unit_list_iterate(map_get_tile(pcity->x,pcity->y)->units, punit) {
> >   cost += unit_type(punit)->build_cost * game.incite_cost.unit_factor;
> > } unit_list_iterate_end;
> >
> > /* Buildings */
> > built_impr_iterate(pcity, i) {
> >   if (!is_wonder(i)) {
> >     cost += improvement_value(i) * game.incite_cost.improvement_factor;
> >   } else {
> >     cost += improvement_value(i) * 2 *
> > game.incite_cost.improvement_factor;
> >   }
> > } built_impr_iterate_end;
> >
> > I set these to buy costs because I wanted to make sure the calculation
> > for inciting the city was independent of the number of shields and more
> > a reflection of the buying cost. If my accelerated production patch
> > were applied here, the price of inciting a city would drop.

Why shouldn't it? The relative value of the buildings would drop as they
become faster to build. I don't really care either way, though.

> Both are AI estimates. I think the original code was already a
> kludge.

The second is not AI code. The first, while not very good code, is not a
kludge.

  - Per




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