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>
This commit is contained in:
Markus Armbruster 2016-05-27 21:18:47 +02:00
parent 5917841bfc
commit 8e187c566f
6 changed files with 55 additions and 57 deletions

View file

@ -86,6 +86,7 @@ tests/empdump/xundump-errors/fld-malstr:2: malformed string in field 1
tests/empdump/xundump-errors/fld-many:2: too many fields, expected only 6
tests/empdump/xundump-errors/fld-miss:2: field 'name' missing
tests/empdump/xundump-errors/fld-miss:2: field 'mnem' missing
tests/empdump/xundump-errors/fld-miss:2: field 'power' missing
tests/empdump/xundump-errors/fld-miss:2: field 'value' missing
tests/empdump/xundump-errors/fld-miss:2: field 'sell' missing
tests/empdump/xundump-errors/fld-miss:2: field 'lbs' missing

View file

@ -952,12 +952,13 @@
Play#0 output Play#0 1 "uid" 4 0 0 16
Play#0 output Play#0 1 "name" 3 0 0 -1
Play#0 output Play#0 1 "mnem" 13 4 1 -1
Play#0 output Play#0 1 "power" 8 0 0 -1
Play#0 output Play#0 1 "value" 8 0 0 -1
Play#0 output Play#0 1 "sell" 8 0 0 -1
Play#0 output Play#0 1 "lbs" 8 0 0 -1
Play#0 output Play#0 1 "pkg" 8 0 5 -1
Play#0 output Play#0 1 "melt_denom" 8 0 0 -1
Play#0 output Play#0 1 /8
Play#0 output Play#0 1 /9
Play#0 output Play#0 6 0 640
Play#0 input xdump meta 17
Play#0 command xdump
@ -1451,20 +1452,20 @@
Play#0 input xdump item *
Play#0 command xdump
Play#0 output Play#0 1 XDUMP item 0
Play#0 output Play#0 1 0 "civilians" "c" 1 0 1 1 10 10 10 10 4
Play#0 output Play#0 1 1 "military" "m" 0 1 1 1 1 1 1 1 20
Play#0 output Play#0 1 2 "shells" "s" 5 1 1 1 1 10 1 1 80
Play#0 output Play#0 1 3 "guns" "g" 60 1 10 1 1 10 1 1 100
Play#0 output Play#0 1 4 "petrol" "p" 4 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 5 "iron\\040ore" "i" 2 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 6 "dust\\040(gold)" "d" 20 1 5 1 1 10 1 1 100
Play#0 output Play#0 1 7 "bars\\040of\\040gold" "b" 280 1 50 1 1 5 1 4 200
Play#0 output Play#0 1 8 "food" "f" 0 1 1 1 1 10 1 1 2
Play#0 output Play#0 1 9 "oil" "o" 8 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 10 "light\\040products" "l" 2 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 11 "heavy\\040products" "h" 4 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 12 "uncompensated\\040workers" "u" 1 1 2 1 1 2 1 1 2
Play#0 output Play#0 1 13 "radioactive\\040materials" "r" 150 1 8 1 1 10 1 1 1000
Play#0 output Play#0 1 0 "civilians" "c" 100 1 0 1 1 10 10 10 10 4
Play#0 output Play#0 1 1 "military" "m" 100 0 1 1 1 1 1 1 1 20
Play#0 output Play#0 1 2 "shells" "s" 80 5 1 1 1 1 10 1 1 80
Play#0 output Play#0 1 3 "guns" "g" 400 60 1 10 1 1 10 1 1 100
Play#0 output Play#0 1 4 "petrol" "p" 2 4 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 5 "iron\\040ore" "i" 10 2 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 6 "dust\\040(gold)" "d" 200 20 1 5 1 1 10 1 1 100
Play#0 output Play#0 1 7 "bars\\040of\\040gold" "b" 1000 280 1 50 1 1 5 1 4 200
Play#0 output Play#0 1 8 "food" "f" 0 0 1 1 1 1 10 1 1 2
Play#0 output Play#0 1 9 "oil" "o" 100 8 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 10 "light\\040products" "l" 100 2 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 11 "heavy\\040products" "h" 200 4 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 12 "uncompensated\\040workers" "u" 0 1 1 2 1 1 2 1 1 2
Play#0 output Play#0 1 13 "radioactive\\040materials" "r" 0 150 1 8 1 1 10 1 1 1000
Play#0 output Play#0 1 /14
Play#0 output Play#0 6 0 640
Play#0 input xdump product *
@ -2172,20 +2173,20 @@
Play#1 input xdump item *
Play#1 command xdump
Play#1 output Play#1 1 XDUMP item 0
Play#1 output Play#1 1 0 "civilians" "c" 1 0 1 1 10 10 10 10 4
Play#1 output Play#1 1 1 "military" "m" 0 1 1 1 1 1 1 1 20
Play#1 output Play#1 1 2 "shells" "s" 5 1 1 1 1 10 1 1 80
Play#1 output Play#1 1 3 "guns" "g" 60 1 10 1 1 10 1 1 100
Play#1 output Play#1 1 4 "petrol" "p" 4 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 5 "iron\\040ore" "i" 2 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 6 "dust\\040(gold)" "d" 20 1 5 1 1 10 1 1 100
Play#1 output Play#1 1 7 "bars\\040of\\040gold" "b" 280 1 50 1 1 5 1 4 200
Play#1 output Play#1 1 8 "food" "f" 0 1 1 1 1 10 1 1 2
Play#1 output Play#1 1 9 "oil" "o" 8 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 10 "light\\040products" "l" 2 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 11 "heavy\\040products" "h" 4 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 12 "uncompensated\\040workers" "u" 1 1 2 1 1 2 1 1 2
Play#1 output Play#1 1 13 "radioactive\\040materials" "r" 150 1 8 1 1 10 1 1 1000
Play#1 output Play#1 1 0 "civilians" "c" 100 1 0 1 1 10 10 10 10 4
Play#1 output Play#1 1 1 "military" "m" 100 0 1 1 1 1 1 1 1 20
Play#1 output Play#1 1 2 "shells" "s" 80 5 1 1 1 1 10 1 1 80
Play#1 output Play#1 1 3 "guns" "g" 400 60 1 10 1 1 10 1 1 100
Play#1 output Play#1 1 4 "petrol" "p" 2 4 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 5 "iron\\040ore" "i" 10 2 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 6 "dust\\040(gold)" "d" 200 20 1 5 1 1 10 1 1 100
Play#1 output Play#1 1 7 "bars\\040of\\040gold" "b" 1000 280 1 50 1 1 5 1 4 200
Play#1 output Play#1 1 8 "food" "f" 0 0 1 1 1 1 10 1 1 2
Play#1 output Play#1 1 9 "oil" "o" 100 8 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 10 "light\\040products" "l" 100 2 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 11 "heavy\\040products" "h" 200 4 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 12 "uncompensated\\040workers" "u" 0 1 1 2 1 1 2 1 1 2
Play#1 output Play#1 1 13 "radioactive\\040materials" "r" 0 150 1 8 1 1 10 1 1 1000
Play#1 output Play#1 1 /14
Play#1 output Play#1 6 0 0
Play#1 input xdump product *