Nice and simple: The player sets the desired recoil length L, which determines the magnitude of the recoil force. When the gun is fired, you apply a constant recoil force FRecoil for a duration of t seconds to the point where the gun is attached, during which the gun itself decelerates at a constant rate from VRecoil to 0 over a distance of L.
Recoil Force:
FRecoil = 1/2 R VRecoil2 / L
Recoil Time [during which the force acts]:
t = 2 * L / VRecoil
Initial Velocity of Recoiling Parts:
VRecoil = (W + βC) * Vm / R
Where:
L = recoil length [m]
W = mass of projectile [kg]
C = mass of propellant [kg]
R = mass of recoiling parts (gun tube, breech, and all that moves with it) [kg]
Vm = muzzle velocity [m/s]
β = sqrt (Vm2+10002) / Vm
Please respond to this post if you have questions. It takes time to read through technical documents and write equations, so I'd like to see that it's being used in the game before posting more suggestions like this one.
Nice and simple: The player sets the desired recoil length L, which determines the magnitude of the recoil force. When the gun is fired, you apply a constant recoil force FRecoil for a duration of t seconds to the point where the gun is attached, during which the gun itself decelerates at a constant rate from VRecoil to 0 over a distance of L.
Recoil Force:
FRecoil = 1/2 R VRecoil2 / L
Recoil Time [during which the force acts]:
t = 2 * L / VRecoil
Initial Velocity of Recoiling Parts:
VRecoil = (W + βC) * Vm / R
Where:
L = recoil length [m] W = mass of projectile [kg] C = mass of propellant [kg] R = mass of recoiling parts (gun tube, breech, and all that moves with it) [kg] Vm = muzzle velocity [m/s] β = sqrt (Vm2+10002) / Vm
Please respond to this post if you have questions. It takes time to read through technical documents and write equations, so I'd like to see that it's being used in the game before posting more suggestions like this one.