Gunsmith Physics • Keyframes & Angular Displacement

Recoil Mechanics & Pattern Compounding

Recoil in Wardogs is driven by per-shot angular impulse curves extracted from Unreal Engine DA_*_Stats data assets. Each round applies a discrete Pitch (vertical climb) and Yaw (horizontal drift) vector, modified by attachment compounding, mechanical barrel dispersion, and target engagement distance.

Looking to test live weapon spray patterns and attachment recoil reduction?

1. Unreal Engine Recoil Data Architecture

In Wardogs, weapon recoil is built on Epic Games' Gameplay Ability System (GAS). When inspecting the game's compiled .pak archives, assets utilize standardized engine prefixes:

PrefixUnreal Engine TypeRole in Recoil & HandlingExtracted Asset Example
DA_Data AssetAuthored base recoil pitch and yaw keyframe curvesDA_M4_Stats, DA_AK74_Stats
GE_Gameplay EffectModifier blueprints compounding handling multipliersGE_MUZL_*, GE_FGRP_*, GE_MAGZ_*
GA_Gameplay AbilityExecutable state machines governing firing, reload, and ADSGA_Weapon_Fire, GA_Weapon_Reload

Each weapon possesses an authentic per-shot angular impulse array:

R⃗i=(rawYawi,rawPitchi)\vec{R}_i = (\text{rawYaw}_i, \text{rawPitch}_i)
  • rawPitch (y): Vertical barrel climb in degrees (positive = upwards deflection).
  • rawYaw (x): Horizontal barrel drift in degrees (positive = rightward kick, negative = leftward kick).
  • Pitch Clamp (pitchMax): Ceiling boundary capping maximum cumulative vertical climb.
  • Yaw Boundaries (yawMinMax): Lateral limits preventing unbounded horizontal deflection.
  • Post-Pattern Drift: When continuous fire exceeds the authored curve keyframes, the engine transitions into steady-state procedural jitter via a deterministic pseudo-random walk generator.

2. Macro Recoil Path vs. Micro Stochastic Dispersion

A common question regarding Wardogs gunplay is whether recoil patterns are 100% identical on every spray. In the engine, recoil is a hybrid system comprising a fixed, predictable macro trajectory combined with stochastic micro variation:

The Macro Pattern (Deterministic)

The core recoil impulse curve is fixed and authored directly in game assets. Every time a weapon is fired, the muzzle climbs, pulls, and kicks along this exact sequence of angles.

This is the repeatable recoil pattern that skilled players learn and counteract through muscle memory (pulling down and opposite to lateral drift).

The Micro Variation (Stochastic)

Two sprays are never 100% pixel-identical because of four stochastic factors:

  • Shot-to-Shot Random Deviation: Physical angular cone perturbation (RandomDeviationDegree) rotating the impulse.
  • MOA Barrel Spread: An inherent cone dispersion radius centered on each recoil node.
  • Post-Pattern Jitter: Procedural random walk if magazine capacity exceeds curve keyframes.
  • Shotgun Buckshot: Random radial distribution of 8 pellets within the choke cone.

3. Shot-to-Shot Random Angular Deviation (RandomDeviationDegree)

In the game source data (WDWeaponStatsData), individual bullet trajectory is governed by a dedicated physical property: RandomDeviationDegree. Unlike unitless multipliers, this value is a geometric angle measured in degrees (°).

Before applying the recoil impulse vector to the player's aim, the engine calculates a stochastic angular perturbation vector scaled by this envelope:

Θ⃗i=(R⃗base[i]∘M⃗attachments)⏟1. Scaled Base Pattern+Δ⃗dev(RandomDeviationDegree)⏟2. Directional Jitter Cone+Δ⃗MOA(WeaponAccuracy)⏟3. Mechanical Barrel Spread\mathbf{\vec{\Theta}_i = \underbrace{\left( \vec{R}_{\text{base}}[i] \circ \vec{M}_{\text{attachments}} \right)}_{\text{1. Scaled Base Pattern}} + \underbrace{\vec{\Delta}_{\text{dev}}(\text{RandomDeviationDegree})}_{\text{2. Directional Jitter Cone}} + \underbrace{\vec{\Delta}_{\text{MOA}}(\text{WeaponAccuracy})}_{\text{3. Mechanical Barrel Spread}}}

The angular perturbation envelope rotates the instantaneous impulse direction θbase=atan2⁡(Y,X)\theta_{\text{base}} = \operatorname{atan2}(Y, X) within symmetric bounds:

