CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.59k stars 4.17k forks source link

Recoil of other ammo types was not updated after PR #21926 #26056

Closed rtizzy closed 5 years ago

rtizzy commented 6 years ago

As seen in title

Prior PR

21926

The recoil of the .50 BMG was calculated against the value of the 9mm round in game.

The other ammo were never balanced based on the same calculation (as far as I know).

This would essentially nerf the 50 BMG against everything else.

I am reviewing this now.

https://en.wikipedia.org/wiki/9%C3%9719mm_Parabellum

See ballistic performance for where these stats are being taken from.

rtizzy commented 6 years ago

It appears the that the 9mm recoil has been changed but things were not updated around it.

The 9mm seems very closely related to it's real life kinetic energy in joules

8.04 g (124 gr) Federal FMJ
364 ft⋅lbf (494 J)
7.45 g (115 gr) Federal FMJ
355 ft⋅lbf (481 J)

The heavier 124 grain projectile has a kinetic energy of 494 Joules.

This is about 1.2% different than the current value.

It might make sense to simply based this recoil on the kinetic energy of the bullet directly since it is already so closely tied.

For 9mm that would mean setting the recoil to 494 Joules then doing the same for other bullets we're currently using.

rtizzy commented 6 years ago

Also of note is that occasionally 115 and 116 grain are mentioned in the 9mm file. 116 grain is likely a typo as I don't believe that is a particularly common grain size for 9mm bullets.

The recoil appears to be closer to the value for the 124 grain bullet so the description will be updated to 124

rtizzy commented 6 years ago

Regarding overpressure ammo:

An overpressure round generally carries about 10 percent higher internal pressure on the firearm, though this depends on the exact cartridge.

This translates to about ~17.4% difference in energy (494 Joules vs 588 Joules when comparing a 124 grain bullet)

This increase in energy will:

Assuming the increase in energy equates directly to damage we'd be looking at a damage of ~30 (+4) for the standard +P ammo.

I would need to dig into some research to say for certain but I'm pretty sure there will be more difference between a Jacketed Hollow Point and FMJ than there will be between overpressure rounds.

We should consider making certain makeshift or poorly maintained guns fail (or potentially fail) when used with 9mm +P and particularly with 9mm +P+ ammunition

rtizzy commented 6 years ago

Let me know if anyone is interested in helping me with this project.

A lot of it is sourcing data and crunching numbers.

Here is my current branch.

https://github.com/rtizzy/Cataclysm-DDA/tree/refactor-weapons

Also I'm reading more about recoil now to understand if my assumptions of recoil are correct (I think they might not be)

https://en.wikipedia.org/wiki/Recoil

For example, a bullet fired from an M16 rifle has approximately 1763 Joules of kinetic energy as it leaves the muzzle, but the recoil energy of the gun is less than 7 Joules. Despite this imbalance, energy is still conserved because the total energy in the system before firing (the chemical energy stored in the propellant) is equal to the total energy after firing (the kinetic energy of the recoiling firearm, plus the kinetic energy of the bullet and other ejecta, plus the heat energy from the explosion). In order to work out the distribution of kinetic energy between the firearm and the bullet, it is necessary to use the law of conservation of momentum in combination with the law of conservation of energy.

@kevingranade

It might actually be EASIER to do this by programming the actual physics calculation for recoil and then filling in that data from existing resources.

What are your thoughts?

mlangsdorf commented 6 years ago

Ranged weapon data in general could use a review. I started reviewing the blazemod weapons against stock weapons, and quickly realized that stock weapons have a lot of weird numbers in them too. Not just for recoil, but also damage, range, dispersion, etc.

alanbrady commented 6 years ago

I noticed the values on arrows are really bizarre too. Mostly the lower-end ones.

kevingranade commented 6 years ago

It might actually be EASIER to do this by programming the actual physics calculation for recoil and then filling in that data from existing resources.

I (naively) thought this data would be somewhat readily available. Since it seems to not be, I agree that we can probably get some better numbers with plugging the actually available parameters (round mass, propellant volume, barrel length) into some fomulas.

