To recreate TF2's rocket jumping in Unreal, you'll need to understand these key components:
Core Physics Mechanics
Explosion Force Application
- TF2 applies radial impulse from the explosion point
- Force decreases with distance (typically inverse square falloff)
- The force vector points from explosion center to player center
- Damage and knockback are calculated separately
Key Values to Research
- Explosion radius (typically ~146 units for rockets)
- Base knockback force
- Self-damage reduction (TF2 reduces self-damage to encourage the mechanic)
- Air acceleration and max air speed values
Implementation Approach in Unreal
1. Explosion System
// Calculate knockback direction and magnitude
FVector ExplosionToPlayer = PlayerLocation - ExplosionLocation;
float Distance = ExplosionToPlayer.Size();
ExplosionToPlayer.Normalize();
// Apply falloff
float KnockbackForce = BaseKnockback * (1.0f - (Distance / ExplosionRadius));
// Apply impulse to character movement
CharacterMovement->AddImpulse(ExplosionToPlayer * KnockbackForce);
2. Air Movement
- Implement air strafing (maintaining momentum while changing direction)
- Allow velocity changes mid-air but with reduced control
- Consider implementing bunny hopping mechanics
Research Resources
TF2 Source Code References
- Look up the Source SDK for explosion physics
- Search for "CTFWeaponBaseGun::FireProjectile" implementations
- Study the "RadiusDamage" function
Community Resources
- TF2 Wiki has detailed damage/knockback formulas
- Jump community forums document precise mechanics
- YouTube channels like "Nate Fox" break down the physics
Testing Approach
- Start with basic radial impulse
- Tune self-damage reduction (TF2 uses ~40% self-damage)
- Adjust air control values until movement feels right
- Add crouch-jumping for extra height (like TF2's mechanic)
The key is balancing realism with fun - TF2's physics are intentionally "floaty" to make rocket jumping enjoyable rather than realistic.