User:Randomname90001/Sandbox
This page just contains some random fun facts and technical information. This is really only meant for people like me who like scrolling through the wiki and reading whatever random stuff comes their way.
Contents
Projectile Offsets
- Offsets are in the format of "vForward, vRight, vUp."
- Flipped Viewmodel offsets are present if they exist.
- Forward vectors extend directly from your screen, so a 16 hammer unit offset would put the projectile 16 hammer units in front of where you are looking.
- Right vectors are perpendicular to the forward vector, they will move the projectile to the right or left of where you are looking.
- Up vectors are, again, perpendicular to the forward vector, they move the projectile up or down to where you are looking.
- Pitch is basically just up and down in terms of rotation, subtracting rotates it up, adding rotates it down.
Jars and Cleaver
- Normal: 16, 8, -6
- Flipped: 16 -8, -6
Lunchboxes
- Normal: 0, 0, -8
- 10 degrees are removed from the pitch of the player's eye angles.
Grenade Launchers and Stickybomb Launchers
- Normal: 16, 8, -6
- Flipped: 16, -8, -6
Rocket Launchers and Flare Guns
- Normal: 23.5, 12, -3
- Crouching: 23.5, 12, 8
- The Original: 23.5, 0, -3
Arrow weapons
- Note: Viewmodel offsets are switched between flipped and normal because of weirdness in how the Huntsman, and by extension, other arrow weapons were coded.
- Normal: 23.5, -8, -3
- Flipped: 23.5, 8, -3
Syringes
- Normal: 16, 6, -8
- Flipped: 16, -6, -8
Pomson 6000
- Normal: 23.5, -8, -16
- Flipped: 23.5, 8, -16
- Crouching: 23.5, -8, -5
Bison and Cow Mangler 5000
- Normal: 23.5, -8, -3
- Flipped: 23.5, 8, -3
- Crouching: 23.5, -8, 8
Why the Flamethrower's Healing Debuff is Broken
You might seen sigsegv's video about Meet Your Match's Flamethrower debuff, and how it is wildly inconsistent, rarely ever being the actual stated 20% (previously 25%) decrease in healing. Well, now that we have the source code, we can see what went wrong.
- Continuous healing sources add their HP/s divided by 66 to the player's total healing fraction every tick. This healing for the tick is added to the player's total healing fraction, which will have the integer portion removed and added to the player's health when it is equal to or greater than 1. After all the healing for the tick has been accumulated and added to the total healing fraction, the 20% multiplier is applied to it.
- The problem comes from the fact that the multiplier applied to the TOTAL healing fraction instead of the healing added for that tick, meaning our total healing is being reduced every tick, even if we had healing before that wouldn't've been reduced. Some healing sources do not heal enough, and continuously get reduced below one due to the multiplier beating it out, preventing any healing from being accrued.
- If a server were to be under heavy stress, or had a low tick rate, the effective reduction from the debuff would be reduced, and become more accurate to the 20% decrease it's supposed to be.
The 2 Unusual Rates We (probably) Have
As you may know, we only have an estimate for the Unusual chances for normal crates, BUT we do have the Unusual chance for... 2 crates... those being the Mann Co. Director's Cut Reel, and the Mann Co. Stockpile Crate. If the code comments[1] and the item schema are anything to go by, there is a roughly 0.47% chance of an Unusual being unboxed from these crates.
Misleading Source Locations
For weapons that don't really match up with the name of their source file.
Scout
- Shortstop : game/shared/tf/tf_weapon_pistol.cpp
- Scout's Drinks : game/shared/tf/tf_weapon_lunchbox.cpp
- Flying Guillotine : game/shared/tf/tf_weapon_jar.cpp
- Sandman Stun Ball : game/shared/tf/tf_weapon_bat.cpp
Soldier
- Cow Mangler 5000 : game/shared/tf/tf_weapon_particle_cannon.cpp
- Cow Mangler 5000 rockets : game/server/tf/tf_projectile_energy_ball.cpp
- Buff Banner and its variants : game/shared/tf/tf_weapon_buff_item.cpp
Demoman
- Stickies (and normal Pipes) : game/shared/tf/tf_weapon_grenade_pipebomb.cpp
- Stickybomb Launcher : game/shared/tf/tf_weapon_pipebomblauncher.cpp
Engineer
- Rescue Ranger : game/shared/tf/tf_weapon_shotgun.cpp
- Rescue Ranger bolts : game/server/tf/tf_projectile_arrow.cpp
- Wrangler : game/shared/tf/tf_weapon_laser_pointer.cpp
- Short Circuit : game/shared/tf/tf_weapon_mechanical_arm.cpp (MYM version, not accurate to current TF2)
- Gunslinger : game/shared/tf/tf_weapon_wrench.cpp
- Buildings : game/server/tf/tf_obj.cpp (building specific behavior can be found in their respective .cpp files)
Medic
- Syringe Gun needles : game/shared/tf/tf_projectile_nail.cpp
- Crusader's Crossbow bolts : game/server/tf/tf_projectile_arrow.cpp
- Milk bolt (scrapped variant of Crusader's Crossbow) : game/server/tf/tf_projectile_arrow.cpp
Sniper
- Huntsman : game/shared/tf/tf_weapon_compound_bow.cpp
- Rifolver bullet (unused) : game/server/tf/tf_projectile_arrow.cpp
- Razorback : game/server/tf/tf_player.cpp:L9568, game/shared/tf/tf_gamerules.cpp:L6032
- Kukri : game/shared/tf/tf_weapon_club.cpp
Spy
- Tranq Gun's darts (unused) : game/shared/tf/tf_projectile_nail.cpp
- Sapper (weapon, not building) : game/server/tf/tf_weapon_builder.cpp
- Disguise Kit : game/shared/tf/tf_weapon_pda.cpp
- Spy Traps PDA (unused) : game/shared/tf/tf_weapon_pda.cpp
- Spy Traps (unused) : game/server/tf/tf_obj_spy_trap.cpp
PASS Time
- PASS Time Jack : game/shared/tf/tf_weapon_passtime_gun.cpp
Mannpower
- Grappling Hook (projectile, not weapon) : game/server/tf/tf_projectile_arrow.cpp
Attribute Source Locations
Some weapon classes have attributes that are specific to them, so if you can't find an attribute, look in their .cpp file too.
- General weapon attributes : game/shared/tf/tf_weaponbase_gun.cpp, game/shared/tf/tf_weaponbase_melee.cpp, game/shared/tf/tf_weaponbase.cpp
- Some On-hit attributes and resists : game/shared/tf/tf_gamerules.cpp:L5626, game/shared/tf/tf_gamerules.cpp:L6710
Thermal Thruster
- Launch Push Force: 250 HU away from the Pyro in the x, y, and a constant 250 HU for the z. (x and y magnitude are unaffected by the Pyro's z position)
- Fall push force is scaled by how fast you are falling, being clamped between 100 and 1000 HU.
- Min Fall Push Force: 100 HU away (x, y) from the Pyro, constant 100 HU in z (in practice, this isn't achievable due to fall damage only being taken starting from 650 HU velocity, minimum is practically 222.44 HU)
- Max Fall Push Force: 300 HU
- Do note, the Z velocity won't always apply due to needing to meet a certain threshold of speed to get kicked off the ground.
- The push force is calculated by clamping the fall speed (player's Z velocity) between 100 and 1000, then lerping it between 100 and 300.
- All of these values were obtained through testing and looking at the assembly code in server.dll.
Miscellaneous Stuff I Found
All of Demoman's explosive weapons deal 25% less self-damage, regardless of whether the player is blast jumping or not.[2]