CleverRaven / Cataclysm-DDA

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

Overhaul automatic fire #31947

Open ymber opened 5 years ago

ymber commented 5 years ago

Is your feature request related to a problem? Please describe.
Currently firing automatic firearms has very little gameplay value and doesn't reflect how such weapons are actually operated. The combination of large bursts and constantly increasing recoil makes automatic fire largely useless except as an ammo inefficient way to maximize damage per turn at extremely close ranges.

Describe the solution you'd like
The maximum impact of recoil is far too high. Currently it can have shots hitting anywhere in an arc of about 45 degrees. FY19-3 indicates that 4cm groups at 10m are expected from a reasonably competent gunner, which gives 4 milrads as the expected dispersion. These numbers can be used as a base and brought down to cata scale.

The status quo of burst length being constant at 1 second of fire at the weapon's cyclic fire rate is also a problem, as an assault rifle with a cyclic fire rate of 600rpm (eg AK-74M) will always fire bursts of 10 rounds. FY19-3 indicates that 3 round bursts are expected for an assault rifle. That's under 1/3 seconds of fire, so being able to control the gun like that will take practice. Minimum burst size could be tied to weapon skill level, with longer bursts being fired as long as total effective recoil remains under some threshold and the target is still alive.

The impact of recoil on weapons mounted on a tripod or similar should be massively lower than when they are shoulder fired.

Additional context
What I described above may not be the best way to handle burst sizes. I haven't been able to think of a solution I'm completely happy with that doesn't clutter the interface with new burst size controls or force you to fire shorter bursts than you want to.

kevingranade commented 5 years ago

Here's what I've come up with. By default characters have a "burst" firing action. Number of rounds fired is based on some duration representative of someone with poor fire control skills times cyclic rate of the gun. This duration might drop slightly with higher skill levels. At some skill level, characters unlock a "controlled burst" firing action that represents greater control, and it fires an optimal number of rounds, i.e. the last round fired has a reasonable chance to hit, and subsequent rounds (which are not actually fired) would not. Also at some higher skill level, the character unlocks an, "area fire" action, instead of a specific target, the player selects an area to target, and fires into that area for some duration (probably 1s or so). Additionally guns with a burst fire limiter allow use of that mode.

At no point should any firing mode be checking for, "stop firing when targets have dropped".

ymber commented 5 years ago

At no point should any firing mode be checking for, "stop firing when targets have dropped".

Why shouldn't we do this? In a long burst you'd have time to react to the target falling over before you would otherwise have stopped firing.

Determining what an optimal number of rounds is could be a problem. We can calculate whether to keep firing based on hit probability but firing until accuracy get too low is likely to fire far more rounds than is actually optimal for a given target.

kasanryukin commented 5 years ago

The problem with most modern automatic weapons is you can easily mag dump before the target being dead registers unless you've got the extensive training to know if you've fired kill shots or not. A little more than a year ago I tracked down information on all the real world guns and an average time to empty a 25rd clip was about 3 seconds.

zanraptora commented 5 years ago

I thought I'd chime in here on real world weapon behaviors.

It is true that firearms empty rather quickly during fully automatic fire, but this kind of fire is almost entirely relegated to crew weapons, suppressing action (The area fire discussed above) and panicked, untrained shooters.

Bursting is a trained, and typically rather normal behavior for even moderately experienced shooters because the reaction is not to the target, but to the feel of the weapon. With a moderate amount of practice with a weapon, you can easily feel when your sight picture or frame has broken from accurate fire.

A "realistic" progression of automatic fire is going to start as wide, uncontrolled bursts as your character is incapable of effectively managing the weapon, transferring into measured (still relatively inaccurate) bursts as the character eases off the trigger as their sight picture and recoil puts him off target based on size and range. (This could interact well with the Trigger Happy disadvantage, eliminating the economizing effect.)

While in the previous longer round system, a "target check" might have been appropriate, It's outside the realm of reasonable human reaction to acquire a new target inside of a second except at extremely close ranges (Which would again be better suited by the idea of an area fire mode). Instead, You'd be better off simply bringing the time to fire down until at "perfect" levels, you're putting a burst down for every action similarly to single firing, but with the associated recoil.

