CleverRaven / Cataclysm-DDA

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

Reload using magazines #14981

Closed mugling closed 8 years ago

mugling commented 8 years ago

Now that basic functionality from #14949 is merged we need to consider our next steps. I can see us branching in three directions, the first is mainline content, the second is the generic guns mod and the third a technical/realism mod. I've little doubt @DeadLeaves, @chaosvolt and others will be keen to start work on the latter.

This issue is opened to discuss the mainline content. The first task is to define a sufficient (but not excessive) number of magazines. Whilst technical correctness is important where there is a conflict between this and gameplay I'd like to choose the latter and reserve the former for a realism mod.

Military guns should spawn without magazines making their obtainability an important factor and helping to balance them against the guns with integral magazines. We also need to consider the effect of ammo conversions which are much more valuable now we have differing magazines.

The below tables include the items currently being worked on by @chaosvolt

NOTE: weight and reload time is per round

.223 / 5.56 [RDY in #14995]

Advantage: Interchangeable magazines, common ammo Disadvantage: Inferior to other rifle rounds, less reliable weapons

name cap vol rel reload weight rarity fits
Ruger 223 mag 10 1 9 100 10 frequent everything
STANAG mag 30 2 8 100 12 uncommon not Mini-14
STANAG drum 50 4 7 200 12 rare not carbine
223 belt * * 6 * * rare Only M249
Survivor 223 mag 5 1 5 150 16 craftable everything
LW-32 mag 32 2 9 120 6 milspec leadworks
LW-56 mag 56 3 9 160 6 milspec leadworks

9mm [WIP in #15002 and #15003]

Advantage: Very common ammo, some mags fit both SMGs and carbines Disadvantage: Inferior to other pistol rounds, no good revolvers

name cap vol rel reload weight rarity fits
Glock magazine 15 1 8 100 7 frequent Glock
Glock Hicap mag 30 2 7 140 7 uncommon Glock
M9 magazine 15 1 8 100 9 rare M9, Cx4
M9 hicap mag 30 2 7 140 9 rare M9, Cx4
USP 9mm mag 15 1 10 100 5 rare USP
LW-21 mag 21 2 10 140 5 milspec Leadworks
MP5 mag 30 2 9 100 7 rare MP5
MP5 extended mag 50 3 8 160 7 rare MP5
UZI mag
TEC-9 mag
Calico
STEN magazine 32 2 6 100 8 common Sten
Survivor STEN mag 20 2 5 120 13 craftable Sten

.45 ACP [WIP in #15002]

Advantage: Disadvantage:

name cap vol rel reload weight rarity fits
Thompson 20 mag 20 2 8 100 8 rare Thompson
Thompson 30 mag 30 2 8 120 8 rare Thompson
Thompson drum 50 4 7 150 8 rare Thompson

.22

Advantage: Quiet, very low recoil, low ammo weight Disadvantage: Weak, unreliable guns, few with detachable magazines

name capacity volume reliability rarity fits
A-180 mag 165 4 7 rare American 180

Shotguns

Advantage: Common ammo, powerful, easy to aim Disadvantage: Noisy. Mostly integral magazines

name capacity volume reliability rarity fits
Saiga mag 10 2 8 very rare Saiga-12

30.06 Springfield [WIP in #15002]

Advantage: Disadvantage:

name cap vol rel reload weight rarity fits
BAR mag 20 2 9 100 10 rare Browning
BAR extended mag 30 2 7 120 10 rare Browning

Missing functionality:

Rivet-the-Zombie commented 8 years ago

Guns should spawn without magazines

This would be about right for an armory, but not so much for personal firearms. I know that not everyone keeps their guns in condition one like I tend to, but most folks will store the magazine(s) in the same place as they keep their firearm.

And if the idea is that the personal gun you find doesn't even have a matching magazine anywhere in the house, then I'd seriously question what's up with that.

chaosvolt commented 8 years ago

Hmm. Ah right. And yeah, it seems a bit odd. Maybe the "guns with ammo" item group option should be including magazines?

mugling commented 8 years ago

Ok, how about military guns spawn without and personal with? That's trivial to implement and would probably help somewhat with balance?

chaosvolt commented 8 years ago

That reminds me, another thing. Can different magazines be allowed to have effects on reliablity?

For example, the main reason the Thompson was generally used with regular 20-round magazines by the military was, in addition to the added bulk of drum magazines, they were more inclined to jam. Another interesting fact was the earlier models of the M249, which had a secondary slot for STANAG magazines, but use of it was discouraged (if I recall, official reasons were how little you'd get out of it with the M249's higher rate of fire, and said RoF being beyond what the magazine springs were designed with in mind).

The latter probably wouldn't be worth implementing as that feature was eventually axed, though. XP

mugling commented 8 years ago

Can different magazines be allowed to have effects on reliablity?

Yes, this will be explicitly supported, for example consider the poorly crafted and unreliable survivor 223 mag. I'd like to have unreliability have a number of effects, jams, wasted ammo etc - further suggestions?

chaosvolt commented 8 years ago

Ah, excellent. I assume that digging up info on various weapons to procure examples of magazine options would be good, I likely should do so.

Ooh. Another thought. Issue https://github.com/CleverRaven/Cataclysm-DDA/issues/14909 led to a mention of the idea of the SKS having an aftermarket mod to give it detachable magazines. I'm not sure if "internal to detachable" was a feature added.

Rivet-the-Zombie commented 8 years ago

how about military guns spawn without and personal with

If we're talking military firearms found in a closed facility, then yeah that makes perfect sense. If we're talking the ones found on soldier zeds and dead soldiers, then they should probably still have a magazine in them.

chaosvolt commented 8 years ago

A possibly empty one, but yeah.

DeadLeaves commented 8 years ago

This is starting to look really sweet. While I disagree a bit with what fits what in your tables, one thing that could be really nice to allow is some kind of tag that allows a magzine to fit any gun that uses that ammo type. Seeing as we have nanobots and power armors, adjustable magazines doesn't seem that far fetched.

Also loving that magazines can affet reliability. And taking things in that direction, magazines should be able to affect other things like recoil and stability. (Having a huge mag can really throw the wepon off balance)

Regards to mods, I'm planning to make a mod that simply adds a bunch of different magazines for most guns. Intention is to be a base for other mods to work on. (So they don't all need to override mainline weapons. Naturally it will still work alone and expand magazine options)

Rivet-the-Zombie commented 8 years ago

one thing that could be really nice to allow is some kind of tag that allows a magzine to fit any gun that uses that ammo type

Magic science that allows you to cram a round peg into a square hole?

a huge mag can really throw the wepon off balance

Balance != recoil. The heavier the firearm is, the less perceived recoil.

DeadLeaves commented 8 years ago

Balance != recoil. The heavier the firearm is, the less perceived recoil.

While correct in that sense, having the weapon off-balance can make it move in different ways compared to a standard magazine.

chaosvolt commented 8 years ago

Thing is I'm not sure what stat would be best affected by that. :V

DeadLeaves commented 8 years ago

Magic science that allows you to cram a round peg into a square hole?

Yeah, basically. I mean there are things that are way more improbable in the game already.

chaosvolt commented 8 years ago

The only way I can seeing that making sense would be a transforming magazine well. Hardly as insane as Universal Ammo, but does seem hard to wrap my head around.

DeadLeaves commented 8 years ago

We have teleporters for crying out loud. Have the mag teleport the bullet into the chamber, have tiny robotic arms move the bullet into place. A house trained blob/amoeba that moves the bullets. Or even for the arcana mod: MAGIC.

While a bit crazy perhaps, I was laughing out loud at what im writing. I think its amazing

chaosvolt commented 8 years ago

So what, that "Master Spark" idea for Arcana mod? o3o

Rivet-the-Zombie commented 8 years ago

We have teleporters for crying out loud.

That run off of lots of plutonium and place their subject in a random place - sometimes inside solid walls.

have tiny robotic arms move the bullet into place. A house trained blob/amoeba that moves the bullets

Or we could use normal magazines that don't add an additional ten pounds to the firearm.

This stuff is all off topic anyway. We now have magazine support, and can assign different types of magazine to each type of firearm. Why would we throw all that out the window in favor of 'one magazine to rule them all' when we've got the capacity for so much variety?

kevingranade commented 8 years ago

Number of magazines per ammo type Lots of hunting rifles come with ridiculously small magazines, in the low single-digit range, and aftermarket magazines are considered somewhat specialty. This is a particularly good balance point for some of the large rifle calibres, since this set of changes might force users to fire just a few rounds, then retreat to reload some magazines.

Magazine frequency One thing about magazines is that in certain circumstances it would be reasonable for them to be quite rare post-cataclysm. For example, I'd expect a looted gunstore to have several of each calibre of gun taken, but very nearly all the magazines taken. Imagine, you walk into a pristine gun store with a rack of 10 Glock-19 pistols and a case of 9mm ammo (it's a really crappy gunstore, bear with me). What are you going to take? IRL I'd probably take 2-3 guns in case they break, but in the game I'd take just one since you don't swap components to do repairs. In both situations though, I'd take all the ammo and magazines I could carry, including ejecting all the magazines from the guns I didn't take. This is going to be even more the case when reload times get adjusted, since a magazine swap is a matter of a few seconds, but reloading the rounds in a magazine will take upwards of a minute. In an un-looted area though, I'd expect there to be at least one magazine per gun present. To reflect this, other survivors, both living and dead should have a number of spare magazines for their guns. (dead survivors lol)

Random observations about .22 Additional pluses for .22 are high capacity (I've used 10-round revolvers, stacked magazines are capacious, and even tube magazines hold like 10 rounds of LR), low weight and STUPID common ammo, the stuff is everywhere. An additional con is that some .22s are the cheapest guns around, and due to the cheapness a lot of them are extremely poorly maintained to boot.

shotguns We only have 12 gauge shotguns, this is weird and dumb, but no need to challenge it just this instant. Pros: Common hunting weapon, common ammo, particularly in (presumably more common?) hunting/outdoors stores as opposed to dedicated gun shops. Also common in homes. Cons: Non-integral magazines are very rare, and worse single- and double-barrel shotguns are not terribly uncommon, with no prospect of enhancement.

Seeing as we have nanobots and power armors, adjustable magazines doesn't seem that far fetched.

I have had this argument dozens of times, just because we have things that use super-science is no reason to make everything be super-sciency. These are not buck rogers guns, these are real guns that exist in the real world, and they will act like it. One of the cool things about a scifi/fantasy setting is contrasting super- things against mundane things, if we throw out the mundane things entirely there's no contrast. If you want to add a mod that completely dispenses with this, you can feel free, I suspect people using the simple guns mod would want simple magazines to go with them for example.

magazines should be able to affect other things like recoil and stability.

They do indirectly, the volume and weight of a magazine (and the weight of the rounds in that) are added to that of the gun, which has a few affects on how quickly you can maneuver the gun. Less about increasing recoil and more about slower recovery from recoil.

I'm planning to make a mod that simply adds a bunch of different magazines for most guns.

If they're real (IRL real) magazines for real guns, I'm not sure why this would be a mod. Or do you mean it would be a large number (too many) of magazine types for each ammunition type?

mugling commented 8 years ago

If we're talking the ones found on soldier zeds and dead soldiers, then they should probably still have a magazine in them.

A possibly empty one, but yeah.

Split out as #14992

While I disagree a bit with what fits what in your tables

Entirely open for discussion, especially if you have specific ideas in mind. I just wanted to get down the major factors for each magazine and have some demonstration items to start with.

This is a particularly good balance point for some of the large rifle calibres, since this set of changes might force users to fire just a few rounds, then retreat to reload some magazines.

One thing about magazines is that in certain circumstances it would be reasonable for them to be quite rare post-cataclysm

To reflect this, other survivors, both living and dead should have a number of spare magazines for their guns

Agreed, the rarity of good magazines and the time taken to reload them are major balacing factors and should hopefully result in a lot of new emergent tactics.

Regards to mods

Is there a concise overview of how mods work for adding/deleting/modifying items? What is currently possible as it may be that I can adjust the magazines JSON to make the job easier which is best done now before we have a lot of content?

mugling commented 8 years ago

but in the game I'd take just one since you don't swap components to do repairs

...yet

mugling commented 8 years ago

So more entries in the preamble. In particular does anyone have a suggestion as to how to differentiate the 9mm pistols (either by changing their stats or their magazine properties).

mugling commented 8 years ago

Additional balancing factor: reload time (per round)

DeadLeaves commented 8 years ago

If they're real (IRL real) magazines for real guns, I'm not sure why this would be a mod. Or do you mean it would be a large number (too many) of magazine types for each ammunition type?

I suggest this earlier and it got shot down immediately in #14949. Therefor I'm making it as a mod.

This was previously discussed in #14149 and I feel the most relevant argument was: It might be technically more correct to have one or more magazine definition per gun, but I find that hard to justify when there's little to no differentiation between them.

mugling commented 8 years ago

@DeadLeaves I agree that's better as a mod as you'll be able to take that idea (technical correctness) much further that might be possible in mainline. If there are more properties or mechanics that you require from the implementation please let me know.

DeadLeaves commented 8 years ago

If there are more properties or mechanics that you require from the implementation please let me know.

Now that you have implemented a bunch of different STANAG magazines. Maybe you can see my reason behind the need to allow for magazine families. Every time you add a new magazine for a gun, you need to go through every entry in ranged.json + the mod's jsons and add compatibility. (And all the overrides necessary to make mod ammo work with mainline guns... ugh..(Not even sure this is even possible tbh))

For example the m249. Lets say I add a few different belt lengths, and a few new STANAG mags. I'd add each individually, instead of just having originally specifid on the m249 that it's compatible with 223belt and STANAG and that'd be it. maybe you allow the m249 to use 223survivor as well since it has high tolerance. After that, every single addition to the weapon's magazine compatibility is already solved. No need for mod overrides, no need to go through a massive amount of weapons to make sure your new mag is compatible etc.

Anyway, this is the last time I will repeat this suggestion.

mugling commented 8 years ago

Won't work in this example because the Ruger Mini-14 doesn't accept stanag30 mags (intentional, for balance). Perhaps the m249 shouldn't accept stanag10 after all (8237385)?

This is the group with the most overlap - the problem is only magnified for the other ammo types.

DeadLeaves commented 8 years ago

I don't see why the Mini14 cannot use stanag30. I mean, it can only fire semi auto. so it's not like a huge magazine will benefit it that much. Lager magazines will benefit weapons with high fire rate if anything.

chaosvolt commented 8 years ago

Hmm. So, similar to your idea for survivor .223 mags, here's a thought.

How should we handle makeshift magazines for other firearms? I'm thinking it might be acceptable for nearly every magazine-fed weapon to have at least SOME option for a player-crafted magazine. But then how should we handle that? Since part of the idea is that you can't immediately pick up a high-firepower gun and become unstoppable with it, it presumably would have to be a later-game option.

So either high-level skills, booklearned-only, or both. I'm already thinking that adding homemade magazines for the Sten to one of the SMG books might be interesting, as it's one of the simpler things compared to making the SMG itself.

mugling commented 8 years ago

It's not that it couldn't, just that I don't think it's balanced in that we've suddenly tripled the ammunition capacity.

DeadLeaves commented 8 years ago

It's not that it couldn't, just that I don't think it's balanced in that we've suddenly tripled the ammunition capacity.

As it is now. You can grab an extended magazine double magazine (10x2) and then a spare mag (+20) which equals up to 40 rounds with barely any reload. And the mini 14 doesn't become a lot more scary. It's an accurate weapon for sure. But for firing accurate weapons on long range, you don't really need a big ammo cap anyway.

mugling commented 8 years ago

I'm thinking it might be acceptable for nearly every magazine-fed weapon to have at least SOME option for a player-crafted magazine

This sounds like a good idea providing improvised magazines remain a poor substitute for the real thing. I'm going to tackle 9mm next so do you have any specifics for that item...

As it is now. You can grab an extended magazine (10x2) and then a spare mag (+20) which equals up to 40 rounds with barely any reload

since this set of changes might force users to fire just a few rounds, then retreat to reload some magazines

"barely any reload" is one of the things I wanted to change as part of adding magazines.

will benefit weapons with high fire rate if anything

Burst fire is currently nearly useless. How can we rebalance this?

chaosvolt commented 8 years ago

I'm going to tackle 9mm next so do you have any specifics for that item...

Aside from the makeshift Sten magazine, I haven't had much chance to think up ideas just yet. Maybe I should start up a PR when I get settled in somewhere, as will be headed out in a bit.

Burst fire is currently nearly useless. How can we rebalance this?

Silly 'umies muckin' about. Ya always need moar dakka. o3o

Seeing as you can still get a lot done with burst fire if you're close enough, and if you have a horde to fire into, the only thing we're missing is suppressing fire. Which would only come into play with NPCs anyway. :V

DeadLeaves commented 8 years ago

"barely any reload" is one of the things I wanted to change as part of adding magazines.

I agree totally with this statement. But why does the mini14 need a significant nerf? Seeing it's not even that great as it is.

Burst fire is currently nearly useless. How can we rebalance this?

When I play, I always try to get a gun with a small (< 5) round burst. Simply because ammo is rare. Another reason burst is not very popular is that fact that it behaves strange in many cases. There have been multiple times i'm bursting with a high volume burst weapon where I kill my original target and start auto-target allies nearby. One thing I have noticed though, is that the more zombies there are (spawn multiplier) the more I tend to use burst.

Coolthulhu commented 8 years ago

Burst fire is currently nearly useless. How can we rebalance this?

This would require making recoil affect first few shots less. For example, rolling a recoil value for the entire burst and then applying it linearly. For example:

etc.

Alternatively, a cap - soft or hard - on recoil. This would make mid-range burst quite bad, but could make bursts useful at close range, where low accuracy doesn't hurt that much.

chaosvolt commented 8 years ago

I like the idea of a recoil cap. At some point you're either firing straight up into the air, or knocked on your ass, so theoretically infinite recoil would be odd.

How much does it have to build up before start firing backwards? XP

DeadLeaves commented 8 years ago

Regarding the mini14 aswell. The fact that only the smaller magazines work with it will be a great source of confusion. Because the smaller mags will work with other rifles. but larger mags will not work the other way around with the mini14. I can also assure you that if another gun nut finds it they're going to think it's a bug that a weapon only can use some STANAG magazines, even though it's a standard set up for cross weapon magazine compatiblity

mugling commented 8 years ago

item::info() lists compatible magazines

chaosvolt commented 8 years ago

As I said I'd do, I went through with a PR: https://github.com/CleverRaven/Cataclysm-DDA/pull/15002

mugling commented 8 years ago

Done for 223 in #14995

chaosvolt commented 8 years ago

Hmm, I'll go ahead with further listing tables of the current state of my PR.

.30-06 Springfield:

name capacity volume reload reliability rarity fits
BAR 20-round magazine 20 2 100 9 rare Browning Automatic Rifle
BAR 30-round magazine 30 2 120 7 rare Browning Automatic Rifle

5.54x39mm:

name capacity volume reload reliability rarity fits
AK-74M magazine 30 2 100 9 uncommon AK-74M, AN-94
RPK-74 magazine 45 3 130 8 rare AK-74M, AN-94

7.62x51mm:

name capacity volume reload reliability rarity fits
M13 ammo belt * * * 9 Currently unusable M60, M240

9x18mm:

name capacity volume reload reliability rarity fits
Makarov PM magazine 8 1 100 9 Common Makarov PM
Skorpion Vz. 82 magazine 20 2 100 8 Rare Skorpion Vz. 82

.32 ACP:

name capacity volume reload reliability rarity fits
Skorpion Vz. 61 magazine 20 2 100 8 Common Skorpion Vz. 61

.45 ACP:

name capacity volume reload reliability rarity fits
Thompson 20-round magazine 20 2 100 8 Rare Thompson Submachine gun
Thompson 30-round magazine 30 2 120 8 Rare Thompson Submachine gun
Thompson 50-round drum 50 4 150 7 Rare Thompson Submachine gun
Shadefang commented 8 years ago

On discussing this, a friend informed me that a Ruger Mini-14 shouldn't actually be able to take stanag mags (aside from one specific model of mag) as the mag well isn't wide enough. Making them use ruger mags instead should eliminate whatever confusion could've been there. I can somewhat understand not wanting to add this outside of a realism mod, but I feel that arbitrarily not being able to use 30 round mags has a greater negative impact on gameplay. On a side note, you can actually find 30 round Mini-14 mags made by ruger, and that's not even getting into aftermarket equipment.

Also figured the list on this page would be useful. https://en.wikipedia.org/wiki/STANAG_magazine

chaosvolt commented 8 years ago

Removing comment I made earlier, I must've accidentally tried to test changes using an older build.

DeadLeaves commented 8 years ago

I think this is the most apropriate place to ask. How does one override a item (in this case a weapon) in a mod. Do I create an item with the same ID? and if I do, do I have to rewrite all the info for the weapon, or can you override only fields you want to change?

chaosvolt commented 8 years ago

Meep. Yeah, creating an item in a mod with the same ID will override it, and it tends to require you to give it all the info for it.

Some JSON content has been enhance to allow modifying properties without having to re-create the whole entry as a copy, but I don't think items have been given that ability yet.

mugling commented 8 years ago

See #15099