θfinal=θbase±δ,δ∼U[0,RandomDeviationDegree]\mathbf{\theta_{\text{final}} = \theta_{\text{base}} \pm \delta, \quad \delta \sim \mathcal{U}[0, \text{RandomDeviationDegree}]}

◔The “Arrow on a Clock” Analogy

A common point of confusion is whether a RandomDeviationDegree of 35° adds a full 35 degrees directly to horizontal yaw. It does not. If 35° were added directly to yaw, a single round would violently whip the crosshair by nearly an eighth of a full circle (at 25 meters, a 35° deflection would miss the target center by over 17 meters), violating the engine's hard yaw clamp of ±22.5°.

Instead, visualize an arrow representing the recoil kick vector of an individual bullet:

  • Length of the Arrow (Magnitude): Small, typically around 0.8° to 1.2° of angular climb.
  • Direction of the Arrow: The predefined recoil curve points this arrow almost straight up at 12:00 (with a slight authored tilt to the left or right).

RandomDeviationDegree does not make the arrow longer. Instead, it tilts the orientation of the arrow on the clock face:

High Jitter: SUPER-45 (±35°)

The arrow can tilt randomly up to ±35° from 12:00 (between roughly 11:00 and 1:00 on the clock face).

Low Jitter: M4 Carbine (±10°)

The arrow tilts only up to ±10° from vertical (between 11:40 and 12:20 on the clock face).

Trigonometric Resolution on Screen Yaw and Pitch

Because the recoil impulse is only about 1.0° in length, tilting it by an angle θtilt\theta_{\text{tilt}} resolves into Cartesian crosshair offsets via basic trigonometry:

ΔYaw=∥R⃗impulse∥×sin⁡(θtilt),ΔPitch=∥R⃗impulse∥×cos⁡(θtilt)\mathbf{\Delta \text{Yaw} = \|\vec{R}_{\text{impulse}}\| \times \sin(\theta_{\text{tilt}}), \quad \Delta \text{Pitch} = \|\vec{R}_{\text{impulse}}\| \times \cos(\theta_{\text{tilt}})}

For a 1.0° impulse on the SUPER-45 tilted at the maximum 35°:

ΔYawmax=1.0∘×sin⁡(35∘)≈±0.573∘\mathbf{\Delta \text{Yaw}_{\text{max}} = 1.0^\circ \times \sin(35^\circ) \approx \pm 0.573^\circ}

The resulting crosshair wobble on screen is only about half a degree (±0.57°), not 35 degrees.

Per-Shot Stochastic Sampling Sequence

Each bullet in a continuous burst samples a fresh uniform angle θtilt∼U[−RandomDeviationDegree,+RandomDeviationDegree]\theta_{\text{tilt}} \sim \mathcal{U}[-\text{RandomDeviationDegree}, +\text{RandomDeviationDegree}]:

5-Shot Burst Example:Shot 1: +14° (slight right)•Shot 2: -31° (kick left)•Shot 3: +3° (near true vertical)•Shot 4: -19° (drift left)•Shot 5: +35° (max drift right)
Weapon ClassFirearmSource Data AssetRandomDeviationDegree
Sniper RiflesAMR 50, MK22, SV-98, Mosin, ScoutDA_SR_04, DA_MK22, DA_SV984.0°
DMRSKSDA_SKS_Stats5.5°
DMRBMR (RFB), SVDDA_RFB_Stats, DA_SVDM_Stats10.0°
Assault RiflesM4, Bushmaster M17SDA_M4_Stats, DA_WEPN_03210.0°
Assault RiflesGalilDA_WEPN_029_Stats12.0°
Assault RiflesAK-74MDA_AK74M_Stats13.0°
Assault RiflesKH-2002, A-91, T-21DA_KH2002, DA_A91, DA_TAR2115.0°
Assault RiflesFALDA_WEPN_030_Stats16.0°
Submachine GunsMP5DA_WEPN_026_Stats10.0°
Submachine GunsAMP-9, PP-19 VityazDA_MP9_Stats, DA_SMG_0315.0° – 17.0°
Submachine GunsSUPER-45 (Vector)DA_Vector_Stats35.0°
Light Machine GunsM249 SAW, PKMDA_M249_Stats, DA_LMG_0220.0°
ShotgunsM500, MP43DA_M12G_Stats, DA_MP43_Stats24.0° – 28.0°
Sidearms / PistolsGGX-17, GGX-18, Judge, M1911, DeagleDA_G17_Stats, DA_Pistol_*10.0°
ArcheryCompound BowDA_Bow_Stats2.0°