This behavior ties right into weapons with mechanical or electronic firing systems for burst firing: Firing a burst fire weapon would interrupt the early wild firing and help the average skilled survivor maintain consistent, intentional fire. This can also tie into weapons with a "set" burst, like a garage zip gun.

So to recap: An unskilled survivor will likely fire long and uncontrolled bursts. A practiced survivor will bring those bursts down to more reasonable sizes, and will cut off their fire at a much more reasonable level of recoil. A skilled survivor will be capable of selecting bursts based on expected recoil and intended accuracy. He will also be able to devote more of his attention to his surroundings than his weapon, allowing him to perform suppressing, overwatch or crowd control style behaviors (Which can likely all be modeled in a similar mode.)

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.

Firestorm01X2 commented 5 years ago

Maybe the easiest thing that can be done and that improve situation with burst fire immensely will be this:

The maximum impact of recoil is far too high. Currently it can have shots hitting anywhere in an arc of about 45 degrees. FY19-3 indicates that 4cm groups at 10m are expected from a reasonably competent gunner, which gives 4 milrads as the expected dispersion.

Just add the limit lower than MAX_RECOIL for total burst recoil. How terrible far this digits from single shot recoil in cata world?

I mean that burst recoil limit could potentially be tied to single shot recoil (in cata terms) x multiplier. Recoil already calculated based off weapon stats like weight and handling. So this way no global rebalancing of recoild needed.

In addition there is case then player can't hold the gun because strength way too low. In that case current 45 degree wide spread can be used without extra limit.

Adding controlled burst don solve situation by itself- recoil acumulation for ever 3-rd shot already hight enough to guarantee miss >10 tiles.

kevingranade commented 5 years ago

4cm groups at 10m are expected from a reasonably competent gunner, which gives 4 milrads as the expected dispersion

This is expected results for a dedicated machine gunner after regular formal training on a tripod or bipod in a qualification test where they are allowed two bursts to score. Every degree of separation from this somewhat ideal setup creates additional opportunities for greater dispersion. As outlined in the linked document, if you do not have proper form, your point of aim will wander and require resetting after every burst.

This a great and concise document outlining the parameters of how machine gunfire is expected to work though.

IMO the obvious place to start is reigning in the number of rounds fired, which is objectively correct and will have positive impact on accuracy as well, though I'm not saying it will fix it. That's why I outlined that as the place to start initially, and then we can build and verify a scenario where a professional shooter can maintain those 4cm groups, then as @ymber suggests, walk back from there to less skilled shooters in poorer conditions.

Firestorm01X2 commented 5 years ago

By default characters have a "burst" firing action. Number of rounds fired is based on some duration representative of someone with poor fire control skills times cyclic rate of the gun. This duration might drop slightly with higher skill levels.

Based on this: https://github.com/CleverRaven/Cataclysm-DDA/pull/22741

Now most coreguns with automatic fire rates (except the 223s, which will be fixed after the L523 PR is closed or merged) have been rebalanced around 1 second of cyclic fire

dedicated machine guns like the M60 could have their fire rate based on 2 or 3 second burst.

Based on: https://backyardbrains.com/experiments/reactiontime

The average reaction time for humans is 0.25 seconds to a visual stimulus, 0.17 for an audio stimulus, and 0.15 seconds for a touch stimulus.

Let's take ingame AK74

{
    "id": "ak47",
    "type": "GUN",
 **"burst": 10,**
...
}

Minumum controllable burst: 10* 0.25= 2.5 round to 2

Vietnamese experienced soldier fires AK full auto mode, 2 rounds burst: https://www.youtube.com/watch?v=oYEGsfVp4kE

Then let's take m4a1:

{
    "id": "m4a1",
    "copy-from": "rifle_auto",
    "type": "GUN",
    "name": "M4A1",
    "description": "A popular carbine, long used by the US military.  Though accurate, small, and lightweight, it is infamous for its unreliability when not properly maintained.",
...
 **"burst": 14,**
}

Minumum controllable burst: 14* 0.25= 3.5 round to 3

Firing M4 on 3-round burst: https://www.youtube.com/watch?v=grjkIsjd3aw

Seems about right.

