Commit graph

612 commits

Author SHA1 Message Date
628e2e8e82 info/Plane-types: Document SAM, ABM and a-sat missile abilities
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-23 08:39:13 +01:00
df7e8b3d21 info: Clean up references to long-gone options
Option DEFENSE_INFRA was replaced in commit 4d1dd6fa6, v4.3.6.  Point
to the replacement instead.

Options SHIPCHOPPERS and XLIGHT were made non-optional in Empire 2.
Don't mention them.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-23 08:39:13 +01:00
06487a46a3 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-23 08:39:13 +01:00
fef643031c info/Empire4.3: Work around "nroff: Out of temp file space"
Solaris 10's nroff can't deal with the lengthy .NF ... .FI: it
complains, writes truncated output, and terminates
successfully (*boggle*).  Split the .NF ... .FI in two.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-23 07:08:21 +01:00
2e95ea6d80 info/Empire4.4: Fix more 4.4.0 change log entry typos
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-19 08:56:38 +01:00
4a1ec06364 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:28 +01:00
c931758307 Revert "Don't let trains load trains"
This reverts commit b1a0ff2fbd.

Land units with capability heavy can't be loaded on anything, and land
units carrying land units can't be loaded regardless of capabilities.
Commit b1a0ff2fbd additionally outlawed loading of trains on land
units, but not on ships.  Bad idea, because it complicates matters for
no good reason.  Revert it.

Doesn't affect the stock game, because its only train is heavy.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 07:25:18 +01:00
d111522fe8 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-04-29 10:33:19 +02:00
fffff8680b info/Empire4.4: Fix a botched 4.4.0 change log entry
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-10 17:40:07 +02:00
689652d1b0 info/Empire4.4: Update release date once more
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 17:59:00 +02:00
664f640979 info/retreat info/lretreat: Fix truncated glossary list items
Text after the first space is missing in the formatted output.  That's
because .L takes just one argument, but we pass several.  Broken in
commit 4e0d02b, v4.3.33.  Fix by quoting the argument text.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 11:11:50 +02:00
74396d7fbf info/Empire4.4: Update release date
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-01 20:21:09 +02:00
6d1e4dcdfa info/Update-sequence: Explicitly document prepare order
Sectors, ships, planes and land units are always visited in the same
order, but it doesn't hurt to be explicit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-01 20:17:15 +02:00
1288e55103 info/version: Update example to current output
Current output of the version command, except replace version number
4.3.33.N-H-dirty by 4.4.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:50:17 +02:00
3193c22ac2 info: Update change log for 4.4.0
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:35:55 +02:00
ef5903cd9d info/xdump: Update advice on xdump evolution
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:32:01 +02:00
d3de388ad4 Drop a a few accidentally repeated words
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:32:01 +02:00
25a7ae3068 info: Split Empire4 into Empire4.0, Empire4.2, Empire4.3
"info Empire4" has become unwieldy: more than 4000 lines, almost a
quarter of a Megabyte.  Split it up.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:32:00 +02:00
22e4b1fc45 info: Consistently spell Empire 2, 3 and 4 with a space
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:27:50 +02:00
ae8a3582a2 info/Clients: Outdated and misleading, delete
The .NA header promises information on "Clients which communicate well
with the Empire4 Server".  The page doesn't really deliver.  It talks
about client support for asynchronous notifications.  It stopped
listing separate client projects in 4.0.7 (1997).  Not mentioning such
clients isn't just outdated, it's actively misleading.

Perhaps an up-to-date info page on clients would be useful, but I
can't write one right now.  Delete.

Loses a bit of information for client developers that was tacked on in
4.0.7: pointers to dump commands, and an explanation of timestamps.  I
trust client writers can find "info xdump" without this.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:27:44 +02:00
952fb252a3 info: Trim .SA of change log pages to just "Server"
Looks like an attempt was made to have .SA point to info pages for
significantly changed things.  It wasn't done consistently, though,
and it's impractical for Empire 4.  Drop these references, and keep
only "Server".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:10:17 +02:00
473187e12b info: Improve .NA and first paragraph of change log pages
The .NA show up in "info Server", like this:

   Chainsaw !   Changes from KSU Empire to Chainsaw code
    Empire2 !   Changes from the Chainsaw server to the Empire2 Server
    Empire3     Changes from the Empire2 server to the Empire3 Server
    Empire4 !   Changes from the Empire3 server to the Empire4 Server