rtizzy commented 6 years ago

Before getting further into this: I know nothing beyond the most basic of physics and I suck at math (Gravity is that thing that makes apples fall right?)

@kevingranade

The summary of this is worth reading

https://en.wikipedia.org/wiki/Free_recoil

Therefore, free recoil stands as a scientific measurement of recoil energy, just as the room or outside temperature is measured. The comfort level of a shooter’s ability to tolerate free recoil is a personal perception. Just as it is a person's, personal perception of how comfortable he or she feels to room or outside temperature.

TL;DR: Free recoil is the measurement we likely want to calculate. It is virtually impossible to calculate felt recoil accurately (Also mentioned in above wiki page)

Free recoil is based on solid data that we can factor our other changes around; shooter skill, attachment benefits, and various other factors

The page also includes what is needed for the calculation as well as an example calculation

Etgu is the translational kinetic energy of the small arm as expressed by the joule (J). < **What we're solving for**

mgu is the weight of the small arm expressed in kilograms (kg).

mp is the weight of the projectile expressed in grams (g).

mc is the weight of the powder charge expressed in grams (g).

vgu is the velocity of the small arm expressed in meters per second (m/s).

vp is the velocity of the projectile expressed in meters per second (m/s).

vc is the velocity of the powder charge expressed in meters per second (m/s).

All of this data should be relatively easy to find, though I haven't ever seen `

Let me know your thoughts or if you think this should perhaps be moved to it's own project.

mlangsdorf commented 6 years ago

I've searched for powder burn velocities for another project; they're not that easy to find without a Handloader reference. Even powder weights can be difficult to find, especially down to a quarter of a gram.

I'm not sure that free recoil is that useful of a measurement, either. It specifically doesn't deal with recoil reduction devices, like muzzle brakes and recoil actions. So how useful is that in the game where people put muzzle brakes on their .50 caliber rifles?

rtizzy commented 6 years ago

@mlangsdorf

Felt recoil (What you feel after all attachments, accounting for gas output, and more) is virtually impossible to calculate.

Trying to figure the net recoil energy of a firearm (also known as felt recoil) is a futile endeavor. Even if you can calculate the recoil energy loss due to: muzzle brake; recoil operated action or gas operated action; mercury recoil suppression tube; recoil reducing butt pad and or hand grip; shooting vest and or gloves, the human factor is not calculable.

There are far too many variables to adequately calculate this.

Free recoil is a base, scientific, measurement that is relatively easy to calculate can would give us perspective on the difference between different calibers (and firearms) from a data driven point of view.

After this, manual adjustments can be made to further balance and tune the calculation.

I want to provide an example of why calculating this could have helped us:

Example:

` Someone inexperienced might think that a 9mm handgun has less recoil than a 5.56 rifle.

Comparing a Glock 17 firing 9mm ammo to a M16A2 firing 5.55, the M16A2 actually has LESS Free Recoil than the Glock 17 (See the previous wikipedia article)

Free Recoil: Glock 17: 7.7 J M16A2: 6.44 J ` I'm not aware of the sort of tests that we currently have for ranged weapons but here is what the above tells me:

The M16 has lower free recoil than the Glock out of the gate. It's third point of contact (The stock) will end up lowering the felt recoil even further over the Glock (Significantly so)

In our ranged weapons tests, a Glock 17 handgun, should produce more free recoil (and more felt recoil) than an M16 series rifle.

The .223 ammo currently has 3x more recoil than 9mm (500 vs 1500)

Is dispersion on each weapon and the rest of our calculation actually capturing the differences in accuracy, recoil, and damage between these weapons?

rtizzy commented 6 years ago

As a side note, I did attempt to dig through the source myself (In particular ranged.cpp, is this somewhere else?) but my C++ skills aren't great.

I may open a separate ticket regarding documentation if one does not already exist.

Attempting to find what each of the src files handles seems far more difficult than it needed to be.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

stale[bot] commented 5 years ago

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it