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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7236) removal of most direct references to build_cost
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Wed, 4 Feb 2004 02:38:54 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [i-freeciv-lists@xxxxxxxxxxxxx - Mon Feb 02 12:30:54 2004]:
> 
> On Mon, Feb 02, 2004 at 03:48:36AM -0800, Per I. Mathisen wrote:
> > The first, while not very good code, is not a kludge.
> 
> It compares gold with shields directly. Or is the factor of 2 the
> exchange between gold and shields?
> 

I think that's what the AI code was assuming.  The comment a couple
lines above, /* It costs x2 to buy something with no shields contributed
*/, is a pretty big clue. :)

Although, if the AI code doesn't know that a unit from scratch costs
2x+x*x/20, the line doesn't make much sense.  In that context, it would
pretty much mean "Is the production box empty?"  

I think this particular line doesn't want to rush an attack unit if the
x*x/20 term in the gold cost isn't covered by already produced shields.
 In other words, if it's the same price or lower in gold as rushing a
similarly-priced building.  There are plenty of other ways of
interpreting this one check, though, so I might be wrong.

By the way, in case I haven't left enough context, I'm still talking
about ai/aicity.c, line ~452.

-James Canete


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