[...]
       Merc     Changes from KSU code to Merc code
 Old-empire !   Differences from 1.2 to UCB Empire

Tweak them to look like this:

   Chainsaw !   Changes from KSU Empire to Chainsaw (1992-93)
    Empire2 !   Changes from Chainsaw to Empire 2 (1995)
    Empire3     Changes in Empire 3 (1995-96)
    Empire4 !   Changes in Empire 4 (1996-present)
[...]
       Merc     Changes from KSU code to Merc code (1992)
 Old-empire !   Differences from 1.2 to UCB Empire

The first paragraph of Empire2.t refers to "the new Empire 2" server.
Drop "new", because it clearly ain't anymore.  Same for Empire3.t.

The first paragraph of Empire4.t claims "several changes/fixes" have
been made.  Umm, that's only tenuously connected to reality by now.
Rewrite the paragraph.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
b76d111834 info/Wolfpack: Redundant, delete
The .TH and .NA header promise information about "Wolfpack Code" and
"The Wolfpack Project", but the body doesn't really deliver.  It's
basically the first paragraph of Empire4.t plus pointers to Options.t
and Empire.t.  Has been that way since it was added in 4.0.2.
History.t covers the Wolfpack project more usefully, so delete this
one.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
9f78fc8634 info: Drop outdated bug report instructions
Ken Stevens stopped maintaining Empire many years ago, but "info
Empire2" and "info Empire3" still direct users to him.  Drop that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
8637ef93b3 trade: Don't increase negative mobility to zero on trade
check_trade() sets plane and land unit mobility to zero on trade.
Even when it's negative.  Fix to leave it alone then.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
9a535b3d29 info/Chainsaw: Rename from CHANGES.CHAINSAW
No need to shout.  Name it like we do for other server versions instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
144adf5e70 info/Plane-types: Document helo takeoff/landing in mountains
Forgotten in commit 6157b6c.  While there, fix the references to "show
ship stats" headings, and say "to paradrop" instead of "to paratroop".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
a1ba346736 Spell ID and UID consistently all-caps
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
aa59a6aa0a info/territory: Drop the "id" from "territory id number"
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
a54257c51c Spell the plural of an acronym consistently without apostrophe
Opinions differ on how to pluralize acronyms[*], but let's be
consistent: say "BTUs", not "BTU's".

[*] https://en.wikipedia.org/wiki/Acronym#Representing_plurals_and_possessives

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 07:59:26 +02:00
a83c512dd5 Use all-caps for a few acronyms and for "OK"
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 10:08:31 +02:00
ab004fed13 Expand a few unnecessary abbreviations in output text
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 10:08:31 +02:00
c5a2d136ec Correct spelling as one word and as two words
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 10:08:31 +02:00
b6bfc14ab2 Spell harbor consistently
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 10:08:31 +02:00
2bcd875715 Spell BTU and ETU consistently
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 10:08:31 +02:00
e6ce36df64 Spelling corrections
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 10:08:31 +02:00
82e61187ed info/Mobility: Belatedly remove security unit mobility use
Missed in commit 39884af, v4.3.33.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 10:08:31 +02:00
afe5001a23 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-07 09:38:32 +02:00
c89161d496 subs/control: Grant bonus for capability security
Grant land units with security capability the same bonus as in convert
and shoot: multiply by (1 + eff/100).

military_control()'s code to count military is now functionally
equivalent to security_strength(), except it has no use for its second
parameter.  Change security_strength() to permit a null argument, and
reuse it in military_control().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:20 +02:00
849af9e06c update/revolt: Change security unit bonus to fix body count
Both ordinary ground combat and guerrilla combat basically kill
combatants one by one randomly until one side is eliminated.  The odds
of each side taking a hit are computed from combat strengths.