Overall formula to calculate manual short burst size could be: ( full_auto_ammo_count ) * ( 0.25 + random_lack_of_skill_factor )

random_lack_of_skill_factor - skill dependent random value up to 0.75 second for very bad skill

zanraptora commented 5 years ago

While I agree with your assessment of reaction times, bursting is not based on action-reaction: A competent shooter is "queuing" the behavior: Deciding to pull and release the trigger based on his experience with the weapon and its behavior.

This will put the minimum burst behavior below your estimates at high levels of competence, but I'm unsure it's really a useful distinction besides simply allowing the formula to permit a 2-shot burst.

Regarding the discussion of MG accuracy, the irony is that burst fire is generally less controllable than sustained fire in a dedicated LMG or larger weapon. I don't have any mechanical statements to make there, just something to consider when balancing.

I agree with the assessment of bringing down ROF in general to see how it affects accuracy. Something to consider for the future is calculating the inaccuracy of burst fire in terms of drift rather than random variation: The weapon itself is typically much more consistent than the shooter, and will trace whatever failing in control or form is present. Truly wild fire is only really appropriate for novice gunners and low-control weapons like machine pistols without braces or stocks. Balanced properly, I think we can maintain appropriate levels of accuracy on target, but significantly improve the player feel as bullets aren't literally peppering the entire quadrant.

Firestorm01X2 commented 5 years ago

Next:

At some skill level, characters unlock a "controlled burst" firing action that represents greater control, and it fires an optimal number of rounds, i.e. the last round fired has a reasonable chance to hit, and subsequent rounds (which are not actually fired) would not.

Alghoritm (look player::fire_gun in ranged.cpp): 1) Fire 2) Accumulate current recoil (as usual) 3) Check if sum of recoil still allows to hit target on its range efficiently. It is surprisingly accesible- there is funtion to determine effective range based on dispersion in ranged.cpp:

int range_with_even_chance_of_good_hit( int dispersion )
{
   ...
}

Of course you can use not exactly range to target but range to target - something , to have some room and to take in account fact that player is not machine. 4) If current effective range with current accumulated recoil lower than range to target, then roll skill based stop chance if true -stop , else goto 1

To make it work current recoil levels during burst should be lowered significantly. How much- that a question.

kevingranade commented 5 years ago

At no point should any firing mode be checking for, "stop firing when targets have dropped". The more general version of this is it also should not be checking for chance to hit. I thought that would be obvious since perceiving where your rounds are hitting isn't a thing you can even do while firing a gun.

Petethegoat commented 5 years ago

How much of the chance to hit is based on the target? The more static parameters like range and the bullet number in the burst are definitely things a shooter can learn. Would a separate function that gets an estimated hit chance based on those two things be appropriate?

kevingranade commented 5 years ago

A "before you start shooting" estimate, absolutely. So you have current aim level, target, and fire mode all selected, you can then get an estimate of maybe "hit chance for first round" and "hit chance for last round". Again, what should not happen is, "shoot until it's not worth shooting anymore", because that's not really a thing you can do while shooting.

Firestorm01X2 commented 5 years ago

Based on FY19-3 :

An E-type sil-houette target 19 inches wide is 4 mils wide at 121.7 meters.

121 meters based on:

Link to Real Data Spreadsheet: https://docs.google.com/spreadsheets/d/1aGH8N2kITxZ_8i1Vyi1G-FIVfQOTL6euvKxZkYOc-FE/edit?usp=sharing

Glock 9mm max range 100 m. It is 14 tiles in game

So we can assume that automatic fire should be very effective at around 15 tiles. It should be scaled down for smgs of course.

This 15 tiles is almost half of max range of .223 Remington.

So maybe we can assume simple rule, like professional shooter should be very effective with burst at least of half of max weapon range.

Correct me if I am wrong.

Firestorm01X2 commented 5 years ago

I recommend to attach issue to project: https://github.com/CleverRaven/Cataclysm-DDA/projects/10#card-12650281

Increase engagement ranges

And maybe add it to milestone to 0.F (or even 0.E?). It is not gamebreaking but very noticable and long lived issue.

Firestorm01X2 commented 5 years ago

