User:RotatcepS/AccuracyDiscussion
Contents
Overview
I'm not sure how to discuss all of this, but I want to address a number of things regarding weapon stats.
- Inconsistent values (Weapon List vs. Stock Weapons vs. Class pages vs. individual Weapon pages).
- I've made templates for one place to get all weapon damage & weapon ammo details
- I've made table row pages using those templates for each weapon with configurable columns so they can meet the needs of each type of page (except the Function Times template) - also a matching table header page.
- Representation of weapon spread and other accuracy information
- Recent edit of Scattergun brought up that the 30:1 probably should be 15:1 (and again inconsistency became a problem), but on a related note I've always felt that ratio was a very hard to understand representation of spread.
- I've made several representations that try to let you objectively compare information between different weapons (shot spread, recoil spread, and explosion/velocity range).
- Representation of some sort of DPS value - I know DPS additions come up and are shot down a lot, but clearly people want a way to easily compare things.
- I've included this as an optional column in the table row pages.
- I've also created an alternative visual representation that combines DPS and ramp information.
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" - not exactly intuitive.
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." https://wiki.teamfortress.com/w/index.php?title=Shotgun&diff=2920735&oldid=2890435
In March that inconsistency with the Scattergun and other shotguns was noticed and questioned. Further discussion came in August while I was working on this where u/Blobbles agreed with Gearhart as I would have. Obviously Gearhart was shortsighted in his edit as it is relevant to all the weapons.
My reasoning is independent of Gearhart's tests and similar to what Blobbles wrote later than I started writing this.
Evidence
On Reddit, this 2013 post exposes the constants used for spread of all weapons. It also points to evidence that the value equals "sin(degrees/2)" where degrees is believed to define the firing cone of the weapon. A little deeper dive shows the value is likely used to define a vector of the angle away from center (the radius of the cone), so "degrees" is in fact the angle of the full diameter firing cone.
In order to get a 30:1 ratio based on the shotgun's constant of 0.0675 (with degrees of coneAngle = 2*asin(0.0675)) the math is
(1/tan( coneAngle/2 )) * 2 = 29.562052567253
(rounds up to 30)... This calculation and the post's numbers give the pistol a 50:1 ratio (recoil after first shot), the Minigun a 25:1 ratio, and SMG and Revolver a 80:1 ratio (recoil after first shot).
The angle's division by 2 makes sense considering coneAngle is the diameter of the cone, but we additionally 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 drop the arbitrary 2x multiplier, this would halve all the ratio primary numbers:
(1/tan( coneAngle/2 ))
- shotgun: 15:1 (14.781),
- pistol: 25:1 ratio (recoil after first shot) (24.98),
- Minigun: 12:1 ratio (12.4599),
- SMG and Revolver: 40:1 ratio (recoil after first shot) (39.9875)
Better Representations
I don't like the 30:1 (or 15:1) as it is not meaningful. At the least it should have been 1:15 so the first number represents amount of spread. I for a long time thought it was a ratio of odds given random spread that a given pellet would hit center. I've thought long and hard about this.
There are lots of options, of course, and here are some of them:
| Code Value | new ratio | cone spread angle: degrees(2*asin(code)) per post |
spread-accuracy using new ratio (distance for all spread to likely hit target) |
spread-accuracy with old ratio |
|---|---|---|---|---|
| 0.0675 | spread of 15:1 | 7.741° cone (if angle is full diameter)
15.482° cone (if angle is just radius) |
accurate at -64% range
|
accurate at -28% 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)
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/s)) |
|---|---|---|
| 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-accuracy (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"
I believe damage range based on tests is skewed by game physics and using actual code numbers would make more sense, then just explain that the range cannot be achieved in game. Specifically I mean you can't get 0 distance between weapon and target making the ramp-up look lower than it actually is.
Inconsistencies in Wiki
This spread issue that hasn't been applied to the Scattergun is just the tip of the iceberg. The same weapon frequently will different numbers for damage, etc. on different pages. Each page is maintained individually which is crazy. It isn't done for class information why is it done for weapon information? I've attempted to document and reconcile this information for stock weapons in this spreadsheet. I recommend converting weapon stats to templates like Category:Class_stat_tables and Category:Game_mechanics. And potentially have two sets of stats, one for observed and one for code-based.
Shotgun Damage inconsistency example:
| page | Close Range | Mid Range | Long Range |
|---|---|---|---|
| Weapons | 86-90 | 24-67 | 3-10 |
| Stock_weapons | 80-90 | 10-30 | 3-10 |
| Shotgun | 9-90 (9 / pellet) | 6-60 (6 / pellet) | 3-30 (3.168 / pellet) |
| Soldier | Base: 60
[6 damage × 10 pellets] | ||
Stickybomb Launcher:
| page | Close Range | Mid Range | Long Range |
|---|---|---|---|
| Weapons | 60-138 | ||
| Stock_weapons | 74-153 | 74-153 | 74-153 |
| Stickybomb Launcher | 144 | 120 (103-138 splash damage range) | 60 |
| Demoman | Base: 103—138 | ||
Flame thrower:
| page | Close Range | Mid Range | Long Range |
|---|---|---|---|
| Weapons | 6.82 per particle (D/D) | 4.09 per particle (D/D) (M/R) | N/A |
| Stock_weapons | 6.2 per particle (D/D) | 3.72 per particle (D/D) (M/R) | N/A |
| Flame Thrower | 6.5-13 / particle | 3.25-6.5 / particle | |
| Pyro | Base (Max): 153.5 / sec. | ||
Grenade Launcher:
| page | Close Range | Mid Range | Long Range |
|---|---|---|---|
| Weapons | 100 (D/H)
30-60 (splash) | ||
| Stock_weapons | 64-110 (D/H) | 64-110 (D/H) | 64-110 (D/H) |
| Grenade Launcher | 100
60 | ||
| Demoman | On direct hit:
Base: 100
Base: 22–64 | ||
New Templates
To support these ideas I've been playing with creating a new set of wiki templates that function as a "database" of damage and accuracy information.
- User:RotatcepS/table/primary, User:RotatcepS/table/secondary, User:RotatcepS/table/melee, User:RotatcepS/table/building weapon tables using the below templates/databases with my suggested format.
- User:RotatcepS/tests/Damage_weapon database of weapon data for Damage and AccurateRange (Maybe also a Damage_weapon_observed version as well?)
- uses User:RotatcepS/tests/Damage multiple representations of damage information
- uses User:RotatcepS/tests/AccurateRange multiple representations of accuracy based on damage information.
- uses User:RotatcepS/tests/Damage multiple representations of damage information
- examples just using Damage_weapon with Shotgun or Rocket Launcher and different "type" selections (can also do base, close, far, calculations as well as those for crit and minicrit)
- Shotgun ( | D=60 | T=0.625 | L=0.5 | H=1.5 | S=0.0675 | F=10 )
- damage: 6-60
- interval 0.625
- fragments 10
- spread-value 0.0675
- rampup 1.5
- rampdown 0.528
- spread-accuracy: accurate at 36% range
- spread-ratio: spread of 15:1
- dps: 96
- Rocket Launcher ( | D=90 | T=0.8 | L=0.5 | H=1.25 | V=1100 | E=1.0 )
- damage: 45-90
- interval 0.8
- speed (projectiles) 1100
- radius% (explosives) 1.0
- rampup 1.25
- rampdown 0.528
- velocity-accuracy: closes range in 0.5 seconds, accurate at 18% range
- explosive-accuracy: splash accurate at 116% range
- dps: 112.5 + splash
- Shotgun ( | D=60 | T=0.625 | L=0.5 | H=1.5 | S=0.0675 | F=10 )
- User:RotatcepS/tests/Ammo_weapon database of numbers required for Ammo for each weapon
- uses User:RotatcepS/tests/Ammo multiple representations of ammo and reload information
- examples
- Shotgun ( | L=6 | C=32 | F=1.0 | S=0.5 | N=shell )
- ammo: 6 / 32
- reload times: 1.0 seconds first shell, 0.5 seconds consecutive reloads
- full reload: 3.5
- Rocket Launcher ( | L=4 | C=20 | F=0.92 | S=0.8 | N=rocket )
- ammo: 4 / 20
- reload times: 0.92 seconds first rocket, 0.8 seconds consecutive reloads
- full reload: 3.32
- Shotgun ( | L=6 | C=32 | F=1.0 | S=0.5 | N=shell )
- I've also been working on an adaptive table using these templates. It's a work in progress lists several accuracy representation possibilities, and addresses several other concepts I've been thinking about, too.
- User:RotatcepS/table/primary
- examples with weapon=Shotgun or weapon=Rocket Launcher
| Weapon | Kill Icon | Ammo | Attack interval | Damage | Accurate Range | ||||
|---|---|---|---|---|---|---|---|---|---|
| Loaded | Carried | Point blank | Medium range (Base) | Long range | DPS | ||||
Stock Shotgun |
6 | 32 | 0.625 seconds | 9-90 mini-crit: 12-121 critical: 18-180 |
6-60 mini-crit: 8-81 critical: 18-180 |
3-32 mini-crit: 8-81 critical: 18-180 |
96 | 36% (shot spread) | |
Stock Rocket Launcher |
4 | 20 | 0.8 seconds | 56-112 mini-crit: 76-151 critical: 135-270 |
45-90 mini-crit: 61-122 critical: 135-270 |
24-48 mini-crit: 61-122 critical: 135-270 |
112.5 + splash | 18% (projectile) 116% (projectile splash) full splash radius | |
- examples with nocrits, nokillicon
| Weapon | Ammo | Attack interval | Damage | Accurate Range | ||||
|---|---|---|---|---|---|---|---|---|
| Loaded | Carried | Point blank | Medium range (Base) | Long range | DPS | |||
Stock Shotgun |
6 | 32 | 0.625 seconds | 9-90 | 6-60 | 3-32 | 96 | 36% (shot spread) |
Stock Rocket Launcher |
4 | 20 | 0.8 seconds | 56-112 | 45-90 | 24-48 | 112.5 + splash | 18% (projectile) 116% (projectile splash) full splash radius |
- examples with nocrits, no dps, nokillicon, no accuracy
| Weapon | Ammo | Attack interval | Damage | |||
|---|---|---|---|---|---|---|
| Loaded | Carried | Point blank | Medium range (Base) | Long range | ||
Stock Shotgun |
6 | 32 | 0.625 seconds | 9-90 | 6-60 | 3-32 |
Stock Rocket Launcher |
4 | 20 | 0.8 seconds | 56-112 | 45-90 | 24-48 |
Missing Features
- self damage info & its variants (rocket jumping, thermal thruster self damage reduction, stuff like that)
- build damage info & its variants (tracking, but not currently used)
- many weapons are still missing their custom rows, but many don't really need them.
Disputes
I had to make compromises to get a single number when there was contradiction, and in a few places my result varies from most of the wiki. Here are my explanations
In general:
- fragment weapons (pellets or minigun): weapon list shows ranges that appear to be "likely damage at that range" which, while useful, is hard to read. Instead I have provided the range of one or all pellets hitting (for instance a boss might be large enough to take every pellet from long range, and aiming at an arm might take only one pellet at point blank)
- TODO: I don't quite understand when and how rounding happens, especially for pellet shots. I do now understand that e.g. a damage nerf is per pellet, not per shot, thus FaN does more damage because of the added pellets. In general the math is working choosing a precise base shot damage and dividing it by pellets, and applying range and crit info, but occasionally a number is off by one implying a rounding difference. Also some ranges shown on weapon page seem like they're claiming a range based on missed pellets, yet the value difference is not a multiple of one pellet's damage.
- especially minicrit rampup in soldier & heavy shotgun, soldier reserve shooter, miniguns,
- weapon list ranges: weapon list shows ranges for e.g. a pistol that don't really make sense - I assume they are the range of values seen using the 2fort example distance locations, and I assume variation seen is from the random damage distance variation (or knockback on the target), but enough long range will never have a range, and true point blank will not have a range in my experience. I believe a single number (like the function times) is more useful. It also emphasizes the "simpler" nature of the single bullet weapon.
- explosive weapons: minicrit and crit information shows ranges of direct hits only while range sections show explosion radius falloff, I think showing explosive radius on all sections is less confusing.
- weapon charges and firing variants: I think the extra row for effects is the right idea and have extended it to include charge and other damage range extremes as well as other special conditions.
- shield bash: weapon list just shows base, no ramp, and shows no long range when the charge can reach a long range, but it does show head bonuses. I've included a full range even though long range damage has no reduction from base - but it still reaches the range. Head bonuses come only from certain melee weapons so I don't agree with including them on the shield bash facts any more than showing a crit gimmick or a vulnerability.
Specific disputes (where my numbers simply don't agree with the weapon list or it's not "close enough"):
- melee range - I haven't tested this but obviously there is a number that I can't find in the wiki. I'm using 50 Hu and then providing variants (long melee range) based on that.
- sapper & medigun attack intervals - they always give DPS or HPS (per-second) values, and I picked an ARBITRARY, UNTESTED attack interval and a smaller damage/healing amount (that works to give the same per-second value) since they do damage/healing more than once per second. TODO: test them and figure out how many times they each heal or damage in a second.
- sapper placement speed and range - TODO test this - I am guessing both the timing (the reason it sometimes "misses" even though the outline displays) and range are the same as melee (0.8s interval, 0.2s activation (or 0 since it's spy and knife has 0 activation), and currently assuming melee range is 50)
- Stomp (Mantreads & Thermal Thruster): 3x falling damage is relative to the class (pyro or soldier) and falling speed so that's a simple range to translate like scope charge, so I show it that way instead of a formula.
- Dragon's Fury - I have no idea why weapon list isn't including range ramp. Mine does and includes long range in that it reaches slightly beyond mid range. It really uses "already burning" to replace the flame thrower "exposure ramp" so I am presenting it similar to a ramp.
- no idea why burning minicrit shows one more than (102) I do since 1.35*75=101.25. I guess I should test that.
- also func times burning max range claims 69 when I get 68 (25*3*.90=67.5). TODO test that - maybe 90% is not right? or maybe that was originally tested too closely.
- Hot Hand - turns out it works out really well to treat it like a 2-pellet shot (you click the button once, 0, 1, or 2 slaps do damage with a base total assuming all connect). Specific details still require a custom row.
- Huo-long heater (vs. burning target) - I suspect weapon list numbers were measured with a partly cold weapon (during first second of rev), so they were lower than they theoretically would be with a hot weapon. TODO: NEEDS TO BE TESTED
- Ullapool caber - weapon list explosion values seem to be mistakes using the ramp-up value (and I don't know where the 66 comes from), not the base value.
- Func times show explosion is 75 base, 83(110%) close rampup, minicrit 111(usually shown as a range as it can include rampup) crit 225(3*75). Minicrit makes no sense as 75*1.35=101.25, and 83*1.35=112.05
- Complicated in that the explosion apparently has ramp-up for distance even though it's a "point blank" weapon, but melee does have range so that seems feasible.
- Loose Cannon - my own testing disputed what I was reading - explosion is always the same basis, contact damage/knockback only happens mid-air but does have falloff which is limited by fuse time. TODO: I didn't do all possible tests - if target/source are moving away from each other then distance could be higher before fuse goes off.
- weapon list shows "pro-rated" falloff as if it was a lower base damage and had a rampup which isn't what it says and isn't what my tests show. It's really a rampup of +0% and falloff of -50% from a base of 50. It also applies halving to minicrits and crits when that isn't true... unless it is, I didn't test that, but halving doesn't happen without minicrits or crits, and neither would apply the falloff normally.
- Stickybomb Launcher. This one is super complex.
- the main dispute is
- stock page: 74-153 (353 crit);
- weapons list: 60-138 (81-162 mini-crit; 353 crit);
- func table: 60-140 (base 120) (81-165 mini-crit; 180-355 crit)
- I say: 60-138 (base 120) (162-186 minicrit (splash min 81-93); 360 crit (splash min 180))
- mini-crits normally show the modified base range but above seemed to show base mini-crit splash range.
- above crits of 353 or 355 must come from testing, not theoretical which is otherwise in use.
- my tests never quite got 138, implying 138 is correct, just near-impossible to attain.
- originally (2010) ramp up is 115% (which is where 138 comes from) says it's same as rocket launcher
- jan 4 2015 Machinator changed to 104%
- jan 7 2015 Machinator changes to 120%
- current ramp up claims 120% (ramp down always was 50%)
- relevant patch history (doesn't seem to require these changes):
- December 22, 2014 Patch (Smissmas 2014)
- the main dispute is
Stickybombs that detonate in the air now have a radius ramp up, starting at 85% at base arm time (0.8s) going back to 100% over 2 seconds. Stickybombs that touch the world will have full radius. Stickybombs now have a more visible trail while traveling through the air. Stickybombs arm particle is slightly more visible. Damage variance on stickybombs reduced from +/- 10% damage to +/-2%. Stickybombs now have the same base blast radius as rockets. Changed from 159Hu to 146Hu.
- January 7, 2015 Patch
Fixed the air detonation radius for stickybomb jumps. Fixed stickybombs not using distance falloff during damage calculations for the first 5 seconds after being created.
- Even worse, many languages have DIFFERENT VALUES (the old 115%)
- family business TODO
Minor specifics. Need to test to verify some of these (mostly off-by-1). Equalizer claims "TF2 rounds upwards to the next highest integer." - nothing else on the wiki says that, but if true that would change these results that are all based on normal rounding. Some would still differ since the wiki shows a lower value, and some more may differ that don't right now.
- pistol: point blank 20-22 makes no sense as 15*1.5=22.5, so 23. If testing shows 22 is the most it must be due to hitbox separation, but theoretically it should list 23, IMO
- rocket launcher: ramp up (125%) 112, math says 113 (90*1.25=112.5) (minicrit 151, math says 152), likely test result caused by hitbox separation.
- value ranges seem like they're from splash damage, but low end should always be 50%, I'm certain I could produce the 50% splash number at any range even point blank (since range is player distance, not impact distance)
- direct hit: base 112, rampup 140, minicrit rampup 189 values don't match the theoretical math (90*1.25=112.5 aka 113, 112.5*1.25=140.625 aka 141, and 140.625*1.35=189.84375 aka 190). Likely test result caused by hitbox separation.
- cow mangler: TODO test if reflect-based crit is still true - I thought it changed, or maybe it works for a charge shot?
- air strike: base 76, rampup 95 values don't match the theoretical math (90*.85=76.5 aka 77, 76.5*1.25=95.625 aka 96). Likely test result caused by hitbox separation.
- shotgun (and similar): minicrit rampup 121 doesn't match math 60*1.5*1.35=121.5 aka 122.
- equalizer: minicrits 45-145 doesn't match main page (although everything is "approximate" for that weapon) 32.66*1.35=44.091 aka 44, 106.87705*1.35=144.2840175 aka 144
- flamethrowers: complicated (and hard to compare) since the numbers are small and the rate is high and the current page is not rounding like all other entries are. I show it rounded, include exposure ramp, and encourage the use of DPS to clarify the damage they produce. (see above section for dragon's fury)
- axtinguisher: wiki's "low" burning value seems to be "lowest afterburn duration invoked" (2.5s) but I'm using "lowest remaining afterburn" which should be just one tick (.5s).
- natascha: maybe this is just due to my fragment confusion, but weapon list doesn't match the math in a few items. ramp up: 40, mini-crit ramp up 56 (9-14 per bullet), but 36*.75*1.5=40.5 aka 41, 40.5*1.35=54.675 aka 55