User:RotatcepS/AccuracyDiscussion
Contents
Bullet/Pellet Spread
Currently, accuracy is mostly represented as spread ratio on weapons that have it. This ratio is e.g. 30:1 on a shotgun. Unlike what one would think, this is not a random spread probability or similar odds ratio, instead it means "from 30 hammer units away, there will be 1 hammer unit of spread."
User Gearhart in January 2021 edited the shotgun ratio to 15:1 stating
"tested shotgun spread and found out that shotgun spread is actually 15:1, which is twice as much spread as the stated 30:1. And yes, I did go by spread radius instead of diameter."
In March that inconsistency with the Scattergun and other shotguns was noticed and questioned.
I agree with Gearhart, but obviously he was shortsighted in his edit as it is relevant to all the weapons.
My reasoning is independent of his tests.
Evidence
On Reddit, this 2013 post exposes the constants used for spread of all weapons. It also includes an unclear belief that this value equals "sin (degrees/2)" where degrees is believed to define the firing cone of the weapon.
In order to get a 30:1 ratio based on the shotgun's constant of 0.0675 (with believed degrees of coneAngle = 2*asin(0.0675)) the math is
(1/tan( coneAngle/2 )) * 2 = 29.562052567253
(rounds up to 30)... the angle's division by 2 makes sense if we believe coneAngle is the angle defining the full diameter of the cone. But even with that we have to multiply the result by 2 to get the "right" value. Without that arbitrary multiplier, we'd get the same value Gearhart states.
If we instead assume the code value is the coneAngle itself (in radians, full diameter of the cone) and don't multiply the result arbitrarily by 2, the math is
(1/tan( 0.0675/2 ))=29.61837877524
This calculation and the post's numbers give the pistol a 50:1 ratio (recoil after first shot) where (1/tan( 0.04 / 2)) = 49.9933, the Minigun a 25:1 ratio where (1/tan( 0.08 / 2)) = 24.9867, and SMG and Revolver a 80:1 ratio (recoil after first shot) where (1/tan ( 0.025 / 2)) = 79.9958
But if we further assume the coneAngle is the radius angle, not the diameter angle, we don't divide it by 2 first, and we get
(1/tan( 0.0675 ))=14.792307977473
(rounds up to 15), matching Gearhart's edit. This would also halve all the other ratio primary numbers: pistol a 25:1 ratio (recoil after first shot) (24.9867), the Minigun a 12:1 ratio (12.4733), and SMG and Revolver a 40:1 ratio (recoil after first shot) (39.9917)
Better Representations
I don't like the 30:1 (or 15:1) as it is not meaningful. I've thought long and hard about this.
There are lots of options, of course, and here are some of them:
| Code Value | double ratio | new ratio | cone spread angle: degrees(2*asin(code)) per post |
cone spread angle: degrees(code) | spread-accuracy using double ratio (distance for all spread to likely hit target) |
spread-accuracy with new ratio |
|---|---|---|---|---|---|---|
| 0.0675 | spread of 15:1 | spread of 15:1 | 7.741° cone (if angle is full diameter)
15.482° cone (if angle is just radius) |
3.867° cone (if code is diameter angle)
7.735° cone (if code is radius angle) |
accurate at -64% range
|
accurate at -64% range
|
I believe the spread-accuracy (with new ratio) I've come up with is a much more useful representation of weapon accuracy.
Spread-accuracy representations are based on:
- hitscan hitbox width/depth minimum size of 25 Hu per a 2018 Reddit post https://www.reddit.com/r/tf2/comments/90qklv/need_help_with_the_classes_hitbox_dimensions_in/
- accurate range based on every spread shot likely to hit the hitscan hitbox
- radius angle = cone diameter angle / 2
- distanceVs1Spread = 1/(tan(radius angle))
- distanceVsHalfOfHitboxSpread = distanceVs1Spread * (0.5*hitboxWidth)
- cone diameter angle (per reddit post): (2*asin(C))
- 1/(tan( (2*asin(C)) / 2)) * (0.5*25)
- cone diameter angle (just code value as radius angle): C * 2
- 1/(tan(C)) * (0.5*25)
- cone diameter angle (just code value, preserving old ratio): C
- 1/(tan(C/2)) * (0.5*25)
Projectiles/Explosives
Projectiles have a speed, a possible arc, and other factors that affect their ability to hit a projectile hitbox. Explosives have a splash radius that causes between 100% and 50% damage to anything in that radius. How can you express Accuracy with this information aside from just saying it all out loud?
| speed | speed-accuracy (assuming mid-range: 512Hu) |
explosive-accuracy (distance (vs. mid-range) for splash (146Hu) to touch moving hitbox of average player (32Hu projectile hitbox moving from impact point at 300Hu)) |
|---|---|---|
| 1100 Hu/s | closes range in 0.5 seconds, accurate at 18% range | splash accurate at 116% range
|
This doesn't consider projectile physics nor account for any arc, but it's fairly useful for comparing.
Non-explosive projectile accuracy still only has their speed or their time-to-target range.
Other Thoughts
Since the explosive is based on minimum splash which is 50% damage, maybe a more comparable spread measure would be "50% of spread shots will hit" (distance for accurate target of 50Hu, but hitbox is 25 Hu) - "accuracy: at least 50% damage hits at -28% range"