Missile weapon combat: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
(→‎Missile Weapon Accuracy: can't be negative)
(Researched and substantially updated.)
Line 1: Line 1:
{{Cleanup}}
= Missile Weapon Accuracy =
==Missile Weapon Accuracy==
Missile weapons calculate accuracy in a different way that melee combat. Because of the distance, there are multiple factors that play into how accurate a shot will be.
Missile weapons calculate accuracy in a different way that melee combat. Because of the distance, there are multiple factors that play into how accurate a shot will be.


The abstracted formula for accuracy is:
== Angular Variance ==
<math>\text{Accuracy Variance}= \text{Aim Variance} + \text{Weapon Variance} + \text{Flat Variance}</math>
Angular variance is the total number of degrees (°) that a projectile deviates from its intended trajectory. An angular variance of 0° represents a perfectly accurate shot that travels directly to the intended target, regardless of distance. The further a projectile travels, the more that its angular variance will affect the path and reduce the chance of hitting the target.


Where accuracy variance is the vector in degrees affecting the original trajectory. This means that the farther the projectile travels, the more this variance will affect its path. This formula cannot go below 0. If the answer is negative, it will become 0.
There is an element of randomness and several calculations at play which ultimately determine the angular variance of an individual missile weapon projectile. The simplified formula for angular variance is:{{Code Reference|class=MissileWeapon|method=CalculateBulletTrajectory}}
===Weapon Variance===
 
Weapon variance is the accuracy attribute on all missile weapons. Counterintuitively, the numeric representation of accuracy has a greater number represent lower accuracy, where 0 accuracy means that it is a perfect shot. For easier calculation, each missile weapon on this wiki also includes the numeric accuracy.
{{qud quote|1=AngularVariance = WeaponVariance ± AimVariance|noindent=true}}
{| class="wikitable"
 
''The ± symbol indicates that AimVariance is randomly either added or subtracted from WeaponVariance.''{{Code Reference|class=MissileWeapon|method=FireEvent|comment=Technically, the AimVariance is subtracted 66% of the time - whenever the 2d20 dice roll is less than 25 - and added the remaining 34% of the time. Functionally, this means that projectiles are slightly more likely to have bad misses in one direction than the other.}}
 
=== Weapon Variance ===
[[Image:Missile weapon 25 degree example.png|thumb|Example range of weapon variance (blast cannon)]]
{| class="wikitable" style="float:right;"
!Accuracy
!Accuracy
!Numeric Version
!Numeric Value
|-
|-
|Very High
|Very High
Line 28: Line 32:
| ≥25
| ≥25
|}
|}
===Flat Variance===
In the equation above, '''WeaponVariance''' is the weapon variance roll, which depends on the weapon's intrinsic accuracy and is re-randomized for every projectile. In game, a missile weapon's accuracy is noted in its description as Very High, High, Medium, Low, or Very Low. For easier calculation, this wiki also includes the numeric accuracy value associated with each missile weapon in the infobox on that weapon's wiki page. Lower values are more accurate, with 0 representing a perfectly accurate weapon (for example, the {{favilink|electrobow}}).
<math>\text{Accuracy} = 2d20 - 21 - \text{AGI mod} - \text{Bonus} </math>
 
Each time a projectile is fired, the weapon variance is randomly chosen from -WeaponAccuracy to +WeaponAccuracy. For example, the {{favilink|blast cannon}}, which has an accuracy of 25, will always contribute a random number from -25° and +25° to each of its projectiles, representing a total angular variance range of 50°.{{Code Reference|class=MissileWeapon|method=FireEvent|name=MissileWeaponFireEvent}}
 
The only thing that can modify weapon variance are [[Relic#Minor_Enhancements|relic]] and [[extradimensional]] enhancements which reduce a weapon's base accuracy by {{dice tooltip|5-10}}. Weapon variance is not influenced by any other factors. It cannot be reduced by agility, skills, or tinkered weapon mods. For example, the blast cannon will always have, at minimum, a -25° to +25° spread, unless it is a relic or extradimensional blast cannon that had its base accuracy reduced.
 
=== Aim Variance ===
Each projectile fired is additionally affected by the wielder's aim variance. '''AimVariance''' begins with a standard {{dice tooltip|2d20}} dice roll shared by all missile weapons. The value can then be modified by attributes, skills, weapon mods, and other factors, and it can sometimes be reduced to 0.


The bonus in this formula is a sum of different flags that depending on the attacker, weapon, and target effects:
Bow and rifle shots using [[Sure Fire]] or [[Beacon Fire]] always have an aim variance of 0.
{|class = "wikitable"
 
!If:
Otherwise, the general formula for aim variance is as follows.<ref name="MissileWeaponFireEvent" />
!Bonus
 
|-
''Abs(2d20-21) - AgilityMod - SkillMods - ItemMods - CyberneticMods''
|[[Steady Hands]]/[[Steady Hand]] with the respective weapon type
 
| +2
# Roll {{dice tooltip|2d20}} and subtract 21 from the result.
|-
# Take the absolute value of that result.
| Target is marked
# Subtract the wielder's [[Attributes#Attribute_Modifiers|Agility modifier]].
| +1
# Subtract all relevant skill modifiers for [[Steady Hands]] (-2), [[Steady Hand]] (-2), or [[Draw a Bead]] (-1).
|-
# Subtract all relevant [[item mod]] bonuses. This includes [[scoped]] (-4) as well as potential hidden bonuses to aim variance from [[Relic#Minor_Enhancements|relic]]/[[extradimensional]] enhancements.
| Weapon is [[Scoped]]
# Subtract 3 for each installed {{favilink|stabilizer arm locks}} implant
| +4
 
|-
Aim variance cannot be negative - if the result from following these steps is negative, aim variance is set to 0.
| [[Stabilizer arm locks]]
| +3
|}


If {{Dice tooltip|2d20}} ended up above 25 (7.5%), the accuracy is subtracted instead.
== Sprinting and Wildfire ==
In the case of a shot gone wild (which occurs 50% of the time when there are two or more enemies immediately adjacent to the shooter), or if the player is sprinting while firing a missile weapon, an additional random angle of up to 23° in either direction (-23° to +23°) is randomly added to the calculated angular variance of the projectile. This can stack if the shooter is sprinting while they fire a wild shot.<ref name="MissileWeaponFireEvent" />


===Aim Variance===
The firing-while-sprinting penalty is negated in either of the following scenarios:<ref name="MissileWeaponFireEvent" />
Aim variance is the flat variance added to the distance traveled.
* If the player is firing a [[:Category:Pistols|Pistol-type weapon]] and has the [[Sling and Run]] skill, or
* If the player has {{favilink|Kah's loop}} equipped and active


aim variance = flat variance + distance + Bonus + [weapon accuracy, -weapon accuracy]
== Fixed Spread Projectiles ==
{|class = "wikitable"
After calculating the angular variance of a projectile, the game also adds any additional fixed spread projectiles. These include:
!If:
* A heavy weapon [[Sweep]], which will fire 5 projectiles in place of the usual single projectile, with fixed offsets from the calculated angular variance (-45°, -22°, 0°, 22°, and 45°){{Code Reference|class=Combat|method=FireEvent|case=CommandFireMissileWeapon|name=CommandFireMissileWeapon}}
!Bonus
* A weapon with the [[beamsplitter]] mod, which will fire 3 projectiles with fixed offsets from the calculated angular variance (-9°, 0°, and 9°)<ref name="MissileWeaponFireEvent" />{{Code Reference|class=ModBeamsplitter}}
|-
|Attacker is [[Sprinting]] and does not have [[Sling and Run]] (works with any missile weapon)
| +(-23 to 23)
|-
| Attacker is flanked (surrounded by 2+ hostile creatures)
| +(-23 to 23)
|}


==Projectile Hit==
= Projectile Hit and Damage =
{{Cleanup|This section could use review and improvement.}}
When the projectile actually hits the target, regular damage calculations occur. However, there is a -5 DV penalty. If the target has [[Swift Reflexes]], the penalty will not be inflicted. If the creature is immobile, the DV is set to a flat -100.
When the projectile actually hits the target, regular damage calculations occur. However, there is a -5 DV penalty. If the target has [[Swift Reflexes]], the penalty will not be inflicted. If the creature is immobile, the DV is set to a flat -100.


==References==
= Considerations =
Unless specified, all information comes from <code>XRL.World.Parts.MissileWeapon::CalculateBulletTrajectory()</code>
* Because the [[scoped]] mod affects only aim variance (not weapon variance), it has limited usefulness to characters who already have very high Agility and supporting skills/cybernetics. If aim variance has already been reduced to 0 by other factors, the scoped mod will have no functional effect.
 
= References =
{{As of patch inline|2.0.201.114}}
<references />


[[Category:Battle Mechanics]]
[[Category:Battle Mechanics]]

Revision as of 00:15, 30 September 2021

Missile Weapon Accuracy

Missile weapons calculate accuracy in a different way that melee combat. Because of the distance, there are multiple factors that play into how accurate a shot will be.

Angular Variance

Angular variance is the total number of degrees (°) that a projectile deviates from its intended trajectory. An angular variance of 0° represents a perfectly accurate shot that travels directly to the intended target, regardless of distance. The further a projectile travels, the more that its angular variance will affect the path and reduce the chance of hitting the target.

There is an element of randomness and several calculations at play which ultimately determine the angular variance of an individual missile weapon projectile. The simplified formula for angular variance is:[1]

AngularVariance = WeaponVariance ± AimVariance

The ± symbol indicates that AimVariance is randomly either added or subtracted from WeaponVariance.[2]

Weapon Variance

Example range of weapon variance (blast cannon)
Accuracy Numeric Value
Very High 0
High 1 to 4
Medium 5 to 9
Low 10 to 24
Very Low ≥25

In the equation above, WeaponVariance is the weapon variance roll, which depends on the weapon's intrinsic accuracy and is re-randomized for every projectile. In game, a missile weapon's accuracy is noted in its description as Very High, High, Medium, Low, or Very Low. For easier calculation, this wiki also includes the numeric accuracy value associated with each missile weapon in the infobox on that weapon's wiki page. Lower values are more accurate, with 0 representing a perfectly accurate weapon (for example, the electrobow).

Each time a projectile is fired, the weapon variance is randomly chosen from -WeaponAccuracy to +WeaponAccuracy. For example, the blast cannon, which has an accuracy of 25, will always contribute a random number from -25° and +25° to each of its projectiles, representing a total angular variance range of 50°.[3]

The only thing that can modify weapon variance are relic and extradimensional enhancements which reduce a weapon's base accuracy by 5-105-10 (Avg: 7.5). Weapon variance is not influenced by any other factors. It cannot be reduced by agility, skills, or tinkered weapon mods. For example, the blast cannon will always have, at minimum, a -25° to +25° spread, unless it is a relic or extradimensional blast cannon that had its base accuracy reduced.

Aim Variance

Each projectile fired is additionally affected by the wielder's aim variance. AimVariance begins with a standard 2d202-40 (Avg: 21) dice roll shared by all missile weapons. The value can then be modified by attributes, skills, weapon mods, and other factors, and it can sometimes be reduced to 0.

Bow and rifle shots using Sure Fire or Beacon Fire always have an aim variance of 0.

Otherwise, the general formula for aim variance is as follows.[3]

Abs(2d20-21) - AgilityMod - SkillMods - ItemMods - CyberneticMods

  1. Roll 2d202-40 (Avg: 21) and subtract 21 from the result.
  2. Take the absolute value of that result.
  3. Subtract the wielder's Agility modifier.
  4. Subtract all relevant skill modifiers for Steady Hands (-2), Steady Hand (-2), or Draw a Bead (-1).
  5. Subtract all relevant item mod bonuses. This includes scoped (-4) as well as potential hidden bonuses to aim variance from relic/extradimensional enhancements.
  6. Subtract 3 for each installed stabilizer arm locks implant

Aim variance cannot be negative - if the result from following these steps is negative, aim variance is set to 0.

Sprinting and Wildfire

In the case of a shot gone wild (which occurs 50% of the time when there are two or more enemies immediately adjacent to the shooter), or if the player is sprinting while firing a missile weapon, an additional random angle of up to 23° in either direction (-23° to +23°) is randomly added to the calculated angular variance of the projectile. This can stack if the shooter is sprinting while they fire a wild shot.[3]

The firing-while-sprinting penalty is negated in either of the following scenarios:[3]

Fixed Spread Projectiles

After calculating the angular variance of a projectile, the game also adds any additional fixed spread projectiles. These include:

  • A heavy weapon Sweep, which will fire 5 projectiles in place of the usual single projectile, with fixed offsets from the calculated angular variance (-45°, -22°, 0°, 22°, and 45°)[4]
  • A weapon with the beamsplitter mod, which will fire 3 projectiles with fixed offsets from the calculated angular variance (-9°, 0°, and 9°)[3][5]

Projectile Hit and Damage

This article may need cleanup to meet quality standards.
Please help improve this page by editing it.

Reason: "This section could use review and improvement."

This article may need cleanup to meet quality standards.
Please help improve this page by editing it.

Reason: "This section could use review and improvement."

When the projectile actually hits the target, regular damage calculations occur. However, there is a -5 DV penalty. If the target has Swift Reflexes, the penalty will not be inflicted. If the creature is immobile, the DV is set to a flat -100.

Considerations

  • Because the scoped mod affects only aim variance (not weapon variance), it has limited usefulness to characters who already have very high Agility and supporting skills/cybernetics. If aim variance has already been reduced to 0 by other factors, the scoped mod will have no functional effect.

References

This information is reliable as of patch 2.0.201.114.
  1. XRL.World.Parts.MissileWeapon, method CalculateBulletTrajectory
  2. XRL.World.Parts.MissileWeapon, method FireEvent – Technically, the AimVariance is subtracted 66% of the time - whenever the 2d20 dice roll is less than 25 - and added the remaining 34% of the time. Functionally, this means that projectiles are slightly more likely to have bad misses in one direction than the other.
  3. 3.0 3.1 3.2 3.3 3.4 XRL.World.Parts.MissileWeapon, method FireEvent
  4. XRL.World.Parts.Combat, method FireEvent, in the CommandFireMissileWeapon case
  5. XRL.World.Parts.ModBeamsplitter