update budget: Fix civ counting for happiness and education

Per-civilian happiness and education production is raw production
divided by the number of old-owned civilians.  The update reports the
number of old-owned civilians ("total pop was %d").

This number of civilians is also used by budget to predict cost of
tech when option TECH_POP is enabled, but that doesn't match how the
update computes the cost.  To be fixed next.

Civilians loaded on ships are only counted by the update, not by
budget.  Harmless, as budget doesn't compute happiness and education.
Civilians loaded on land units are ignored by both.  None of the stock
game's land units can load civilians.

Civilians in sectors are counted before plague deaths, and in ships
afterwards.

Fix upd_ship() and upd_land() to count civilians the same way as
prepare_sects() does for sectors.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-19 13:01:52 +02:00
parent 6eb4fd3cbf
commit 14f3bd9717
4 changed files with 5 additions and 4 deletions

View file

@ -527,7 +527,7 @@
Play#0 output Play#0 1 medical discoveries (2.92) produced in -7,7
Play#0 output Play#0 1 medical discoveries (3.60) produced in -5,7
Play#0 output Play#0 1 78 happiness, 178 education produced
Play#0 output Play#0 1 total pop was 28106, yielding 14.19 hap, 24.57 edu
Play#0 output Play#0 1 total pop was 28109, yielding 14.19 hap, 24.57 edu
Play#0 output Play#0 1 3.5668 tech, 3.5102 research produced
Play#0 output Play#0 1 Army delta $-2810, Navy delta $-3726, Air force delta $-2567
Play#0 output Play#0 1 money delta was $-12027 for this update
@ -1386,7 +1386,7 @@
Play#0 output Play#0 1 Technology level too low to produce in -5,-1 (need 40)
Play#0 output Play#0 1 Education level too low to produce in -3,-1 (need 5)
Play#0 output Play#0 1 0 happiness, 0 education produced
Play#0 output Play#0 1 total pop was 24000, yielding 0.00 hap, 0.00 edu
Play#0 output Play#0 1 total pop was 24080, yielding 0.00 hap, 0.00 edu
Play#0 output Play#0 1 1.7834 technology (0.0000 + 1.7834), 1.7551 research (0.0000 + 1.7551) produced
Play#0 output Play#0 1 Army delta $-600, Navy delta $-300, Air force delta $0
Play#0 output Play#0 1 money delta was $-6250 for this update