About original assumption. I've talked with someone with actual shooting and battlefield experience. In short: Maximum real effective range for assault rifle in real combat: 100m No one ever will use autofire or burst on distances over: 30m

No one ever uses long bursts.

Real use of automatic fire - sometimes you almost have no time aim so you can do short quick short burst over the cover and have higher statistical chance to hit.

Also I've been told something about using automatic fire in defense. But that was about something situational, depending on enemy position or how they move(?).

That is how it works in practise.

So looks like many models (real ones or ones that we use) are not really works in practise.

Also usefull link: https://www.quora.com/Why-do-the-guns-that-soldiers-use-have-automatic-fire-and-burst-if-they-dont-use-it-Wouldnt-it-be-better-to-just-use-semi-auto-rifles-like-the-AR-15

mlangsdorf commented 5 years ago

First World military doctrine for infantry squads fighting small wars is not 100% of how people use guns. Plenty of untrained and semi-trained people also use automatic fire, and sometimes at inappropriately long ranges. Vehicle mounted weapons are also used differently. CDDA needs to cover all these situations.

ghost commented 5 years ago

There was some relevant discussion between IAmTheLastMessiah, mlangsdorf ZhilkinSerg and others in the Artyom mod thread on reddit: https://www.reddit.com/r/cataclysmdda/comments/dq0aq4/requestdiscussion_should_artyoms_gun_emporium_be/f6025k9/

kevingranade commented 4 years ago

This issue has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/way-of-solving-excessive-damage-of-new-turrets-just-replace-ammo-type/23051/19

Nandorianen commented 4 years ago

This discussion reminds me of a Jagged Alliance 2 mod "JA2 1.13" (also called unofficial patch) that is still being developed. There is an optional setting called NCTH ("New Chance To Hit"), in which devs were trying to simulate realistic aiming, shooting, burst and auto-fire calculations and mechanics. Naturally, this cannot be directly applied to CDDA - mostly because JA2 does not assume 1-second turns. But maybe some of their ideas could inspire solutions CDDA. For example, NCTH assumes that after each shot in a volley the shooter gets a chance to correct his aim a bit. If it happens, the shooter tries to apply correct amount of force to compensate for recoil, but depending on his skill he can miscalculate. The shooter may also lack the strength to compensate enough. General overview of the system can be found here. https://ja2v113ham.fandom.com/wiki/New_Chance_To_Hit

Also some thoughts on this discussion.

  1. As a player, I expect automatic weapons to help with crowd control, not with bringing down single targets quickly. If I see a mob of zombies shuffling my way, the most intuitive thing to do is to shoot in their general direction in an arc, trying to hit multiple targets in one volley. Having something like "fire on a 2-wide circle" won't really help, because I don't need to hit an area, I need to hit enemies in that area and it's not really important if they are positioned at some exact location or a tile to the left. So maybe "area-fire" should be more like "select a target that's gonna be a center of a cone and then try to hit all target within that cone" mode. Or maybe a way to mark desired targets somehow (with a reticle?). The important thing is that PC should try (within their ability) to shoot in the direction of multiple enemies, not at an area itself. This is also the expected way to use a flamethrower.

  2. Why should auto-fire be limited to 1 second at a time? Why not let player have longer volleys that use up more moves, like with aiming? Maybe instead of trying to fire a specific number of bullets with auto-fire, player should just be able to choose the length of the volley? Right now you can choose four levels of aiming, taking progressively more time. In the same way you could choose to go for a shortest possible burst (to save ammo), for a medium/long volley (for example, 2/3 turns), and maybe for a full carnage (shoot until the mag is empty or there is no-one left). If auto-fire is not limited to 1 second, then I expect the shooter would be able to stop when all targets are down, at least after a short delay that gets shorter with experience (because you can estimate how long it would take before you start shooting - that should shorten your reaction time).

actual-nh commented 3 years ago

Regarding the discussion of MG accuracy, the irony is that burst fire is generally less controllable than sustained fire in a dedicated LMG or larger weapon. I don't have any mechanical statements to make there, just something to consider when balancing.

@zanraptora: To what degree is this due to tracers and/or other means of perceiving where the bullets are (likely to be?) hitting?