# Latest experimental features: tangent and new feature discussion

**URL:** <https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750>\
**Category:** The Bunker\
**Created:** [August 2, 2016, 10:18am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750 "2016-08-02T10:18:05Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [September 12, 2016, 8:27pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/41 "2016-09-12T20:27:33Z")

</div>

Before, only pimped out endgame sniper rifles wielded by endgame snipers could reliably hit anything at range above 15. Now it can be done before the entire balance of the game breaks up and before the game is in the “pure sandbox” mode. It is much more important to allow trained shooters to snipe than to allow great shooters to snipe far.  
Hard cap (of 30) is temporary. There will always be a hard cap of 60 because of reality bubble, though.

---

<div class="post-metadata">

**Author:** ![DG123](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DG123](https://discourse.cataclysmdda.org/u/DG123)\
**Post date:** [September 19, 2016, 9:33pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/42 "2016-09-19T21:33:28Z")

</div>

Would it be possible to do something so that gun mods affect bullet recoil/dispersion?

“Currently” (in my outdated version) you can mod the crap out of a rifle to be perfectly accurate and have zero recoil… and as soon as you put bullets in it, it has insane recoil and the bullets can miss the target again.

This doesn’t make sense. If you are using weapon enhancements that physically stop the weapon from recoilling, that should be able to counteract the recoil generated by the bullets.

If you put a bipod and recoil stock etc onto a super accurate sniper rifle, you should NOT find that it becomes crap as soon as you load the .300 winmag rounds into it.

That’s currently my problem with my sniper rifles. Half the weapon mods I can put on them are pointless because I only need the other half to improve the stats of the rifle.

The bullets then ruin everything I just achieved.

---

<div class="post-metadata">

**Author:** ![bostltch](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/bostltch/32/3226_2.png) [@bostltch](https://discourse.cataclysmdda.org/u/bostltch)\
**Post date:** [September 20, 2016, 12:57am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/43 "2016-09-20T00:57:28Z")

</div>

> [@Latest experimental features](https://discourse.cataclysmdda.org/t/latest-experimental-features/5582/1):
>
> EDIT: Questions about such features are off-topic for this thread, and will be moved or deleted based on my mood. If you want to ask a question about something, ask it in the appropriate subforum.

Not exactly enforced now and I’ve gone off topic on this thread before too I think but yeah, this. Not trying to sound mean, just so it remains as on topic as possible you know?

---

<div class="post-metadata">

**Author:** ![TheWumpus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/thewumpus/32/263_2.png) [@TheWumpus](https://discourse.cataclysmdda.org/u/TheWumpus)\
**Post date:** [September 20, 2016, 2:34pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/44 "2016-09-20T14:34:23Z")

</div>

[quote=“DG123, post:42, topic:12750”]Would it be possible to do something so that gun mods affect bullet recoil/dispersion?

“Currently” (in my outdated version) you can mod the crap out of a rifle to be perfectly accurate and have zero recoil… and as soon as you put bullets in it, it has insane recoil and the bullets can miss the target again.

This doesn’t make sense. If you are using weapon enhancements that physically stop the weapon from recoilling, that should be able to counteract the recoil generated by the bullets.

If you put a bipod and recoil stock etc onto a super accurate sniper rifle, you should NOT find that it becomes crap as soon as you load the .300 winmag rounds into it.

That’s currently my problem with my sniper rifles. Half the weapon mods I can put on them are pointless because I only need the other half to improve the stats of the rifle.

The bullets then ruin everything I just achieved.[/quote]

To the best of my knowledge, firearm and ammunition dispersion/recoil are calculated separately, with the sum of the two being used for the final value. I could be completely wrong (because I’m not a programmer) BUT I believe a temporary workaround might be to edit either firearm or ammunition values in their respective .json files. If you say, reduced the base recoil of a firearm to 0, and its corresponding ammunition type dispersion to 0, any mods you attach to a weapon would be much more effective. You’d be getting your recoil values from the ammo alone, and dispersion from weapon alone. A sniper rifle with a bipod, recoil stock, compensator, match trigger, etc would function much more reliably in that situation.

I’m pretty sure this would break intended balance to take the numbers down to that extreme.

---

<div class="post-metadata">

**Author:** ![DG123](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DG123](https://discourse.cataclysmdda.org/u/DG123)\
**Post date:** [September 20, 2016, 11:36pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/45 "2016-09-20T23:36:09Z")

</div>

[quote=“TheWumpus, post:44, topic:12750”][quote=“DG123, post:42, topic:12750”]Would it be possible to do something so that gun mods affect bullet recoil/dispersion?

“Currently” (in my outdated version) you can mod the crap out of a rifle to be perfectly accurate and have zero recoil… and as soon as you put bullets in it, it has insane recoil and the bullets can miss the target again.

This doesn’t make sense. If you are using weapon enhancements that physically stop the weapon from recoilling, that should be able to counteract the recoil generated by the bullets.

If you put a bipod and recoil stock etc onto a super accurate sniper rifle, you should NOT find that it becomes crap as soon as you load the .300 winmag rounds into it.

That’s currently my problem with my sniper rifles. Half the weapon mods I can put on them are pointless because I only need the other half to improve the stats of the rifle.

The bullets then ruin everything I just achieved.[/quote]

To the best of my knowledge, firearm and ammunition dispersion/recoil are calculated separately, with the sum of the two being used for the final value. I could be completely wrong (because I’m not a programmer) BUT I believe a temporary workaround might be to edit either firearm or ammunition values in their respective .json files. If you say, reduced the base recoil of a firearm to 0, and its corresponding ammunition type dispersion to 0, any mods you attach to a weapon would be much more effective. You’d be getting your recoil values from the ammo alone, and dispersion from weapon alone. A sniper rifle with a bipod, recoil stock, compensator, match trigger, etc would function much more reliably in that situation.

I’m pretty sure this would break intended balance to take the numbers down to that extreme.[/quote]

But right now I’m not seeing how the balance makes any sense. Sniper rifles don’t work as sniper rifles because you can’t lower the dispersion enough. And the effective range is too short. Which leads to using them when enemies are actually pretty close… upon which you find that the massive recoil that you can’t reduce causes the gun to be worthless after the first couple of shots so you end up reverting to using a shotgun, or the amazing Symbol of Judgement.

Match triggers etc are pointless on sniper rifles and only worth using on pistols etc where the gun itself is inherently inaccurate. Or maybe on a rather crappy long ranged rifle? Something seems awfully wrong here, since I want to be using my mods on my best guns and I want to see them being useful.

---

<div class="post-metadata">

**Author:** ![DG123](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DG123](https://discourse.cataclysmdda.org/u/DG123)\
**Post date:** [September 20, 2016, 11:37pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/46 "2016-09-20T23:37:31Z")

</div>

> [@Random\_dragon](#):
>
> Welp, the two major fuckups for my mods (Arcana and Tanks) have both been fixed. Back to vanishing from here again.

Nooo! You’ve got to somehow implement blood fuelled cursed Berserker armour in the arcana mod first!

---

<div class="post-metadata">

**Author:** ![TheWumpus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/thewumpus/32/263_2.png) [@TheWumpus](https://discourse.cataclysmdda.org/u/TheWumpus)\
**Post date:** [September 22, 2016, 2:38am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/47 "2016-09-22T02:38:09Z")

</div>

[quote=“DG123, post:45, topic:12750”]But right now I’m not seeing how the balance makes any sense. Sniper rifles don’t work as sniper rifles because you can’t lower the dispersion enough. And the effective range is too short. Which leads to using them when enemies are actually pretty close… upon which you find that the massive recoil that you can’t reduce causes the gun to be worthless after the first couple of shots so you end up reverting to using a shotgun, or the amazing Symbol of Judgement.

Match triggers etc are pointless on sniper rifles and only worth using on pistols etc where the gun itself is inherently inaccurate. Or maybe on a rather crappy long ranged rifle? Something seems awfully wrong here, since I want to be using my mods on my best guns and I want to see them being useful.[/quote]

1. Firearm calculations are weird. It’s possible to have negative recoil and negative dispersion. Try it and see what happens.
2. Per the devs range is currently limited (bugged) at 30 max.

---

<div class="post-metadata">

**Author:** ![BorkBorkGoesTheCode](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/borkborkgoesthecode/32/2343_2.png) [@BorkBorkGoesTheCode](https://discourse.cataclysmdda.org/u/BorkBorkGoesTheCode)\
**Post date:** [September 22, 2016, 4:59am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/48 "2016-09-22T04:59:16Z")

</div>

> [@Latest experimental features](https://discourse.cataclysmdda.org/t/latest-experimental-features/5582/1018):
>
> Looks like the guns have been heavily nerfed. My survivor-carbine doesn’t even seem to hit a hulk which is 20 tiles away.

Until calculations are fixed, all guns have a hardcoded 30 tile max range. If you can solve this math problem, please PR a fix on GitHub as soon as possible, it is badly needed. If you can fix the technical problem that forces a hard cap of 60 due to the reality bubble, that would also be needed. The discussions around these subjects are archived in the links; Please refrain from posting complaints, as a technical solution carries more weight:

> <https://github.com/CleverRaven/Cataclysm-DDA/issues/18299>
>
> Known and all, but I'm just leaving it out as a reminder that arbitrary hard cap… isn't the right way to do it.
> A reality bubble cap is necessary, 30 tiles cap isn't.
> 
> Ideas:
> \- Add a deterministic penalty that scales with range. Essentially a cap on accuracy. If high, it would prevent getting hits near cap. If low, it could still allow guaranteed headshots for overpowered characters.
> \- Add a hard low cap on dispersion.
> \- Revise dispersion calculations to prevent near-0 dispersion guns naturally, then nerf all 0 dispersion guns and give them something sensible. Most important parts would be to add some "soft cap" on json dispersion (as in adding a note that "not even futuristic guns should have less than 60 dispersion") and then revising how gunmods affect dispersion. Most likely by making gunmods apply multipliers rather than additions/subtractions. Would also require getting rid (or nerfing) of "accurizing".
> \- Some range-dependent special case. For example, dispersion penalty that is 0 until soft range cap and then rises with range.
> \- Generate \`missed\_by\` with a normal distribution rng.

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/18020>
>
> Our current aiming formula uses total dispersion σ (arc minutes) to calculate th…e tangent of an isoceles triangle formed by the player, intended target and actual target. The relationship is expontential:
> 
> !\[range\](https://cloud.githubusercontent.com/assets/12238606/17642715/acf021e6-6148-11e6-83be-3b9654ebdc1e.png)
> 
> Effective range is defined as the length of either equal side for triangle with vertex angle θ = σ and with a tangent of 0.25 (derived from 50% chance of \`accuracy\_goodhit\`).
> 
> Total dispersion is calculated as \`σ = W + P + R\` where:
> \- \`W\` is the constant sum of the weapon and ammo values
> \- \`P\` is determined from player skill
> \- \`R\` is current effective recoil
> 
> If we intend for \`MAX\_RANGE\` of 30 the usable values for constant \`W\` fall within the range \[100,600\]:
> 
> !\[scaled\](https://cloud.githubusercontent.com/assets/12238606/17642722/2c1d8576-6149-11e6-84da-965ef2a21570.png)
> 
> Aiming reduces \`R\` so the distance between \`MIN\_RECOIL\` and effective \`sight\_dispersion\` controls how much range improves with aiming (how far left you move on the above graph).
> 
> The current range of \`P\` is \[0-250\] dependent both upon \`marksmanship\` and relevant weapon skill. Reducing \`P\` also results in moving left on the graph with the effects dependent upon σ from other sources: low \`P\` has much more effect if \`W\` is also low.
> 
> In other words player skill (P) is only relevant for already accurate weapons and should be balanced around these:
> 
> | item | W + Rmin (MoA) | Range at P0 | Range at P5 |
> | --- | --- | --- | --- |
> | Glock 19 | 360 + 90 = 450 | 5 | 6 |
> | R700+scope | 30 + 0 = 30 | 12 | 22 |
> 
> If we change \`P\` to be dependent only upon \`marksmanship\` (in linear proportion) we can decide on the range \[P0,P10\] based upon \`Rmin\` and \`W\`.
> 
> Currently \`Rmin\` is zero when using the the \`rifle\_scope\` after maximum aiming at \`PER 10\` and there is no reason to change this. We can also presume P10 (maximum \`marksmanship\`) is zero.
> 
> Knowing this we define an accurate rifle as \`W=120\` which at \`P10\` and \`Rmin\` gives an effective range of 29. If we remove the scope and use iron sights we might expect a reduction in range of at least 50% - this would be \`σ=240\` based on an increase from \`Rmin=0\` to \`R=120\`.
> 
> If we then define a typical rifle as \`W=180\` the following applies:
> 
> | Item | Iron sights (120) | Rifle scope (0) |
> | --- | --- | --- |
> | Typical rifle (180) | 12 | 19 |
> | Accurate rifle (120) | 14 | 29 |
> 
> These values are reasonable - adding a better sight to a typical rifle helps but the combination cannot be used as an alternative to the pairing of an accurate rifle with good sights.
> 
> We need to ensure that the above relationship holds true for all values of P. If we propose a linear range for P of \[0,100\] then the following apply:
> 
> | Item | P0 | P5 | P10 |
> | --- | --- | --- | --- |
> | Typical rifle + iron sights (300) | 12 | 10 | 9 |
> | Accurate rifle + iron sights (240) | 14 | 12 | 10 |
> | Typical rifle + rifle scope (180) | 19 | 15 | 12 |
> | Accurate rifle + rifle scope (120) | 29 | 20 | 16 |
> 
> We now arrive at the following definitions:
> \- \`marksmanship\` is the ability to use accurate weapons and sights
> \- The range of levels is \[0,10\] with P having the inversely proportional range \[100,0\]
> \- default sights are iron sights with \`Rmin=120\`

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/17962>
>
> \### Overview
> 
> Subset of #17712 that provides:
> \- A unit test validating \`player::…gun\_engagement\_range\`
> \- R script for producing aiming graphs
> \- Initial algorithm changes
> 
> The below is produced using the R graphing script:
> \- Uses the \`S1\` definition for a survivor (all stats 8, all skills 4) wearing light survivor gloves + mask.
> \- Weapons are loaded with default ammunition (\`9mm\`, \`223\` and \`270\`)
> \- \_Effective range\_ is defined as 50% chance of \`accuracy\_goodhit\`
> \- Chance and accuracy scale linearly with range (at half the range you have twice the accuracy)
> \### Initial status
> \- \*\*Aiming is irrelevant\*\* (slope of curve)
> a rifle scope reaches full aim after 2 turns and gains you only a single extra tile
> \- \*\*Weapon dispersion is irrelevant\*\* (y-intercept)
> a highly accurate rifle (σ=30) and an inaccurate pistol have (σ=380) differ by only two tiles
> \- \*\*Maximum range is both too low and too uniform\*\* (zenith of slopes)
> rifle with scope is only 50% better than pistol and both are useless apart from at point-blank range
> 
> !\[output\](https://cloud.githubusercontent.com/assets/12238606/17466245/3c5b01ce-5d03-11e6-8a14-e93e1fa4e1bc.png)
> \### Increase effect of aiming
> \- A 400% increase in \`MIN\_RECOIL\`to 600 results in a proportional increase in aiming time
> \_eg.\_ turns required to achieve maximum aim with \`ar\_15\` increases by 450% from 1 to 4
> \- Initial range (y-intercept) is worse, maximum range (slope zenith) is unaffected
> \- \*\*Weapon \`aim\_speed\` is irrelevant\*\*
> \`glock\_19\` has half the \`aim\_speed\` (4) of \`ar15\` (8) but their curves are identical
> 
> !\[output\](https://cloud.githubusercontent.com/assets/12238606/17466252/805fad0c-5d03-11e6-9862-4412e1ed9bff.png)
> \### Aim speed differs by weapon
> 
> \`aim\_speed\` has only trivial effect in \`Character::aim\_per\_time\`. The following implementation is both simpler and produces much better results.
> 
> \`\`\`
> int Character::aim\_per\_time( const item& gun, int recoil ) const {
> int aim = std::max( 1, 10 - gun.aim\_speed( recoil ) ) \* 3.2;
> return std::max( std::min( aim, recoil - gun.sight\_dispersion( recoil ) ), 0 )
> }
> \`\`\`
> \- Pistols and SMG's now aim faster than rifles
> \- Further improvements would require \`JSON\` changes (probably rescaling \`aim\_speed\`)
> 
> !\[output\](https://cloud.githubusercontent.com/assets/12238606/17466274/1255681e-5d04-11e6-80e9-068fd1bc46ec.png)
> \### Increase effect of weapon stats
> \- \*\*Player skills have too much effect\*\*
> from nil to maximum skill is Δσ=600, whereas from a pistol to a rifle is typically Δσ=300.
> \- \*\*\`markmanship\` has too little effect\*\*
> only 25% of player dispersion results from \`marksmanship\`
> 
> Considering few players will reach \`marksmanship 10\` and even fewer will max out a ranged skill we need to reduce the effect whilst still granting a bonus for each successive level. The following works well reducing both the overall effect and making \`marksmanship\` twice as important as weapon skill:
> 
> \`\`\`
> int Character::skill\_dispersion( const item& gun ) const
> {
> if( weapon\_lvl \< 10 ) {
> dispersion += 5 \* ( 10 - lvl );
> }
> if( marksmanship\_lvl \< 10 ) {
> dispersion += 10 \* ( 10 - marksmanship\_lvl );
> }
> }
> \`\`\`
> 
> !\[output\](https://cloud.githubusercontent.com/assets/12238606/17466284/6171cba4-5d04-11e6-9e9e-169c40abe3f0.png)
> \### Drop excessive penalty from stats
> \- Stat penalties via \`ranged\_dex\_mod()\` and \`ranged\_per\_mod()\` were implemented when character generation encouraged Min-Maxing and most characters had stats of 12
> \- Currently an average survivor has a penalty of σ=120 with the lowest possible penalty being σ=90
> \- If we drop the penalty level to 8 a typical players doesn't receive a penalty \*\*except\*\* when subject to pain or other stat modifying effects.
> \- Later we could consider applying a non-uniform penalty so more difficult shots required better stats
> 
> !\[output\](https://cloud.githubusercontent.com/assets/12238606/17466288/7f56faae-5d04-11e6-87af-75bfedb50a49.png)
> \### Summary
> \- Although later JSON changes will be required the major problem is the algorithms. Fortunately the above fixes are not especially intrusive and significant gains can be made \*\*without\*\* rewriting the aiming subsystem.
> \- Rescaling of JSON data can be done once the above changes are made and after further unit tests are devised. These should specify the expected range for suitable test items under specific circumstances. \*\*Suggestions as to such tests are welcomed\*\*

> <https://github.com/CleverRaven/Cataclysm-DDA/issues/17643>
>
> \### Summary
> 
> \*\*Effective range of guns is too low and unaffected by weapon type,… skill, gunmods or aiming\*\*
> 
> If we define effective range as a 50% chance of a \_good hit\_ on the first shot then effective range for the following guns used at different stages of the game is:
> 
> | item | early | mid | late |
> | --- | --- | --- | --- |
> | Glock 19 | 3 | 3 | 3 |
> | MP5 | 3 | 3 | 3 |
> | AR-15 | 4 | 4 | 4 |
> 
> This explains why in DDA everyone walks around with a shotgun and a big handgun and engages targets at point-blank range. Rifles in particularly are especially useless.
> 
> The algorithm (with code sources) is set out below or otherwise skip to \*\*Plan\*\*.
> \### Proof
> 
> Dispersion (σ) is expressed in minutes of arc and is the sum of penalties from
> the player and their weapon. Player penalties are calculated as follows:
> 
> \`\`\`
> \# Weapon and marksmanship skill 
> (10 - WEAP) \* 45 # Character::skill\_dispersion()
> (10 - GUN ) \* 15 # Character::skill\_dispersion()
> 
> \# Player stats
> (12 - DEX) \* 15 # Character::ranged\_dex\_mod()
> (12 - PER) \* 15 # Character::ranged\_per\_mod()
> 
> \# Clothing encumbrance
> EYES \* 6 # player::get\_weapon\_dispersion()
> HANDS \* 6 # player::get\_weapon\_dispersion()
> \`\`\`
> 
> An additional penalty applies for recoil. The default is \`MIN\_RECOIL\` of 150
> with lower values achieved by aiming and higher values resulting from recoil.
> 
> We can calculate player dispersion (σ) for some typical survivors:
> 
> | | description | GUN | WEAP | DEX | PER | EYES\* | HANDS^ | Pσ |
> | --- | --- | --- | --- | --- | --- | --- | --- | --- |
> | S1 | early game | 2 | 2 | 8 | 8 | 5 | 0 | 630 |
> | S2 | mid game | 4 | 4 | 8 | 8 | 10 | 5 | 570 |
> | S3 | late game | 6 | 6 | 9 | 9 | 15 | 10 | 510 |
> 
> \`\*\` safety goggles, light survivor mask, heavy survivor mask
> \`^\` fingerless leather gloves, light survivor gloves, survivor gloves
> 
> Weapon dispersion (Wσ) is simply the sum of the gun and ammo dispersion:
> 
> | | description | GUN | AMMO | Wσ |
> | --- | --- | --- | --- | --- |
> | G1 | Glock 19 | 240 | 140 | 380 |
> | G2 | MP5 | 150 | 140 | 290 |
> | G3 | AR-15 | 5 | 80 | 85 |
> | G4 | 700NX + scope | 60 | 15 | 75 |
> 
> Chance to hit (k) is calculated in \`Creature::projectile\_attack\` as:
> 
> \`\`\`
> σ = Pσ + Wσ + recoil 
> t = π / 180 / 60 \* 0.745
> k = range \* σ \* t
> \`\`\`
> 
> Excluding monster dodges this is applied in \`Creature::deal\_projectile\_attack\`:
> 
> | k | result | multiplier |
> | --- | --- | --- |
> | \< 0.1 | headshot | 2.45 - 3.35 |
> | \< 0.2 | critical | 1.75 - 2.30 |
> | \< 0.4 | good hit | 1.00 - 1.50 |
> | \< 0.6 | | 0.50 - 1.00 |
> | \< 0.8 | grazing | 0.00 - 0.25 |
> 
> Dispersion is applied randomly so resuming an even distribution the typical
> effective dispersion (x̄σ) will be half and is calculated as follows:
> 
> \`\`\`
> x̄σ = ( Pσ + Wσ + recoil ) / 2
> \`\`\`
> 
> The below shows average dispersion (x̄σ) for some combinations:
> 
> | | description | Wσ | recoil\* | S1 | S2 | S3 |
> | --- | --- | --- | --- | --- | --- | --- |
> | G1 | Glock 19 | 380 | 150 | 579 | 550 | 525 |
> | G2 | MP5 | 290 | 150 | 536 | 506 | 476 |
> | G3 | AR-15 | 85 | 150 | 432 | 402 | 372 |
> | G4 | 700NX + scope | 75 | 0 | 352 | 322 | 292 |
> 
> \`\*\` G1-G3 \_'from the hip'\_ whereas G4 is after maximum aiming
> 
> If we define effective range as a 50% chance to yield a good hit (k\<0.4) on the
> first shot each of the following combinations has the following effective ranges:
> 
> | | description | S1 | S2 | S3 |
> | --- | --- | --- | --- | --- |
> | G1 | Glock 19 | 3 | 3 | 3 |
> | G2 | MP5 | 3 | 3 | 3 |
> | G3 | AR-15 | 4 | 4 | 4 |
> | G4 | 700NX + scope | 5 | 5 | 6 |
> 
> These values are of course all (much) lower on subsequent shots due to the effects of \`recoil\`. I've included \`G4\` as it illustrates both gunmods and aiming having very little overall effect.
> \### Plan
> 
> Comments as to the following or alternative suggestions:
> \- \`pistol\` and \`shotgun\` are already well balanced having both limited range and being reasonably controllable in \`semi-auto\` mode.
> \- \`smg\` needs a small increase in range and a meaningful ability to use \`auto\` mode within this range.
> \- \`rifle\` needs an increase in range relative to all of the other groups
> \- Additional \`sights\` need to have more of an effect.
> \- Skill should provide more of an effect than just offsetting the inevitably better (and usually higher encumbrance) clothing that a player wears.
> \### Implementation
> 
> TODO

> <https://github.com/CleverRaven/Cataclysm-DDA/pull/17656>
>
> Follows #17643 and intentionally does \*\*not\*\* adjust balance but provides a fram…ework for doing so.
> 
> Firstly some minor refactoring of the code to use standard trigonometric functions (ad7bc2b). We seem to use varying definitions of the accuracy levels so a start is made in 33d46b7 to standardise these. There is one behavioral change in that the full range \[0-1\] is now considered a hit.
> 
> With one exception (corrected in 79617ca) effective recoil is uniformly distributed from 0 to maximum and this is exploited to allow the inverse calculation in \`player::gun\_effective\_range\`. This function allows you to determine at what \`range\` a player has a given \`chance\` of achieving a degree of \`accuracy\`.
> 
> The skeleton of a unit test is provided with the intention of extending it to include cases along the lines of \_9mm pistol should have a 50% chance of a good hit at 3 tiles after 1 turn of aiming\_.
> 
> The stats dumper can now export various effective ranges for addressing future overall balance and finding outliers. The definition of a standard survivor is contained there (8/8/8/8 stats, 4/4 skills with relevant kit) and is supposed to represent the typical mid-game survivor. I don't think it needs much adjustment but if anyone feels strongly that could be done.
> 
> Less well defined is effective range displayed to the player. I've dropped the previous \`range\` field from \`item::info\` as its useless to the point of completely misleading. For example an AR-15 does not have a range of even close to 36.
> 
> Instead I've defined effective range as \_50% chance of good hit spanning from nil to maximum aim\_ which is a much more useful metric. Support is included for comparing between weapons and the debug menu provides a useful way of determining how various factors affect it. For example adding adding a scope, increasing marksmanship etc.
> 
> Note this isn't the maximum absolute range (although it is constrained by it) and it isn't to say guns aren't usable beyond their effective range. It does however provide a good indication where you have at least a better than average chance of scoring a hit. It is my intention to update turrets and NPCs to consider effective range as both will spam ammo at targets they have no realistic chance of hitting.
> 
> EDIT: Note \`player::gun\_effective\_range\` was later renamed \`\`player::gun\_engagement\_range\`

---

<div class="post-metadata">

**Author:** ![mugling](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@mugling](https://discourse.cataclysmdda.org/u/mugling)\
**Post date:** [September 22, 2016, 10:36am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/49 "2016-09-22T10:36:44Z")

</div>

1. Firearm calculations are weird. It’s possible to have negative recoil and negative dispersion. Try it and see what happens.

Both of these should be impossible. Additionally there is a PR going through that tackles recoil to make burst fire usable. Are you using the latest build (there was a buildbot problem for a while) - I ask because most of the dispersion comes from the guns and not from the ammo and the OP’s posts suggests otherwise.

1. Per the devs range is currently limited (bugged) at 30 max.

It’s to do with the dispersion curve, the fix for which is non-trivial. Range capping at 30 should only affect a handful of highly accurate weapons and given the OP struggles at 20 tiles won’t be the cause here. As a whole the other guns became a lot more usable across a range of distances. You are waiting until maximum aim? There won’t ever be a ‘fix’ for shooting beyond the reality bubble though.

---

<div class="post-metadata">

**Author:** ![mugling](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@mugling](https://discourse.cataclysmdda.org/u/mugling)\
**Post date:** [September 22, 2016, 6:22pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/50 "2016-09-22T18:22:12Z")

</div>

> [@Valpo](#):
>
> Is it possible to make the size of the reality bubble adjustable ingame so one can enlarge it for sniping purpose?

No, it would get slow very quickly

---

<div class="post-metadata">

**Author:** ![Duros](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@Duros](https://discourse.cataclysmdda.org/u/Duros)\
**Post date:** [September 27, 2016, 7:23am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/51 "2016-09-27T07:23:55Z")

</div>

> [@mugling](#):
>
> [quote=“Valpo, post:89, topic:9298”]Is it possible to make the size of the reality bubble adjustable ingame so one can enlarge it for sniping purpose?

No, it would get slow very quickly[/quote]

Well how about making sniping with weapons a feature by the player having to set a direction, N/NE/E etc, then instead of the “bubble” rendering everything the game just calculates a wedge in front of the player, a wedge that’s 45-50 tiles long with an arc of say 10/15 degrees would STILL have to calculate a lot less than a circle of 15-30 tiles

Pi 30^2= ~2827 tiles^2

((Pi (60^2)) /24= 471 tiles^2

And that’s only an arc of 15 degrees 60 tiles long, considering it would be a key command and only usable on certain weapons this would make sense, no?

---

<div class="post-metadata">

**Author:** ![TheWumpus](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/thewumpus/32/263_2.png) [@TheWumpus](https://discourse.cataclysmdda.org/u/TheWumpus)\
**Post date:** [September 29, 2016, 2:41am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/52 "2016-09-29T02:41:53Z")

</div>

[quote=“DG123, post:92, topic:9298”]I have to say I’m not fond of some weapons needing to be mounted on tables or dirt piles before firing…

If you have power armour it seems reasonable to use them unmounted.

On the same note there’s no real reason why you can’t use a minigun unmounted except weight. They don’t have massive recoil.[/quote]

That’s probably a half second burst. Yes, yes they do have massive recoil.

---

<div class="post-metadata">

**Author:** ![DG123](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DG123](https://discourse.cataclysmdda.org/u/DG123)\
**Post date:** [September 30, 2016, 12:28pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/53 "2016-09-30T12:28:49Z")

</div>

[quote=“TheWumpus, post:52, topic:12750”][quote=“DG123, post:92, topic:9298”]I have to say I’m not fond of some weapons needing to be mounted on tables or dirt piles before firing…

If you have power armour it seems reasonable to use them unmounted.

On the same note there’s no real reason why you can’t use a minigun unmounted except weight. They don’t have massive recoil.[/quote]

That’s probably a half second burst. Yes, yes they do have massive recoil.[/quote]

In rebuttal…

It didn’t even visibly move when he started firing.

The other guy just isn’t holding it right to compensate for the sideways “climb”. Super heavy weapons generally don’t have a massive problem with actual recoil knocking you on your arse when the calibre is reasonably small.

I’ve also found a video elsewhere of someone using a Browning M2 hip fired. Not fully auto, but it works in single shot and doesn’t seem to be all that heavy or gigantic, all things considered.

---

<div class="post-metadata">

**Author:** ![FunsizeNinja123](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/funsizeninja123/32/118_2.png) [@FunsizeNinja123](https://discourse.cataclysmdda.org/u/FunsizeNinja123)\
**Post date:** [October 1, 2016, 4:05am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/54 "2016-10-01T04:05:34Z")

</div>

Well hipfiring a m2 browning or a minigun isn’t all that practical.

---

<div class="post-metadata">

**Author:** ![The13thRonin](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@The13thRonin](https://discourse.cataclysmdda.org/u/The13thRonin)\
**Post date:** [October 1, 2016, 8:06am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/55 "2016-10-01T08:06:19Z")

</div>

> [@FunsizeNinja123](#):
>
> Well hipfiring a m2 browning or a minigun isn’t all that practical.

Practicality is my #1 concern when I’m engaging zombies and triffids in hand to hand combat with my eight tentacles.

… Really dude?

Practicality…?

Also MASSIVE RECOIL: [https://www.youtube.com/watch?v=oJp0OmlYFS4](https://www.youtube.com/watch?v=oJp0OmlYFS4)

lol… You’ve gotta be a 50 foot tall tank like the beast in this video to fire a mini-gun from the hip. LOOK AT THE SIZE OF THOSE BICEPS.

The reason they mount mini-guns is mostly due to the weight, not the recoil. They average about 39kg. By comparison the Browning Automatic Rifle that Americans used in World War II weighed between 7-11kg (empty) and was widely considered to be extremely heavy and cumbersome. Holding 39kg? Possible… Lugging 39kg around (carried in your arms) for a long period of time and firing accurately if you do with all that arm fatigue? Extremely difficult if not outright impossible. The heavy weight however actually acts to lower the recoil a great deal. So if the character can carry a mini-gun then they should be able to shoot it from the hip.

---

<div class="post-metadata">

**Author:** ![Hibou](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/hibou/32/1330_2.png) [@Hibou](https://discourse.cataclysmdda.org/u/Hibou)\
**Post date:** [October 1, 2016, 8:47am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/56 "2016-10-01T08:47:11Z")

</div>

All three videos with those hipfired miniguns are shooting the same minigun (the [DeGroat M134](http://www.degroattactical.com/miniguns.htm) (according to their descriptions)) which uses the same cartridge that the ingame minigun ingame fires (the .308 or 7.62x55m), meaning that it is technically possible to fire that minigun from the hip, provided you have a shoulder strap. In regards to whether or not you can actually hit something that way, the videos are inconclusive.

I agree with Funsize on the M2 Browning statement. Those things are as long as the average person is tall, and fire the .50 BMG round, which carries a lot more punch than the .308.

They’re probably limited to mounted firing for game balance reasons, that much firepower needs some kind of limitation. Maybe with enough strength you could hipfire them, but even then accuracy would still be a concern.

---

<div class="post-metadata">

**Author:** ![DG123](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DG123](https://discourse.cataclysmdda.org/u/DG123)\
**Post date:** [October 1, 2016, 11:53am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/57 "2016-10-01T11:53:19Z")

</div>

> [@The13thRonin](#):
>
> The reason they mount mini-guns is mostly due to the weight, not the recoil. They average about 39kg. By comparison the Browning Automatic Rifle that Americans used in World War II weighed between 7-11kg (empty) and was widely considered to be extremely heavy and cumbersome. Holding 39kg? Possible… Lugging 39kg around (carried in your arms) for a long period of time and firing accurately if you do with all that arm fatigue? Extremely difficult if not outright impossible. The heavy weight however actually acts to lower the recoil a great deal. So if the character can carry a mini-gun then they should be able to shoot it from the hip.

Yep.

Half the problem with the minigun is the ammo pack and the power supply adding to the weight. The ammo isn’t such a problem once you have one of the backpack kits. (At least, it holds about 1000 rounds.)  
But the power supply is pretty heavy.

But considering in Cataclysm you’ve already got UPSes this wouldn’t be an issue.

I think the minigun should be a weapon you can use with a UPS and power armour at least. It’s not like I’ve even found one of the blasted things in game yet. And the ammo usage is ridiculous, so I don’t think this would mess up the game balance much.

---

<div class="post-metadata">

**Author:** ![DG123](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@DG123](https://discourse.cataclysmdda.org/u/DG123)\
**Post date:** [October 1, 2016, 11:58am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/58 "2016-10-01T11:58:16Z")

</div>

I’ll just leave this here…

[http://revision3.com/fullmag/handheld-m2](http://revision3.com/fullmag/handheld-m2)

---

<div class="post-metadata">

**Author:** ![noname1208](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/noname1208/32/23_2.png) [@noname1208](https://discourse.cataclysmdda.org/u/noname1208)\
**Post date:** [October 5, 2016, 4:48am UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/59 "2016-10-05T04:48:41Z")

</div>

Wait a minute… A two by four is 1500mL? Okay

---

<div class="post-metadata">

**Author:** ![Profugo\_Barbatus](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@Profugo\_Barbatus](https://discourse.cataclysmdda.org/u/Profugo_Barbatus)\
**Post date:** [October 5, 2016, 3:01pm UTC](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750/60 "2016-10-05T15:01:11Z")

</div>

> [@noname1208](#):
>
> Wait a minute… A two by four is 1500mL? Okay

That sounds a bit small, if anything. Really small, now that I think of it.

[Previous page](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750.md?page=2)

[Next page](https://discourse.cataclysmdda.org/t/latest-experimental-features-tangent-and-new-feature-discussion/12750.md?page=4)
