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: Tue, 24 Feb 2004 02:26:33 -0800
Reply-to: rt@xxxxxxxxxxx

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

Function comments added.

I suppose it's not waiting on anything important.  The place I mentioned
in ai/aicity.c before has to be kept track of in case the function
calculating the amount of gold ever changes, and I can't think of an
elegant solution to the issue I had in server/cityturn.c.

This patch was designed to make the build_cost field in the unit_type
and impr_type structs more of a generalized value than the exact number
of shields it takes to build that particular target.  This was done
because it was referred to even when the desired value was the rushing
cost or the disband cost, and a lot of lone, unconnected constants were
spread around the code because of it.  Mostly multiplies by two.  :)

I had the idea of changing the field to something else, like
general_value or something, but it would require a lot of changes to the
rulesets and probably a lot of the code.

Perhaps a better idea would've been to make a set of constants that give
the exact ratio when converting from shields to gold or gold to shields,
ie SHIELDSTOGOLD = 1 (when selling), GOLDTOSHIELDS = 2 (when rushing),
etc.  However that wouldn't deal with the x^2/20+2x function when
rushing a unit.

Anyway, should all these "exchange rates" be intrinsically tied to the
shield cost, making accelerated production and the like affect all
costs, or should they be tied to some higher level "value", so we can
have a separate shield factor and gold factor?

-James Canete

Attachment: build_cost-ref-removal13.diff
Description: Binary data


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