Complete.Org: Mailing Lists: Archives: freeciv-dev: June 1999:
Re: [Freeciv-Dev] [2 x Patch] struct government + unit upkeep
Home

Re: [Freeciv-Dev] [2 x Patch] struct government + unit upkeep

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] [2 x Patch] struct government + unit upkeep
From: "Bobby D. Bryant" <bdbryant@xxxxxxxxxxxxxxx>
Date: Thu, 03 Jun 1999 22:26:02 -0500

Sune Kirkeby wrote:

> Second is the unit upkeep patch, which removes the hardcoded
> unit upkeep costs, and replaces them with values from four new
> fields in units.rulesets. (The fourth being a recently suggested
> suggested gold upkeep cost).

Keep in mind that upkeep is a function both of unit type *and* government
type.  What you want to implement might require a slightly more complicated
scheme, such as adding an "upkeep class" flag to units.ruleset (rather than
the explicit upkeep costs), and then adding the effects of the "upkeep
classes" wherever the government info is stored.

As an example, upkeep classes might include "settlers", "military", etc., and
their costs would be itemized per class (not per unit) under each of the
government definitions, crudely something like this -

--- units.ruleset ---
[units]

; "Longname unit", g#, T,  bc, at, de, mv, v, c, hp, f, u upkeep_class
...
"Engineers",       42, 1,  40,  0,  2,  2, 1, 0, 20, 1, 0, "settlers"
...
"Alpine Troops",   45, 1,  50,  5,  5,  1, 1, 0, 20, 1, 0, "military"
...

--- governments.ruleset (or techs.ruleset) ---

[governments]

; name    max tax, max res, max lux, corruption, blah, blah, ...
"The Principate"    blah, blah, blah, ...

; upkeep    H S F G
"settlers"    0 0 1 1
"military"    0 0 1 0
...

"Medieval Repbulic"    blah, blah, blah, ...

"settlers"    0 10
"military"    0 0 1 0
...

...


Even the above crude outline does not allow management of how many units must
exist before the costs come into play, which I presume would be specified in
the government definitions.  For instance, IIRC a monarchy allows up to three
units of any type without shield costs, but settlers have a food cost
regarless of how many units of any type exist.  How should the new scheme
handle this?  More flexible --> more code and more .ruleset dependencies.

And again, keep in mind that it might be desirable to allow a modpack
designer to define the number of upkeep classes as well as the number of
government types, and write the code accordingly.  Keep everything as
ruleset-driven as possible.

Bobby Bryant
Austin, Texas



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