CleverRaven / CleverRaven/Cataclysm-DDA
Overhaul civilian ammunition appearance rates.
- Dominant language
- C++
- Stars
- 13.1k
- Forks
- 4.6k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 200
Description
# Is your feature request related to a problem? Please describe.
Ammunition appears in game in essentially arbitrary ratios, leading to an exaggerated difficulty when finding matching guns and ammunition.
In the opposite direction, particularly rare ammunition is not remotely as rare as it should be.
# Describe the solution you'd like
Spawn guns and ammo (but focusing on ammo here) in representative ratios.
Specifically I've done some figuring with some hopefully representative data points and come up with some distributions for the most common ammunition types, and item lists referencing ammunition drops can spawn ammo in those ratios.
EDIT: This is a summary, the full table is below, but it's too unwieldy so I'm putting this summary here.
Calibre | Percent Revenue | Price/rd | Proportion of Rounds Sold
-- | -- | -- | --
.22LR | 0.0512 | 0.038 | 0.20416406493382
9mm | 0.1776 | 0.13 | 0.209353199429958
.223 | 0.12 | 0.2 | 0.094910636269089
.45 | 0.0858 | 0.27 | 0.049387315857842
.40 | 0.0602 | 0.23 | 0.040081682049504
12ga | 0.0434 | 0.25 | 0.026452313112003
7.62 | 0.0417 | 0.19 | 0.034383554038087
.38 | 0.0244 | 0.19 | 0.019415881708033
.308 | 0.05285 | 0.33 | 0.02511926393844
5.56 | 0.0756 | 0.41 | 0.029482088663224
| | Remainder → | 0.26725
Another even more simplified tabulation:
Round type | Proportion
-- | --
Tiny | 20%
Pistol | 32%
Intermediate | 16%
Shot | 2.6%
Rifle | 2.5%
Other | 27%
## Points of interest
9mm and .22 make up 40% of all civilian ammunition.
.223 is a distant but significant third at 9.5%.
.45 and .40 are an even more distant 4th and 5th, but (along with the rarer .38) bring "medium pistol rounds" up to 30% of civilian ammunition.
12ga is sitting at a rare but not incredibly rare 2.6%
Intermediate rounds (.223, 7.62 and 5.56) sum to a respectable 16%.
Traditional rifle rounds are quite low at just over 2.5%
"and the rest" is 27%, which spread evenly across the 33 remaining ammo types is going to make them incredibly rare ( 0.8% ).
Side note, this is civilian ammunition, not police or armed forces, which will follow a totally different distribution and need their own sources.
## Data
Retrieved a (hopefully representative) snapshot of sales stats from https://www.luckygunner.com/labs/2013-ammo-stats/
Retrieved prices per round from the same site.
### 2012 data
Calibre | Percent Revenue 2012 | Price/rd | Rounds per Dollar Revenue 2012 | Proportion of Rounds Sold 2012
-- | -- | -- | -- | --
.22LR | 0.0344 | 0.038 | 0.905263157894737 | 0.153910988675132
9mm | 0.1412 | 0.13 | 1.08615384615385 | 0.184665653138481
0.223 | 0.138 | 0.2 | 0.69 | 0.117312387298312
0.45 | 0.0816 | 0.27 | 0.302222222222222 | 0.051383203454333
0.4 | 0.0474 | 0.23 | 0.206086956521739 | 0.035038482406679
12ga | 0.0318 | 0.25 | 0.1272 | 0.021626283571515
7.62 | 0.0434 | 0.19 | 0.228421052631579 | 0.038835679700586
0.38 | 0.0158 | 0.19 | 0.083157894736842 | 0.014138335006204
0.308 | 0.0557 | 0.33 | 0.168787878787879 | 0.028696969576267
5.56 | 0.0962 | 0.41 | 0.234634146341463 | 0.039892017172491
SUM → | 0.6855 | SUM → | 4.03192715529031 | 0.3145
| | SCALED → | 5.88173180932211 | ^ Remainder
### 2013 data
Calibre | Percent Revenue 2013 | Price/rd | Rounds per Dollar Revenue 2013 | Proportion of Rounds Sold 2013
-- | -- | -- | -- | --
.22LR | 0.068 | 0.038 | 1.78947368421053 | 0.254417141192509
9mm | 0.214 | 0.13 | 1.64615384615385 | 0.234040745721435
0.223 | 0.102 | 0.2 | 0.51 | 0.072508885239865
0.45 | 0.09 | 0.27 | 0.333333333333333 | 0.04739142826135
0.4 | 0.073 | 0.23 | 0.317391304347826 | 0.045124881692329
12ga | 0.055 | 0.25 | 0.22 | 0.031278342652491
7.62 | 0.04 | 0.19 | 0.210526315789474 | 0.029931428375589
0.38 | 0.033 | 0.19 | 0.173684210526316 | 0.024693428409861
0.308 | 0.05 | 0.33 | 0.151515151515152 | 0.021541558300614
5.56 | 0.055 | 0.41 | 0.134146341463415 | 0.019072160153958
SUM → | 0.78 | SUM → | 5.48622418733989 | 0.22
| | SCALED → | 7.03362075299986 | ^ Remainder
## Process
All steps repeated for 2012 and 2013 data.
Multiplied proportion of revenue by price per round to get "Rounds per dollar of revenue".
Summed "Rounds per dollar of revenue" figures to get "aggregate rounds per dollar of revenue".
Scaled Aggregate rounds per dollar of revenue by 78% to get "Adjusted rounds per dollar of revenue".
Divided each "Rounds per dollar of revenue" by "adjusted rounds per dollar of revenue" to get "proportion of rounds sold".
Averaged together "proportion of rounds sold" from 2012 and 2013 for each calibre.
Additionally, summed "Proportion of rounds sold" to determine how much of the market is covered, which yields the 31%/22%/26% remainder for "proportion rounds not in the top 10".
# Describe alternatives you've considered
All the other options are totally subjective, and I'm not a fan. If anyone finds other qualitative sources for this I'd love to try and incorporate them.
Possibly we can bucket the remaining ammo types into low and high or low/med/high to put a little extra scaling on them instead of just having them evenly represented.
Contributor guide
Assessment
This issue has not been assessed yet.