]> git.pond.sub.org Git - empserver/commit - src/lib/global/sect.config
config: Define sector build cost per 100% instead of 1%
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 5 Jun 2016 18:00:27 +0000 (20:00 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:58 +0000 (19:59 +0200)
commit826fcf009b064aed0b7de034ec64de27e96a0491
tree2bcffddfb64edf4e98108b6e8048f3bbc959797d
parent16bf0d28b2d9d14e6d5a09a8e67f01c746c0ab4a
config: Define sector build cost per 100% instead of 1%

Sector build cost is defined by sect-chr column build (struct dchrstr
member d_build).  It's the cost per point of efficiency.  In contrast,
unit build cost is defined for 100%, by ship-chr, plane-chr, land-chr,
nuke-chr column cost.

Switch sectors to cost per 100%, for flexibility and consistency:
replace struct dchrstr member d_build by d_cost, and replace selector
build by selector cost.  Naming it cost for consistency with units is
possible only because the previous commit made the name available.

This is an xdump compatibility break.  To provide the customary grace
period, we'd have to make selector build virtual instead, with value
bcost / 100 rounded up, and deprecate it.  Deities would have to avoid
bcost values that aren't multiples of 100 for this to work fully.  But
we're not bothering with maintaining xdump compatibility in this
release.

With bcost values that aren't multiple of 100, the cost of sector
building may have to be rounded.  On the one hand, the cost of sector
demolition has always been rounded up.  On the other hand, the cost of
producing stuff is rounded randomly.  For now, round up, because
rounding randomly would affect subsequent random rounding, and upset
the smoke test.

Fortunately, show se b already shows build costs per 100%, since
commit 48ff096, v4.3.23.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/sect.h
src/lib/common/nsc.c
src/lib/global/sect.config
src/lib/subs/show.c
src/lib/update/sect.c
tests/version/journal.log