[Freeciv-Dev] (PR#10116) RFC: gen-output
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10116 >
After gen-terrain and gen-specialists, and before gen-activities and
gen-specials, comes gen-output ;-).
Output includes food, shields, trade, tax, luxury, science. It may
include pollution, global warming progress, nuclear winter progress.
In general different forms of output follow a lot of the same rules.
Thus one short-term motivation here is to allow these rules to be
merged. As an example the functions get_city_xxx_bonus,
get_tile_xxx_base, get_xxx_tile, city_get_xxx_tile, base_get_xxx_tile,
gitygov_free_xxx all follow nearly the same pattern. The same is true
of data structures like pcity->xxx_prod, pcity->xxx_surplus,
pcity->xxx_stock, ptile->xxx, ptile->xxx_special_1,
ptile->xxx_special_2, ptile-><activity>_xxx_incr, utype->xxx_cost,
utpye->xxx_cost, punit->upkeep_xxx. This is especially true in the CM
code which already has a somewhat generalized concept of "output". It's
true of effects too: EFT_XXX_BONUS, EFT_XXX_PER_TILE, EFT_XXX_ADD_TILE,
EFT_XXX_INC_TILE.
Another short-term goal would be minor modification of the output types.
Changing the names of the types, for instance, shouldn't be very hard
and may be useful for modpacks.
The long-term goal would be total generalization of the types of output,
allowing great variation to the rules. It's not clear that this is
possible, but I don't know now of a reason why it wouldn't be. There
are a number of rules for output that are pretty simple and
generalizable. Some forms of output can be converted into other forms
(trade->gold, shield->pollution, pollution->warming). Some forms of
output are "collected" at a certain range: food and shields are
collected by the city, gold and science are collected by the player,
warming is collected by the world. Some forms of output may be
converted, voluntarily or involuntarily, into "items":
shields->units/buildings, gold->units/buildings, science->technologies.
Here things become more complicated because there are special-cases,
and it's not clear that full generalization is possible.
In you imagine a ruleset like MoM, the types of output, specialists, and
effects, are quite different *but follow most of the same rules*. Food
and shields are produced by specialists; there are no workers (terrains
and specials give direct bonuses to the city without having to be
worked). Specialists, terrain, and buildings can add on "power" (an
output type) directly. Power is then converted globally into mana
(stored globally, and used for upkeep as well as to build an item:
spells), research (used to build an item: spelltypes), and skill (which
is pretty much a special case).
jason
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#10116) RFC: gen-output,
Jason Short <=
|
|