4. Attachment Multiplicative Compounding

Equipped attachments (Muzzle devices, Foregrips, Sights, and Magazines) modify vertical climb and horizontal drift multiplicatively using Unreal Engine MultiplyCompound attributes:

verticalRecoilMult=∏k=1nverticalMultiplierk\mathbf{\text{verticalRecoilMult} = \prod_{k=1}^n \text{verticalMultiplier}_k}
horizontalRecoilMult=∏k=1nhorizontalMultiplierk\mathbf{\text{horizontalRecoilMult} = \prod_{k=1}^n \text{horizontalMultiplier}_k}

The adjusted angular deflection vector for shot ii is:

θyaw,i=rawYawi×horizontalRecoilMult\mathbf{\theta_{\text{yaw}, i} = \text{rawYaw}_i \times \text{horizontalRecoilMult}}
θpitch,i=rawPitchi×verticalRecoilMult\mathbf{\theta_{\text{pitch}, i} = \text{rawPitch}_i \times \text{verticalRecoilMult}}
Compounding Example: M4 Carbine
  • Equipped Muzzle: Flash Hider (-16% climb → 0.84x)
  • Equipped Foregrip: Vertical Grip (-30% climb → 0.70x)
  • Equipped Extended Mag: 60-Round Drum (+8% recoil penalty → 1.08x)
  • Composite Multiplier: 0.84×0.70×1.08=0.63504  ⟹  36.5% Net Climb Reduction0.84 \times 0.70 \times 1.08 = 0.63504 \implies \mathbf{36.5\%\text{ Net Climb Reduction}}

5. Trigonometric Projection to Target Distance

Because recoil impulses act as angular deflections at the barrel muzzle, linear physical displacement on a flat target down-range increases with target distance dd (in meters):

Displacementcm=d×tan⁡(θ∘×π180)×100\mathbf{\text{Displacement}_{\text{cm}} = d \times \tan\left(\frac{\theta^\circ \times \pi}{180}\right) \times 100}
Small-Angle Approximation & Linear Distance Scaling

For small angular deflections typical of rifle recoil (θ<5∘\theta < 5^\circ), the small-angle approximation holds: tan⁡(θ)≈θ (in radians)\tan(\theta) \approx \theta\text{ (in radians)}. Consequently, linear target displacement scales almost purely linearly with distance:

  • At 25m, a 1.2∘1.2^\circ pitch climb produces: 25×tan⁡(1.2∘)×100≈52.36 cm25 \times \tan(1.2^\circ) \times 100 \approx 52.36\text{ cm}
  • At 50m, the same 1.2∘1.2^\circ climb produces: 50×tan⁡(1.2∘)×100≈104.72 cm50 \times \tan(1.2^\circ) \times 100 \approx 104.72\text{ cm} (exactly double)
  • At 100m, the climb produces: 100×tan⁡(1.2∘)×100≈209.47 cm100 \times \tan(1.2^\circ) \times 100 \approx 209.47\text{ cm} (exactly quadruple)

6. Minute of Angle (MOA) Barrel Dispersion Physics

In addition to directional climb, every firearm exhibits mechanical barrel dispersion defined in Minute of Angle (MOA). One MOA corresponds to 160∘≈0.0002908882 radians\frac{1}{60}^\circ \approx 0.0002908882\text{ radians}, producing a spread of 2.9089 cm per 100 meters.

The radius of the circular spread cone in centimeters at distance dd is:

rspread=MOAeffective×2.9089×(d100)2\mathbf{r_{\text{spread}} = \frac{\text{MOA}_{\text{effective}} \times 2.9089 \times \left(\frac{d}{100}\right)}{2}}

where MOAeffective=max⁡(0.4,baseMoa×spreadMult)\text{MOA}_{\text{effective}} = \max(0.4, \text{baseMoa} \times \text{spreadMult}).

To model a true uniform circular disk distribution without artificial clustering at the center pip, the radial distance is sampled using the square root of a uniform pseudo-random variable u2∼U[0,1)u_2 \sim \mathcal{U}[0, 1):

θjitter=u1×2π,rjitter=u2×rspread\theta_{\text{jitter}} = u_1 \times 2\pi, \quad r_{\text{jitter}} = \sqrt{u_2} \times r_{\text{spread}}
ΔXjitter=rjittercos⁡(θjitter),ΔYjitter=rjittersin⁡(θjitter)\mathbf{\Delta X_{\text{jitter}} = r_{\text{jitter}} \cos(\theta_{\text{jitter}}), \quad \Delta Y_{\text{jitter}} = r_{\text{jitter}} \sin(\theta_{\text{jitter}})}