Ordinary combat factors bonuses into the odds.  It doesn't mess with
the number of men.

Guerrilla combat does the same for the bonus due to relative
happiness.  It doesn't for land units with security capability: these
fight as if they had twice as many military.  Changes both odds and
number of men.  This inflates the body count reported to the sector
owner.  Visible in tests/update/journal.log, where rebels kill 110 out
of 70 military.  It also complicates take_casualties().  Has been that
way since security land units were added in Chainsaw 3.

To fix the body count and simplify take_casualties(), make capability
security affect only the odds, not the number of men.  Without further
adjustments, this would reduce guerrilla losses: fewer men mean fewer
combat rounds mean fewer chances for rebels to die.  To compensate,
increase the multiplier from two to four.  This should make security
units a bit tougher.  Document the bonus in "info Guerrilla".

More body count bugs remain.

Reusing ordinary combat rules and code for guerrilla combat would be
nice, but isn't feasible for me right now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:19 +02:00
6fd04eabee assault: Don't send spies into combat
The server doesn't let you send land units without offensive strength
into combat: ask_olist() simply doesn't offer them.  Good.

However, it needs to offer spies for assault, because assault is how
they sneak ashore.  To make it offer spies, which have no offensive
strength, attack_val() artificially sets their offensive strength to
one for assault.  Dirt effect: spies fight (and die) in assaults, even
though they can't otherwise attack.  Lame.  Has been that way since
spies were added in 4.0.0.

Make ask_olist() offer spies regardless of offensive strength when
assaulting, and drop the special case from attack_val().  They get
offered exactly as before.  However, since their offensive strength is
now zero, they won't enter actual combat (see the previous commit).

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:19 +02:00
4b3b133183 assault: Improve chance for spies sneaking ashore undetected
Spies assaulting a foreign sector have only a 10% chance to evade
detection, regardless of efficiency.  With odds like that, players
basically don't bother.

All the other spy detection checks use LND_SPY_DETECT_CHANCE(eff),
which gives 100% spies a 90% chance to evade detection.  That's
perhaps a bit to good here, so let's try LND_SPY_DETECT_CHANCE(eff/2).
A 100% spy now has a 40% chance to sneak ashore undetected.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:18 +02:00
cd3c362a57 info/toc: Tidy up last line
mksubj.pl neglects to terminate info/toc's last line with a newline.
info-test doesn't care.  Tidy up anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:17 +02:00
93903e319c info/Update-sequence: Belatedly update for removal of SLOW_WAR
Missed in commit 439f111, v4.3.27.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:17 +02:00
9a2e1ccd6c update: Delivery abandons sectors incorrectly, fix it not to
Deliver fails to abandon sectors when it ships out all civilians and
military.  The sector remains owned until the next non-update sector
update abandons it.  Has always been broken.

Distribution had the same bug until commit d0f3847 (v4.3.20) fixed it.
Fix it the same way for delivery: adjust the amount moved to avoid
moving out the last civilian, or the last military if there are no
civilians.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:17 +02:00
43a0a4a451 update: Reorder feeding, tax & plague for consistency
People in sectors get plagued, then taxed or paid, then fed.  People
on ships and land units get paid, then fed, then plagued.  Sectors
were messed up when Empire 3 made the update code work for budget.

Change sectors back to how they worked before Empire 3: move do_feed()
from produce_sect() to prepare_sects(), and delay do_plague() until
after do_feed().  People in sectors now get taxed, paid and fed even
when they die of the plague, just like they do on ships and land
units.

Because do_plague() now runs after populace(), the latter's handling
of people dying off doesn't cover plague anymore.  Delay it to the
very end of prepare_sects().

Additionally, move feeding and plaguing from upd_ship(), upd_land() to
prep_ship(), prep_land(), for consistency with sectors.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:16 +02:00
b6509b7309 budget: Avoid unnecessary work
Ship, plane and land unit repairs depend on and change the state of
the sector.  To predict repairs, we need to predict the state of the
sector before repairs.  The obvious way to do that is to simulate the
sector update and all ship, plane and land unit updates there in the
correct order.

