empserver/info/Hitchance.t
Markus Armbruster a269cdd7e9 Limit nukes to strategic missions
Before Empire 2, nukes could be delivered only with bomb (special
mission 'n', airburst only) and launch (targeting sectors or
satellites only).

Empire 2 made nukes available for any kind of bombing, and for any
missile strike on sectors or ships.  This included interdiction and
support missions.  Nuclear-tipped anti-sats and bomb mission n were
removed.

Unfortunately, this was done in a messy way, which led to
inconsistencies and bugs.  The problem is that ordinary damage affects
just the target, while nuke damage affects an area.  Code dealing with
plane damage was designed for the former.  Instead of rewriting it to
cope with area damage cleanly, nuke damage got shoehorned into
pln_damage(), the function to compute conventional plane damage, as a
side effect: computing damage blasted sectors in the area.

If the plane carried a nuke, pln_damage() returned zero (conventional)
damage.  Without further logic, this simply bypassed the code to apply
damage to the target.  This worked out okay when the target already
got damaged correctly by the side effect.

However, some targets are immune to the side effect: when interdicting
a move or explore command, the commodities being moved are not in any
sector.

For other targets, damage has effects other than damaging the target:
offensive and defensive support don't apply the (conventional) damage
to the target sector.  Instead, they turn it into a combat bonus.
Without further logic, nuclear damage doesn't contribute to that.

To make all that work, pln_damage() returned the nuclear damage for
ground zero as well.  Because a plane does either conventional or
nuclear damage, one of them is always zero.

Most callers simply ignored the nuclear damage, and applied only the
conventional damage.

Bug: land units and ships failed to retreat when pin-bombed or
missiled with a nuke.  That's because they received zero conventional
damage.

The mission code flies planes and missiles and tallies their damage.
This mission damage included nuclear damage at ground zero (except for
missiles sometimes, see below), to make support and commodity
interdiction work.  Unfortunately, this broke other things.

Bug: when bombers interdicted ships or land units, nukes first damaged
the ships or land units by the side effect, then again through mission
damage.  Interdicting missiles had a special case to avoid this.

Bug: when interdicting move, explore or transport, nukes first damaged
the sector by the side effect, then again through mission damage's
collateral damage.

There may well be more bugs hiding in this mess.

The mess is not worth fixing.  While the idea of interdicting and
supporting with nukes sounds kind of cool, I believe it's pretty
irrelevant in actual play.

Instead, go back to a variation of the original rules: nukes can be
delivered only through bomb mission 's' and launch at sectors.

Make arm reject marine missiles in addition to satellites, ABMs and
SAMs, and clear the mission.  Make mission reject planes armed with
nukes.  Oops when they show up in mission_pln_equip() anyway.

Make pln_equip() allow planes with nukes only for missions 's' and
't'.

Clean up pln_damage() to just compute damage, without side effect.
Change strat_bomb() and launch_missile() to detonate nukes.  Simplify
the other callers.  Parameter mission of msl_launch_mindam() is now
unused, remove it.

Missiles exploding on launch no longer set off their nukes.  That was
pretty ridiculous anyway.
2009-12-13 07:46:00 +01:00

121 lines
4.1 KiB
Perl

.TH Concept Hitchance
.NA Hitchance "The chance of a projectile hitting its target"
.LV Expert
This page describes the chance of a mine, torpedo, ship anti-missile
defense, missile, or plane hitting its target.
.nf
Sea Mine hitchance
The chance of a ship hitting a mine at sea is (mines/(mines+20)). (For
example, with 20 mines, the chance of hitting one is 20/40 = 50%) The
damage is dependent upon the size of the ship and the spot that the
mine hits. (see \*Qinfo Damage\*U).
Land Mine Hitchance
The chance of a land unit hitting a land mine is mines/(mines+35).
(For example, with 20 mines, the chance of hitting one is 20/55 =
36%). See \*Qinfo Damage\*U to find out how much damage things take
from land mines. Note that the chance of land units hitting land
mines is divided by 3 if the land units are accompanied by engineers.
When moving commodities (civs, mil, shells, etc) or transporting
planes, the chance is also dependent upon the weight being moved.
First the above chance is checked, and then a chance equal to (weight
/ 100) is checked.
Torpedo hitchance
The chance of a torpedo hitting its target is equal to:
hitchance = 0.9/(range + 1)
where "range" is the range to the target. If the visibility of the
ship firing is less than 6, then (5 - visibility) * 0.03 is added to
the hitchance.
Thus, the base chance of a sub hitting its target (before visibility
modification) is:
Range Chance
0 90%
1 45%
2 30%
3 22.5%
4 18%
5 15%
Ships anti-missile defense
If a ship has "anti-missile" defense capabiilty, then it will
intercept any marine missiles launched at ships within 1 sector of the
ship. Only missiles belonging to a country you are "At War" with will
be intercepted. Only ships which are at least 60% efficient will be
able to use their anti-missile defenses. The chance of the ship
hitting the incoming missile it equal to:
hitchance = gun * eff * tfact * 4.5 - (missile "def" value)
where
gun = the number of guns the ship is allowed to carry
eff = the efficiency of the shiip
tfact = tech / (tech + 200)
where
tech is the tech level that the ship was built at
Plane and missile hitchance
If the target is
a sector, then the hitchance is 100%. Otherwise, the following
procedure is used to calculate hitchance.
The formula for a plane or missile hitting its target depends on the
type of the target (ship, plane, land unit) and the "hardtarget" value
of the target (which represents how hard that target is to hit).
Ship:
vis = the visibility of the ship (from 'show ship stats').
For a sub, we set vis = visibility * 4.
If the ship is at sea, then:
hardtarget = (eff of ship) * (20 + speed/2 - vis)
otherwise:
hardtarget = (eff of ship) * (20 - vis)
The hardtarget of a fleet is the hardtarget if the "easiest" target in
the fleet.
Land unit:
hardtarget = (efficiency) * (10 + (sector defense) * 2 + speed/2 - vis)
The hardtarget of an army is the hardtarget of the "easiest" target in
the army.
Plane:
If the plane is in the air (satellite, icbm), then
hardtarget = the "def" value of the plane.
otherwise if the plane is on the ground:
hardtarget = 0
Once we have calculated the "hardtarget" value of the target, then the
chance of a plane or missile hitting its target is equal to:
hitchance = acc - hardtarget
where
acc = (efficiency) * (1 - 0.1 * tfact) * (1 - placc/100)
where
tfact = (pltech - mintech)/(pltech - mintech/2)
where
pltech = tech level of plane
mintech = min tech level required to build plane
and
placc = plane accuracy
and if the target is a ship and the plane is an ASW plane, then
placc = placc - 20
and if the target is a ship and the plane does not have tactical capability
placc = placc + 35
Lastly we smooth out the bottom end of the hitchance curve. If
hitchance is less than 20, then it is "belled up" using the following
curve:
hitchance = 5 + 300 / (40 - hitchance).
On the other hand, you can just find out the hitchance by pinbombing
or launching a missile--the hitchance is always printed! :-)
.fi
.SA "fire, launch, bomb, torpedo, Attacking, Damage, Interception, Combat"