7. Combined Cartesian Target Impact Coordinates

In the simulation engine (weaponBuilderEngine.ts), the total Cartesian impact coordinate (Xcm,Ycm)(X_{\text{cm}}, Y_{\text{cm}}) relative to center mass (0,0)(0, 0) combines macro recoil projection, shot-to-shot angular deviation jitter, and barrel MOA dispersion:

Xcm=[d×tan⁡((θyaw+δyaw)⋅π180)×100]+ΔXjitter\mathbf{X_{\text{cm}} = \left[ d \times \tan\left(\frac{(\theta_{\text{yaw}} + \delta_{\text{yaw}}) \cdot \pi}{180}\right) \times 100 \right] + \Delta X_{\text{jitter}}}
Ycm=[d×tan⁡((θpitch+δpitch)⋅π180)×100]+ΔYjitter\mathbf{Y_{\text{cm}} = \left[ d \times \tan\left(\frac{(\theta_{\text{pitch}} + \delta_{\text{pitch}}) \cdot \pi}{180}\right) \times 100 \right] + \Delta Y_{\text{jitter}}}
Shot Execution Sequencing:
  • Initial Shot (i = 0): Recoil displacement is exactly zero (θyaw=0,θpitch=0\theta_{\text{yaw}} = 0, \theta_{\text{pitch}} = 0). The bullet strikes point-of-aim modulated only by tight cold-barrel MOA dispersion (0.4×rspread0.4 \times r_{\text{spread}}).
  • Subsequent Shots (i ≥ 1): Displaced by cumulative angular climb/drift, rotated by the shot's RandomDeviationDegree\text{RandomDeviationDegree} envelope, projected across distance dd, plus stochastic MOA barrel spread.

8. 12-Gauge Buckshot Pattern Simulation & Choke Constriction

Shotgun ballistics operate on multi-pellet conical cloud expansion. A standard cylinder bore produces an 18.0 cm radius (36.0 cm diameter) pattern at a reference distance of 15 meters:

rpattern=18.0×(max⁡(5,d)15.0)×spreadMult\mathbf{r_{\text{pattern}} = 18.0 \times \left(\frac{\max(5, d)}{15.0}\right) \times \text{spreadMult}}
Pellet Array Geometry (8 Pellets Total):
  • 1 Core Pellet: Concentrated tightly within r≤0.25×rpatternr \le 0.25 \times r_{\text{pattern}} of the aim point.
  • 7 Perimeter Pellets: Distributed radially across r∈[0.55,1.0]×rpatternr \in [0.55, 1.0] \times r_{\text{pattern}} with equidistant angular pacing and radial jitter.
Choke AttachmentSpread MultiplierPattern Radius @ 15mTotal Pattern Diameter
Stock Cylinder1.00x18.0 cm36.0 cm
Improved Cylinder Choke0.80x (20% tighter)14.4 cm28.8 cm
Full Choke0.60x (40% tighter)10.8 cm21.6 cm

9. Canvas Screen Projection & Perspective Scaling

In the visual target simulator (RecoilTargetCanvas.tsx), physical centimeters are converted to viewport pixels using an inverse perspective scale:

pxPerCm=(baseConstantd)×zoomLevel\mathbf{\text{pxPerCm} = \left(\frac{\text{baseConstant}}{d}\right) \times \text{zoomLevel}}

Screen coordinates on the HTML5 canvas are mapped directly from physical offsets:

canvasX=centerX+(Xcm×pxPerCm)\mathbf{\text{canvasX} = \text{centerX} + (X_{\text{cm}} \times \text{pxPerCm})}
canvasY=centerY−(Ycm×pxPerCm)\mathbf{\text{canvasY} = \text{centerY} - (Y_{\text{cm}} \times \text{pxPerCm})}
Why Down-Range Dispersion Visually Widens:

Physical displacement on target grows with distance (Xcm∝dX_{\text{cm}} \propto d), while the apparent scale of the target silhouette on the shooter's retina/screen scales inversely (pxPerCm∝1d\text{pxPerCm} \propto \frac{1}{d}).

Increasing the distance slider accurately reflects how a target shrinks in angular size relative to the weapon's spray pattern, illustrating why tight recoil compensation becomes exponentially more demanding at extended ranges.

Simulate Custom Loadouts

Visualize recoil spray patterns with real-time attachment stacking

The Gunsmith Builder allows full customization with live reactive target canvases and raw keyframe telemetry for every weapon.