]> git.pond.sub.org Git - empserver/commit
update: Limit avail roll over to about half the update's work
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Jun 2016 10:48:05 +0000 (12:48 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:59 +0000 (19:59 +0200)
commit6fcbc16adf30ee3090910b2c7a58d5ccd8f1cf02
treed807a8c66cc540f62545bc17892e098ce4d9dd7a
parentd3c1da354d39834449f4275718d3691f5789732f
update: Limit avail roll over to about half the update's work

Traditionally, unused unused available work is discarded at the
update.  Since commit d7a054c (v4.2.13), deities can configure (some)
unused work to "roll over", i.e. available work = some unused work +
this update's work.

Not discarding unused work reduces micromanagement incentives.
However, it also leads to unobvious behavior.

For instance, here's the obvious way to build a radar station: move in
enough people to make 200 work.  Half of it is available for sector
building, and increases efficiency to 100%.  Here's a not-so-obvious
way: move in enough people to make 134 work.  67 will be used to
increase efficiency to 67%.  Now move your workers elsewhere.  The
unused available work is enough to finish the job at the next update.

Similarly, neighbors could be surprised by sectors building bridges
despite having no visible workers.

Commit 7f4e59f (v4.2.15) let deities limit the amount rolled over:
unused work above rollover_avail_max is discarded.  This became the
default with a value of 50 in commit 81a3e4c4, v4.3.31.

Limit it further so that "roll over" can increase the update's work by
no more than half, plus one.  The extra point is there so that even a
tiny work force has a chance to eventually eke out the second point of
work needed to increase efficiency.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/update/human.c
tests/smoke/final.xdump
tests/smoke/journal.log
tests/update/final.xdump
tests/update/journal.log