]> git.pond.sub.org Git - empserver/commit
update: Round the people's work randomly rather than down
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Jun 2016 12:26:29 +0000 (14:26 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:59 +0000 (19:59 +0200)
commitd3c1da354d39834449f4275718d3691f5789732f
tree62955ac8447bd7cd1338d36f0c0db26b5c4bd205
parentc6a6c7296feb9259b57f432079366c90ccdd0acc
update: Round the people's work randomly rather than down

Rounding work down can lead to a bit of work micromanagement.  For
instance, four military on a lonely island accomplish nothing in 60
ETU updates, but five will make one point of work per update.  They
can build a 2% harbor in four updates, as long as rollover_avail_max
is at least 3.  Six to eight will be no faster.

The people's work used to be rounded randomly until Empire 3's big
effort to make the update code work for budget switched to rounding it
down, perhaps accidentally.

Switch back to rounding randomly, so that players don't have to get it
exactly right.  Four military now get to 2% in five updates on
average, five in four, six or seven in three, and so forth.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
18 files changed:
src/lib/update/populace.c
tests/smoke/04/01-1
tests/smoke/05/01-1
tests/smoke/06/01-1
tests/smoke/07/01-1
tests/smoke/08/08-8
tests/smoke/09/08-8
tests/smoke/10/08-8
tests/smoke/11/08-8
tests/smoke/12/08-8
tests/smoke/13/08-8
tests/smoke/14/02-2
tests/smoke/14/08-8
tests/smoke/15/08-8
tests/smoke/final.xdump
tests/smoke/journal.log
tests/update/final.xdump
tests/update/journal.log