]> git.pond.sub.org Git - empserver/commit
collect: Derive collection value from power value
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 11 Jun 2016 19:30:52 +0000 (21:30 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:59 +0000 (19:59 +0200)
commitd9e46779263ce9da22ca82a679fa68d692c3aa8d
treed38a6f8e7906211baa80cd495ecfd60bf6e27443
parent6ec936a8d6e3975f45edd8ce53d6ad9ebf02e3b5
collect: Derive collection value from power value

The collection value of a sector is

    sector value = sector type value * (sector efficiency + 100)
                 + sum of item values
    item value = item type value * amount

The sector and item type values are configurable.

The item type collect values aren't too far off the power values:

    uid mnem  pow val pow/val
      0  "c"   50   1   50
      1  "m"  100   0  inf
      2  "s"  125   5   25
      3  "g"  950  60   15.8
      4  "p"    7   4    1.75
      5  "i"   10   2    5
      6  "d"  200  20   10
      7  "b" 2500 280    8.9
      8  "f"    0   0  NaN
      9  "o"   50   8    6.25
     10  "l"   20   2   10
     11  "h"   40   4   10
     12  "u"   50   1   50
     13  "r"   50 150    0.33

The power value is very roughly ten times the collect value, except
for civilians and uw it's 50, for rads its 0.33, and military are free
to collect.  The latter two make no sense.

Replace the item type collect value by the power value / 50 for
people, and by the power value / 10 for everything else.  This makes
collecting military, shells, guns and uw more expensive, and petrol,
bars, iron, oil and rads cheaper.

The sector type values are basically arbitrary.  For instance, an iron
mine costs five times as much as a wilderness, but a third of an
uranium mine, regardless of actual resource contents.

Replace this by different arbitrary values:

    sector value = (item value of materials necessary to build it
                    + build cost) * efficiency / 100
 + sector type maximum population
                 + sum of item values

Some sector types become cheaper, some more expensive.

Drop sect-chr and item selector value.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
16 files changed:
include/item.h
include/sect.h
info/Item-types.t
src/lib/commands/coll.c
src/lib/common/nsc.c
src/lib/global/item.config
src/lib/global/sect.config
src/lib/subs/show.c
tests/empdump/errors.err
tests/empdump/xundump-errors/colhdr-dup3
tests/empdump/xundump-errors/colhdr-idxbig
tests/empdump/xundump-errors/colhdr-idxneg
tests/empdump/xundump-errors/colhdr-idxreq
tests/empdump/xundump-errors/colhdr-unexp2
tests/empdump/xundump-errors/fld-miss
tests/version/journal.log