empserver/tests/update/99-POGO
Markus Armbruster 66edd2baca update: Don't use materials and work destroyed by che or plague
Update code shared with budget uses the bp map instead of the sector,
so that budget can track materials and work available in sectors for
ship, plane and land unit building without updating the sector file.
Unfortunately, the bp map can become stale during the update.

prepare_sects() doesn't update the bp map for sea sectors, unlike
budget's calc_all().  Instead, we rely on calloc()'s initialization.
Works, but is a bit unclean.

prepare_sects() updates the bp map after fallout, but neglects to
update it for any of the later sector updates (steps 1b to 1f in info
Update-sequence).  Che can destroy materials and available work, and
the plague can kill military.  The bp map stays out of date until
produce_sect() updates it again.

Since we deal with sector production and countries in increasing order
of country number, foreign ships, planes and land units owned by
countries with lesser numbers get built before their sector produces.
Building uses the stale bp map then, and can use materials and
available work destroyed by che or the plague.  The update test
demonstrates the former case.

For stopped sectors or when the owner is broke, produce_sect() updates
only materials in the bp map, not available work.  Nothing builds in a
stopped sector, but allies may build in your sectors even when you're
broke.  They can use available work destroyed by che then.

Screwed up when Empire 3 made the update code work for budget.

Note that budget bypasses the flawed code: it prepares its bp map
itself instead of calling prepare_sects().

Rather than fixing prepare_sects(), use a null bp map for the update:
writes become no-ops, and reads read from the underlying sector.  Not
only does this remove the possibility of the bp map going stale during
the update, it saves a bit of memory, too.

calloc()'s initialization is now dead.  Switch to malloc().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 19:59:58 +02:00

236 lines
5.7 KiB
Text

