Skip to content
TheChatArchiveThe Chat Archive
o4-mini-2025-04-16· OpenAIHugging Face LMArena Human Preference 140K

how can i find logic and physics behind rocket jumping in tf2 because i want to recreate…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-opus-4-20250514-thinking-16k’s answer.
  1. User

    how can i find logic and physics behind rocket jumping in tf2 because i want to recreate it in unreal

  2. Assistant

    Recreating TF2-style rocket‐jumping in Unreal is really just a matter of (a) modelling how TF2 computes its “knockback” impulse and then (b) applying that same impulse to your CharacterMovementComponent (or physics body) in Unreal. Below is a roadmap plus some “ready-to-plug-in” pseudo-code/blueprint tips.

    —------------------------------------------------

    1. Understand the TF2 “Knockback” model

    1. TF2 treats the rocket’s explosion as an instantaneous impulse on any nearby player.
    2. Impulse magnitude falls off linearly with distance:
      • At explosion center: 100% of base impulse
      • At max radius R: 0%
    3. Direction is simply from explosion → player.
    4. TF2 ignores friction/drag the moment you’re airborne—so you keep full impulse.

    Mathematically:

    let R       = rocket_explosion_radius  
    let d       = clamp(distance(player, explosion), 0, R)  
    let falloff = (R – d) / R             // linear falloff factor ∈ [0…1]  
    let I₀      = baseImpulse            // engine constant, e.g. ~800–1000 units  
    let I      = I₀ * falloff            // actual impulse magnitude  
    let dir     = normalize(playerPos – explosionPos)  
    ⇒ appliedImpulse = dir * I
    

    Typical TF2 constants (approx):
    • explosion_radius R ≃ 200 units
    • baseImpulse I₀ ≃ 850 units
    • gravity ≃ 650 units/s²

    —------------------------------------------------

    2. Capture “Rocket Jump” in Unreal

    A) Blueprint (Character)

    1. In your Rocket’s Explosion event, SphereOverlapActors (radius R).
    2. For each overlapping Character:
      • Compute ― dir = Normalize(GetActorLocation() – ExplosionLocation)
      • Compute ― d = Distance(...)
      • Compute ― falloff = Clamp((R–d)/R, 0,1)
      • Compute ― impulse = dir * (BaseImpulse * falloff)
      • Call ⇒ Launch Character (in Movement)
      – World Direction * Velocity: use your impulse vector
      – Check “Override X/Y” & “Override Z” if you want exact control

    B) C++ (CharacterMovementComponent)

    // In your Explosion-handling code:
    void ApplyRocketJump(ACharacter* Victim, FVector ExplosionLoc)
    {
        const float R = 200.f;             // explosion radius
        const float BaseImpulse = 850.f;   // tweakable
        FVector toVictim = Victim->GetActorLocation() - ExplosionLoc;
        float d = toVictim.Size();
        if (d >= R) return;
    
        float falloff = FMath::Clamp((R - d) / R, 0.f, 1.f);
        FVector dir = toVictim.GetSafeNormal();
        FVector impulse = dir * (BaseImpulse * falloff);
    
        // Option 1: LaunchCharacter hard-set
        Victim->LaunchCharacter(impulse, true, true);
    
        // Option 2: Add impulse via movement component
        // Victim->GetCharacterMovement()->AddImpulse(impulse, true);
    }
    

    —------------------------------------------------

    3. Tuning & “Gotchas”

    • Gravity scaling: Unreal default g≈980 cm/s². TF2 uses ~650. You may want to lower your CharacterMovementComponent→GravityScale for closer “feel.”
    • Air control: TF2 lets you tweak “airaccelerate” so you can maneuver mid-jump. In Unreal, adjust Air Control in your MovementComponent.
    • Fall damage: TF2 usually nullifies fall-damage if you rocket-jump. You can override Landed() to disable damage if last impulse was a rocket-jump.
    • Crouch-jumping: If you want the classic crouch+jump height boost, add a small upward offset to your impulse when the player is crouching.

    —------------------------------------------------

    4. Further Reading & References

    —------------------------------------------------
    With this in place, you should see your Unreal character “rocket-jump” just like in TF2. Tweak BaseImpulse, radius and your gravity/air-control settings until it feels right. Good luck—and happy rocket-jumping! 🚀

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.