Fallout 2 Ranged Combat

Fallout 2 Ranged combat involves many compilcated formulas. The aim of this artice is not to dive in all the engine nuances, but to make them understandeble for an average (INT=5) player.

Chance to Hit
The equation below is a general equation for a Chance to Hit. The game takes into account many other factors, like blindness or lying target, also applies different bonuses for perception for PC and enemies, etc., which are not listed here. Chance to hit = (Weapon Skill + 8*(Perception - 2) + Weapon Perk - (4*Distance to Target) - (Target AC + Ammo AC modifier) + Lighting Penalty + STR requirement penalty + Aimed Shot Penalty) * ((100 + Combat difficulty modifier) / 100) Please note:
 * penalties and Ammo AC modifier are negative numbers, so you subtract them
 * apart from Weapon Long Range perk discussed below, there is Weapon Accurate perk that gives +20% chance to hit
 * every weapon has strength requirement, and you get -20% to hit for each point of strength you're below it
 * aimed shots have a penalty depending on body part you are targeting; you get as much to your critical chance as the penalty for aimed shot is
 * combat difficulty modifier is +20 on Wimpy and -20 on Rough; it affects only enemies
 * chance to hit is capped at 95%

Weapon Long Range perk
For any weapon with Weapon Long Range perk, the bonus from perception and the distance penalty is :

If Range < (PE-4)*2, only available when PE >= 5: ToHit = PE*8 ''Notice that if you are within a certain range, there is no distance penalty. Your Chance to Hit remains the same.'' If Range >= (PE-4)*2: ToHit = (PE-2)*16 - Range*4

Lighting penalty
Lighting penalty is defined by how well the target is illuminated. Different light sources give light of different intensity, but only four light levels exist in Fallout 2. Check image to the right for comparison between a flare and the player character.

Four light levels are:
 * 0% penalty - fully illuminated, just like during the day
 * 10% penalty
 * 25 % penalty
 * 40% penalty - total darkness

With Night Vision perk lighting penalties change to:
 * 0% penalty
 * 10% penalty
 * 25 % penalty - for total darkness

Curiously, in caves maximum light penalty is only 10%, even during nighttime.

Damage calculation
Below is an equation that tries to generalise the steps that the engine does to calculate damage. A = int((weap_dmg + bonus_dmg) * (ammo_dmg_1 / ammo_dmg_2) * crit_multi * (combat_diff / 100)) - int(DT_armor / weap_pen or armor_pierc)

B = int(A * (min((DR_armor + DR_ammo) / armor_pierc, 90) / 100)

Damage = A - max(1, B) Please note: Variables:
 * function int is the same as trunc, it means to round down, for example int(4.7) = 4
 * min(x, y) means pick smaller value; max(x, y) means pick bgger value
 * "min((DR_armor + DR_ammo), 90)" means that DR is capped at 90%
 * "max(1, B)" means that DR alone can't reduce damage to 0
 * weap_dmg - random damage value produced from weapon's damage range
 * bonus_dmg - bonus damage from perks
 * ammo_dmg_1 - dividend of the ammo damage multiplier
 * ammo_dmg_2 - divisor of the ammo damage multiplier
 * crit_multi - critical hit damage multiplier from critical hit table
 * combat_diff - combat difficulty multiplier; Wimpy=75, Normal=100, Rough=125; does not influence player damage, only damage against the player
 * DT_armor - armor Damage Threshold
 * weap_pen - 5 - if weapon has Weapon Penetrate perk, 1 - otherwise
 * armor_pierc - armor piercing critical hit; 5 if it happens, 1 - otherwise; doesn't apply to Damage Treshhold if weapon already has Weapon Penetrate perk
 * DR_armor - armor Damage Resistance
 * DR_ammo - ammo Damage Resistance modifier

Critical hit armor-piercing effect
An armor-piercing critical hit effect divides both DT and DR by 5 and (where applicable) rounding the result down. Weapons that already have the Weapon Penetrate perk do not gain an additional DT-reducing effect.

Weapon's ammunition DR modifier is factored in after the armor-piercing critical effect. This means that if the ammunition has a sufficiently negative DR modifier, an armor-piercing critical will negate 100% of the target's DR. Conversely, if the ammunition's DR modifier is poor (a large positive number), then DR will reduce a considerable percentage of even an "armor-piercing" critical hit's damage.

The positive DR modifier caused by the trait Finesse is nullified by the armor-piercing critical effect.