force
show updates
power
read 0
|| country#1
| pop growth
| 2,0 1f for 83+83 babies make 83c 83u
| 4,0 2f for 166+166 babies make 166c 105u
| 6,0 3f for 250+250 babies make 210c 105u
| 8,0 plenty of food make -1000c 100u pop limit
| starvation
| 1,1 33u
| 3,1 100u 33c
| 5,1 100u 50c
| 7,1 100u 20c 30m
| 9,1 16c
| 11,1 6c
| 15,1 16m
| ship#42 25m
| 43 30u 3c
| land#42 25m
| BUG: che don't age in 1,1
| sector building
| 0,2 0% stopped
| 2,2 100% -> 84%-88% 7.8 work, 4 left
| 4,2 100% -> 0% -> 14% 78 work, 39 left
| 6,2 100% -> 0% -> 100% 273 work, 148 left
| 8,2 1% no materials
| 10,2 1% -> 11% f 10h
| 12,2 1% -> 11% c 10l 20h, 30h left
| ship building
| 60 stopped
| 61 neutral harbor
| 70..73 +0.5% at sea
| 74 +1% at sea
| 75 +1% at sea
| 76 +2% at sea limit 80%
| 90/91 friendly harbor with and without work
| BUG: 91 not built
| 92/93 +0% friendly city without work
| odd: cities don't repair ships
| 95 +80% own harbor
| 97 +20% own harbor, materials limit
| 103 +13% at sea
| 104 +13% at sea
| 113 +5% at sea
| 114 +5% at sea
| plane building
| 60 stopped
| 61 friendly airfield
| 70 +2% carrier at sea
| 71 +1% carrier at sea up to limit 80%
| 72 +1% carrier in allied airfield up to limit 80%
| 75..78 +7.5% allied carrier in friendly airfield
| BUG: avoids "no airfield" malus, uses airfield materials
| 80 +30% in the field
| 81 +20% in the field (weird limit "at most (100-eff)/3")
| 82 no work
| 90/91 +90% allied airfield with and without work
| BUG: 91 not built
| 92/93 +30% allied city without work
| BUG: 92 not built
| 95 +50% own airfield
| 97 +50% own airfield
| 100 allied airfield where plague killed off mil
| land unit building
| 60 stopped
| 61 friendly hq
| 80 +30% in the field
| 81 +20% in the field (weird limit "at most (100-eff)/3")
| 82 no work
| 90/91 allied fort/hq with and without work
| BUG: 91 not built
| 92/93 +30% allied city without work
| BUG: 92 not built
| 95 +90% own hq
| 97 +50% own hq, materials limit
| 98 +90% own fort
| produce sect
| make units avail
| 1,3 m 0i 0 stopped
| 3,3 m 0i 39 inefficient
| 9,3 e 0m 93.6 mil limit
| 11,3 e 30m 78
| 13,3 e 45m 39.6
| -16,4 m 7i 8
| -14,4 m 78i 0
| -12,4 m 26i 1.3
| -8,4 g 7d 8
| -6,4 g 78d 0
| -4,4 g 500d 700 resource limit
| -2,4 ^ 45d 0
| 0,4 a 57.8f 8
| 2,4 a 643.5f 0
| 4,4 a 999f 478.9 product limit
| 8,4 o 6.4o 8
| 10,4 o 71.5o 0
| -15,5 o 6.0u 8
| -13,5 u 66.9u 0
| -11,5 u 244.3u 915 resource limit
| -7,5 i 23.1s 26 0
| -5,5 i 44,4s 50 240
| -3,5 i 88.9s 100 90
| 1,5 d 3.6g 4 14
| 3,5 d 8.9g 10 230
| 9,5 % 693.3p 78 0
| 11,5 % 888.9p 100 56
| 13,5 % 999p 112.4 277.6 product limit
| -16,6 b 15b 15 3
| -14,6 b 20b 20 290
| -12,6 b 6b 6 1.0
| -8,6 j 71.5l 78 0
| -6,6 j 91.7l 100 290
| -4,6 j 999l 1089.8 110.2 product limit
| 0,6 k 35.8h 39 0
| 2,6 k 45.8h 50 290
| 4,6 k 19h 20.7 36.6 backlog
| -15,7 t 2.4 4 14
| -13,7 t 3.0 5 310
| -7,7 r 2.4 4 14
| -5,7 r 3.6 6 294
| 1,7 l 78 78 0
| 3,7 l 100 100 290
| 9,7 p 78 78 0
| 11,7 p 0 0 78
| produce ship
| 100 +40.5f with 100% eff 10 fert
| 101 +405f with 100% eff 100 fert
| 102 stopped
| BUG: produces anyway
| 103 +243f with 60% eff
| 104 +81f with 20% eff
| 110 +5.14o 100% eff 10 ocont
| 111 +51.4o with 100% eff 100 ocont
| 112 stopped
| BUG: produces anyway
| 113 +29.0o-29.3o with 60% eff 94-95 ocont
| 114 +9.2-9.6o with 20% eff 91-93 ocont, 90-93 ocont left
read 1
nation 1
cens 0:15,0:3
comm 0:15,0:3
cens -16:15,4:7
comm -16:15,4:7
ship 0:31,0:15
carg 0:31,0:15
plane 0:31,0:15
land 0:31,0:15
|| country#2
| negative money delta
| starvation 0:15,0
| #30 lost 12% to lack of maintenance
| #31 lost 1%
| BUG: no sector maintenance
| sector building
| -16:-12,0 no money
| sector production
| -1,3 no money
| ship building
| 65 no money
| plane building
| 65 no money
| land unit building
| 65 no money
read 2
nation 2
cens -16:-1,0:3
comm -16:-1,0:3
peek -16:-1,0:3
ship -32:-1,0:15
plane -32:-1,0:15
land -32:-1,0:15
|| country#3
| civil unrest in 0:15,-8:-5
| loyalty recovery and conversion 0:15,-3
read 3
nation 3
cens 0:15,-8:-1
comm 0:15,-8:-1
peek 0:15,-8:-1
ship 0:31,-16:-1
plane 0:31,-16:-1
land 0:31,-16:-1
|| country#4
| che take over -16:-14,-8 and spread; -14,-8 is a bank
| plague stage 4 (dying) -16:-1,-6 ship#10 land#10
| -16,-6 reverts to deity
| -14,-6 resets work etc.
| -12,-6 mil all die
| -10,-6 resets work etc
| -8,-6 reverts to deity
| plague stage 3..1 -16:-1,-5:-3 ship#11..19 land#10..19
| plague stage 0 (healthy) -16:-9,-2, 50% chance to become exposed
| -5,-1 tech too low
| -3,-1 edu too low
read 4
nation 4
cens -16:-1,-8:-1
comm -16:-1,-8:-1
peek -16:-1,-8:-1
| #10 plague deaths
| #61/62 not repaired
ship -32:-1,-16:-1
| #1 sat moved
plane -32:-1,-16:-1
| #10 plague deaths
land -32:-1,-16:-1
|| country#5
| che retake -16:-14,-8
read 5
nation 5
|| country#6
| plane building
| 62 friendly airfield
| 96 allied airfield, no materials left
| land unit building
| 62 friendly hq
| 96 allied hq, no materials left
read 6
nation 6
cens 0:15,8
comm 0:15,8
|| country#7
| ship building
| 62 neutral harbor
| 96 friendly harbor, no materials left
read 7
nation 7
cens -16:-1,8
comm -16:-1,8
|| resource depletion
reso * ?min>0
reso * ?gold>0
reso * ?fert>0
reso * ?ocont>0
reso * ?uran>0