power: Saner power for items, ships, planes and land units

Items, ships, planes and land units all contribute to the power
factor, which determines position on the power chart.

Items are worth

    amount * item value * (0.5 + nation tech level / 1000.0)

The item values aren't quite right: producing stuff can *hurt* your
position on the power chart.  Food, uw and rads are worth nothng.

Reduce the value of oil, and give rads the same value as oil.  Tweak
value of iron and oil products so that production's power change is
roughly zero around p.e. 0.9 (tech 110), except for construction
materials, where it's zero at p.e. 0.5 (tech 0).  Construction
materials become less valuable, shells, guns and petrol become more
valuable.  Increase value of bars to roughly match the other changes.
It may still be too low.  Halve the value of civilians, and give the
other half to uw.  Results:

            old     new     change
    civ      100     50   / 2
    mil      100    100
    shell     80    125   * 1.5625
    gun      400    950   * 2.375
    pet        2      7   * 3.5
    iron      10     10
    dust     200    200
    bar     1000   2500   * 2.5
    food       0      0
    oil      100     50   / 2
    lcm      100     20   / 5
    hcm      200     40   / 5
    uw         0     50   new
    rad        0     50   new

Ships, planes and land units are worth

    base value * effic/100.0 * (0.5 + unit tech level / 1000.0)

For ships and land units, the base value is

    lcm/5.0 + hcm/5.0

Build cost is ignored, but lcms are valued twice as much "loose" ones
(before this commit).  Therefore, building stuff can change your
position on the power chart in both directions, depending on the type
of build.

For planes, the base value is

    20 * (0.5 + nation tech level / 1000.0)

Build cost and materials are ignored, and tech is squared.  This
is plainly absurd.

Unify to

    (power value of money and materials to build) * effic/100.0

This formula is chosen so that building stuff doesn't change your
power factor.  Bonus: it doesn't assume anything about possible build
materials.

For ships and land units, factoring in build cost overcompensates the
discounted value of construction materials more often than not.

Noteworthy changes for the stock game:

    ship type          old     new    change
    ss   slave ship     20     5.8    * 0.29    largest decrease
    cs   cargo ship     20     7.8    * 0.39
    ts   trade ship     60    25.5    * 0.42
    frg  frigate        12     7.8    * 0.65
    bb   battleship     24    21.8    * 0.91
    cal  light carrier  22    30.4    * 1.38
    can  nuc carrier    30    84.6    * 2.82    largest increase

    land unit type     old     new    change
    hat  hvy artillery  12     9.6    * 0.8     largest decrease
    linf light infantry  2.4   3.32   * 1.38
    cav  cavalry         3     5.4    * 1.8
    inf  infantry        3     5.4    * 1.8
    lar  lt armor        3     6.4    * 2.13
    com  commando        3    15.4    * 5.13
    eng  engineer        3    30.4    * 10.13
    meng mech engineer   3    45.4    * 15.13   largest increase

For planes, the power value change depends on the type.  Below a
certain nation tech level, planes of this type become more valuable,
above less.

For the stock game, planes costing at most $1000 become less valuable
at any nation tech level that can build them, and planes costing at
least $1800 become more valuable at any practical tech level,
i.e. under 400.  Noteworthy planes:

    plane type                 new
    sam  Sea Sparrow           2.1              least valuable
    f2   P-51 Mustang          4.34
    lb   TBD-1 Devastator      5.92
    jf1  F-4 Phantom          10.6
    tr   C-56 Lodestar        10.78
    jt   C-141 Starlifter     15.86
    jhb  B-52 Strato-Fortress 33.54
    ss   KH-7 spysat          41.2              most valuable

The old value is a flat 12 at nation tech level 100, 15 at tech level
250, and 18 at tech level 400.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-05-27 17:41:45 +02:00
parent 1307a3be6b
commit ea5c8a6598
Notes: Markus Armbruster 2017-08-14 20:30:51 +02:00
Partial fix for bug#133.
8 changed files with 276 additions and 256 deletions

