]> git.pond.sub.org Git - empserver/commit
power: Saner power for items, ships, planes and land units
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 27 May 2016 15:41:45 +0000 (17:41 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 17:59:55 +0000 (19:59 +0200)
commitea5c8a65981fe1a3fd571a52b0bf0fe2405dbbc0
tree507310ca7ab133ff23cfc974fa5dddcafb0b9dbc
parent1307a3be6b36b9f2f20b372b568fab84de3ff20c
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>
info/Item-types.t
info/power.t
src/lib/commands/powe.c
src/lib/global/item.config
src/lib/global/product.config
tests/smoke/journal.log
tests/update/journal.log
tests/version/journal.log