Muushy / Sprocket-Feedback

Report bugs or suggest features for Sprocket.
4 stars 0 forks source link

Recoil Length vs Recoil Force #564

Open A1ex-Andro opened 4 months ago

A1ex-Andro commented 4 months ago

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.

Muushy commented 2 months ago

Thanks @A1ex-Andro Your suggestions are very useful and will certainly be used when the time comes to focus on their respective areas.