TF2 projectiles are discrete entities spawned when a weapon fires. They live in the server DLL, replicate a minimal networked state to the client, and resolve collision, damage, and effects on touch. The full hierarchy is documented at the top ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sr2echa/TF2-Source-Code/llms.txt
Use this file to discover all available pages before exploring further.
game/shared/tf/tf_projectile_base.h.
Class hierarchy
Projectile types
| Class | Launched by | Deflectable | Crit support |
|---|---|---|---|
CTFProjectile_Rocket | Rocket Launcher | Yes | Yes (m_bCritical) |
CTFGrenadePipebombProjectile | Grenade / Stickybomb Launchers | No | Yes |
CTFProjectile_Arrow | Huntsman, Crossbow | No | Yes (m_bCritical) |
CTFProjectile_Flare | Flare Gun | No | Yes |
CTFProjectile_EnergyBall | Righteous Bison / Pomson | No | Yes |
CTFProjectile_Nail | Nailgun (legacy) | No | Yes |
CTFBaseProjectile — shared base
CTFBaseProjectile (shared between client and server) holds the minimum networked state:
m_vInitialVelocity is networked so the client can reproduce the flight path for interpolation without a full physics simulation.
CTFProjectile_Rocket
Rockets implementIScorer to correctly attribute assisted kills:
IsDeflectable() returns true, allowing the Pyro’s airblast to call Deflected() and reverse the rocket’s ownership and direction. The m_bDirectHit flag changes GetWeaponID() to return TF_WEAPON_ROCKETLAUNCHER_DIRECTHIT, enabling separate damage scaling for direct hits.
CTFProjectile_Arrow
Arrows embed into surfaces and players via bone attachment:StrikeTarget selects the hit hitbox, PositionArrowOnBone parents the arrow entity to the struck bone so it moves with ragdolls and players. BuildingHealingArrow handles the Crusader’s Crossbow bolt healing buildings.
Critical hit detection
All projectile types propagate crit state throughm_bCritical (a CNetworkVar on rockets). The launcher sets this flag via SetCritical() before spawning the projectile, based on CalcIsAttackCritical() in the weapon class. On touch/impact the projectile passes the flag into the CTakeDamageInfo struct to apply the 3× crit multiplier.
Mini-crits and full crits are differentiated via damage type flags (
DMG_CRITICAL) rather than a separate projectile class, so the same entity handles both cases.