Until recently, we simulated only own sectors, ships, planes and land
units.  Wrong when foreign sectors, ships, planes or land units are
involved.  The fix (commit 70f6964) makes budget simulate all
countries.  Correct, but does much more work than necessary.  With a
little effort, we can track what needs to be simulated.

Use the bp map for tracking.  We need to mark the player's sectors and
all sectors where he has ships, planes or land units.  Do the former
in bp_alloc(), and the latter in prep_ships(), prep_planes(),
prep_lands().

Skip sectors not so marked.  This requires delaying prepare_sects()
until after prep_ships(), prep_planes(), prep_lands().  Their order
doesn't actually matter: prep_ships() & friends only spend money, and
nothing in preparation depends on whether the country is still
solvent.

Skip ships, planes and land units in sectors not so marked.

This speeds up budget by around a third in my testing, more for small
countries.  Roughly 15% slower than before the fix for repairs abroad.
The update has to do a bit more work than before, but the performance
difference is lost in the noise.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:06 +02:00
5a548c9901 update: Reorder sector production for speed
The update visits sectors in increasing order of country number.
Within a country, it visits in increasing order of sector number,
which is effectively top to bottom, left to right, starting with
absolute 0,0.

The order doesn't actually matter.  Before Chainsaw's option BUDGET,
the update simply visited the sectors in sector number order.  Go back
to that order, because it's faster.  For the update, it's a few
percent in my testing.  For budget, it's more than a third.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:08:31 +02:00
c5df505c98 update: Reorder unit building and maintenance for fairness
The update visits ships, planes and land units in increasing order of
country number.  Within a country, it visits first ships, then planes,
then land units, each in increasing order of unit number.

The order is relevant when money, materials and work don't suffice to
build everything.

Money is charged to the owner, so only the relative order for the same
owner matters there.  One order is as good as any.

Work and materials come from the sector, so only the relative order in
each sector matters.  The current order unfairly prefers countries
with lower country numbers.  Mitigating factor: the affected countries
need to be friendly (ships only) or allied.

The unfairness goes back to Chainsaw's option BUDGET.  See the commit
before previous for more detailed historical notes.

The update test demonstrates the unfair behavior: sector 14,6 builds
ships 95/97 owned by country#1, but not 96 owned by country#7.
Likewise, planes 95/96/97 and land units 95/96/97.

Go back to the the pre-BUDGET order: first ships, then planes, then
land units, all in increasing order of unit number, regardless of
owner.

The update test now builds ship, plane and land unit 96 instead of 97.

Bonus: speeds up both the update and budget by a similar absolute
amount.  For budget, this is roughly a factor of two in my testing.
For the update, which does much more, it's around 10%.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:08:31 +02:00
459dec0af0 update: Fix ship, plane, land unit repair work use abroad
Ship, plane and land unit repair uses new work, except in sectors
owned by countries with a higher country number.

This inconsistency is an artifact of how the update is sequenced: we
work on countries one after the other.  A country's ships, planes and
land units get repaired before higher-numbered countries' sectors
produce.  Any ship, plane and land unit repairs in such sectors use
old work instead of new work.

Repair work use changed several times during Empire's history.

In BSD Empire, repairs use old work, because it updates ships and
planes before sectors.

Chainsaw added budget priorities and the budget command as option
BUDGET.  Budget priorities let players choose separately for ships,
planes and land units whether to use old or new work for repairs.

The option also changed the update to work on countries one after the
other, presumably to permit a more efficient implementation of the
budget command.

Chainsaw also introduced repairs in foreign sectors under option
ALLYHARBORWORK.

With BUDGET disabled, all repairs still use old work, whether at home
or abroad.  With BUDGET enabled, work use of repairs at home depends
on budget priorities, but work use abroad depend on country numbers.

Both options became standard in Empire 2.

Since v4.3.6, repairs at home always use new work (commit 967299a and
commit 520446e).

To make repairs abroad always use new work as well, we need to update
all sectors before any ship repair.  This is straightforward: split
the loop over countries between sectors and unit building.  For
symmetry, also split it between unit maintenance and sectors.

The budget command is differently broken, and will be fixed next.

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