View file

@ -577,20 +577,20 @@
Play#0 command show
Play#0 output Play#0 1 item power value sell lbs packing melt item
Play#0 output Play#0 1 mnem in no wh ur bk deno name
Play#0 output Play#0 1 c 100 1 no 1 1 10 10 10 10 4 civilians
Play#0 output Play#0 1 c 50 1 no 1 1 10 10 10 10 4 civilians
Play#0 output Play#0 1 m 100 0 yes 1 1 1 1 1 1 20 military
Play#0 output Play#0 1 s 80 5 yes 1 1 1 10 1 1 80 shells
Play#0 output Play#0 1 g 400 60 yes 10 1 1 10 1 1 100 guns
Play#0 output Play#0 1 p 2 4 yes 1 1 1 10 1 1 50 petrol
Play#0 output Play#0 1 s 125 5 yes 1 1 1 10 1 1 80 shells
Play#0 output Play#0 1 g 950 60 yes 10 1 1 10 1 1 100 guns
Play#0 output Play#0 1 p 7 4 yes 1 1 1 10 1 1 50 petrol
Play#0 output Play#0 1 i 10 2 yes 1 1 1 10 1 1 100 iron ore
Play#0 output Play#0 1 d 200 20 yes 5 1 1 10 1 1 100 dust (gold)
Play#0 output Play#0 1 b 1000 280 yes 50 1 1 5 1 4 200 bars of gold
Play#0 output Play#0 1 b 2500 280 yes 50 1 1 5 1 4 200 bars of gold
Play#0 output Play#0 1 f 0 0 yes 1 1 1 10 1 1 2 food
Play#0 output Play#0 1 o 100 8 yes 1 1 1 10 1 1 50 oil
Play#0 output Play#0 1 l 100 2 yes 1 1 1 10 1 1 100 light products
Play#0 output Play#0 1 h 200 4 yes 1 1 1 10 1 1 100 heavy products
Play#0 output Play#0 1 u 0 1 yes 2 1 1 2 1 1 2 uncompensated workers
Play#0 output Play#0 1 r 0 150 yes 8 1 1 10 1 1 1000 radioactive materials
Play#0 output Play#0 1 o 50 8 yes 1 1 1 10 1 1 50 oil
Play#0 output Play#0 1 l 20 2 yes 1 1 1 10 1 1 100 light products
Play#0 output Play#0 1 h 40 4 yes 1 1 1 10 1 1 100 heavy products
Play#0 output Play#0 1 u 50 1 yes 2 1 1 2 1 1 2 uncompensated workers
Play#0 output Play#0 1 r 50 150 yes 8 1 1 10 1 1 1000 radioactive materials
Play#0 output Play#0 6 0 640
Play#0 input show updates
Play#0 command show
@ -1452,20 +1452,20 @@
Play#0 input xdump item *
Play#0 command xdump
Play#0 output Play#0 1 XDUMP item 0
Play#0 output Play#0 1 0 "civilians" "c" 100 1 0 1 1 10 10 10 10 4
Play#0 output Play#0 1 0 "civilians" "c" 50 1 0 1 1 10 10 10 10 4
Play#0 output Play#0 1 1 "military" "m" 100 0 1 1 1 1 1 1 1 20
Play#0 output Play#0 1 2 "shells" "s" 80 5 1 1 1 1 10 1 1 80
Play#0 output Play#0 1 3 "guns" "g" 400 60 1 10 1 1 10 1 1 100
Play#0 output Play#0 1 4 "petrol" "p" 2 4 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 2 "shells" "s" 125 5 1 1 1 1 10 1 1 80
Play#0 output Play#0 1 3 "guns" "g" 950 60 1 10 1 1 10 1 1 100
Play#0 output Play#0 1 4 "petrol" "p" 7 4 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 5 "iron\\040ore" "i" 10 2 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 6 "dust\\040(gold)" "d" 200 20 1 5 1 1 10 1 1 100
Play#0 output Play#0 1 7 "bars\\040of\\040gold" "b" 1000 280 1 50 1 1 5 1 4 200
Play#0 output Play#0 1 7 "bars\\040of\\040gold" "b" 2500 280 1 50 1 1 5 1 4 200
Play#0 output Play#0 1 8 "food" "f" 0 0 1 1 1 1 10 1 1 2
Play#0 output Play#0 1 9 "oil" "o" 100 8 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 10 "light\\040products" "l" 100 2 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 11 "heavy\\040products" "h" 200 4 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 12 "uncompensated\\040workers" "u" 0 1 1 2 1 1 2 1 1 2
Play#0 output Play#0 1 13 "radioactive\\040materials" "r" 0 150 1 8 1 1 10 1 1 1000
Play#0 output Play#0 1 9 "oil" "o" 50 8 1 1 1 1 10 1 1 50
Play#0 output Play#0 1 10 "light\\040products" "l" 20 2 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 11 "heavy\\040products" "h" 40 4 1 1 1 1 10 1 1 100
Play#0 output Play#0 1 12 "uncompensated\\040workers" "u" 50 1 1 2 1 1 2 1 1 2
Play#0 output Play#0 1 13 "radioactive\\040materials" "r" 50 150 1 8 1 1 10 1 1 1000
Play#0 output Play#0 1 /14
Play#0 output Play#0 6 0 640
Play#0 input xdump product *
@ -2173,20 +2173,20 @@
Play#1 input xdump item *
Play#1 command xdump
Play#1 output Play#1 1 XDUMP item 0
Play#1 output Play#1 1 0 "civilians" "c" 100 1 0 1 1 10 10 10 10 4
Play#1 output Play#1 1 0 "civilians" "c" 50 1 0 1 1 10 10 10 10 4
Play#1 output Play#1 1 1 "military" "m" 100 0 1 1 1 1 1 1 1 20
Play#1 output Play#1 1 2 "shells" "s" 80 5 1 1 1 1 10 1 1 80
Play#1 output Play#1 1 3 "guns" "g" 400 60 1 10 1 1 10 1 1 100
Play#1 output Play#1 1 4 "petrol" "p" 2 4 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 2 "shells" "s" 125 5 1 1 1 1 10 1 1 80
Play#1 output Play#1 1 3 "guns" "g" 950 60 1 10 1 1 10 1 1 100
Play#1 output Play#1 1 4 "petrol" "p" 7 4 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 5 "iron\\040ore" "i" 10 2 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 6 "dust\\040(gold)" "d" 200 20 1 5 1 1 10 1 1 100
Play#1 output Play#1 1 7 "bars\\040of\\040gold" "b" 1000 280 1 50 1 1 5 1 4 200
Play#1 output Play#1 1 7 "bars\\040of\\040gold" "b" 2500 280 1 50 1 1 5 1 4 200
Play#1 output Play#1 1 8 "food" "f" 0 0 1 1 1 1 10 1 1 2
Play#1 output Play#1 1 9 "oil" "o" 100 8 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 10 "light\\040products" "l" 100 2 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 11 "heavy\\040products" "h" 200 4 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 12 "uncompensated\\040workers" "u" 0 1 1 2 1 1 2 1 1 2
Play#1 output Play#1 1 13 "radioactive\\040materials" "r" 0 150 1 8 1 1 10 1 1 1000
Play#1 output Play#1 1 9 "oil" "o" 50 8 1 1 1 1 10 1 1 50
Play#1 output Play#1 1 10 "light\\040products" "l" 20 2 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 11 "heavy\\040products" "h" 40 4 1 1 1 1 10 1 1 100
Play#1 output Play#1 1 12 "uncompensated\\040workers" "u" 50 1 1 2 1 1 2 1 1 2
Play#1 output Play#1 1 13 "radioactive\\040materials" "r" 50 150 1 8 1 1 10 1 1 1000
Play#1 output Play#1 1 /14
Play#1 output Play#1 6 0 0
Play#1 input xdump product *