]> git.pond.sub.org Git - empserver/commit
power: Make item power value configurable
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 27 May 2016 19:18:47 +0000 (21:18 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:45 +0000 (19:59 +0200)
commit8e187c566fa1011614cf9c0a9673a9eea100423c
tree2db2efe59b79711f5baed3410d6003765cd2b5bc
parent5917841bfcaa9e05015ab2e256fb2bd0d4bdc5f3
power: Make item power value configurable

Custom games may want to tweak how items contribute to the power
factor, in particular when products are also customized.  Add ichrstr
member i_power and item selector power for that.

"info power" doesn't reflect this change, yet.  It'll be updated in
the next commit.

The current item power values are problematic.  This will be addressed
later.

For straightforward configurations, reasonable item power values could
perhaps be derived from the configuration automatically.  However,
this is surprisingly hard in the general case: since producing things
should not decrease power, the efficiency of processing products into
other products needs to be considered, and estimating these
efficiencies can be difficult.

Deities can create multiple products making the same item, or multiple
sector types with the same product, but different process efficiency
(sect-chr selector peffic).  Providing differently efficient ways to
make the same item can be reasonable when the sector types involved
have different terrain.  To average them, you'd need to know the map.

The stock game has one example: gold mines produce dust with 100%
process efficiency, mountains produce it with 75%.  Mountains are
normally rare enough not to matter.

Level p.e. (product selectors nlmin, nllag) may have to be considered.
In the stock game, level p.e. variations are minor, because it reaches
0.9 pretty quickly.  In games where it doesn't, you might have to
increase the power value of the product.

Resources (sect selectors min, gold, fert, ocontent, uran) and
resource depletion (product selectors nrndx and nrdep) further
complicate things: you might want to increase the power value of
products depending on unusually scarce resources, but you can't know
what's scarce without understanding the map.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/item.h
src/lib/commands/powe.c
src/lib/common/nsc.c
src/lib/global/item.config
tests/empdump/errors.err
tests/version/journal.log