Duck Jump Fix

From Valve Developer Community
Revision as of 03:46, 16 December 2009 by Killermonkey (talk | contribs) (Created page with '{{stub}} == Introduction == This article will show you how to fix Valve's implementation of Duck Jumping. Valve's implementation (in the Orange Box Source SDK) moves the player'…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

This article will show you how to fix Valve's implementation of Duck Jumping. Valve's implementation (in the Orange Box Source SDK) moves the player's origin upwards in the positive z-axis approximately 32 units in one frame. This causes a huge problem with prediction and hit box synchronization between the server and client. This also causes the player to appear to pop-up in the air!

To fix this issue we add an interpolation to the ducking and unducking while in the air. Since we have a short time to apply these interpolations, we speed up the rate of ducking while jumping by two times the normal ducking speed.

Requirements

  • Strong C++ background
  • Knowledge of the Source SDK
  • General knowledge of player movement

The Code

There is not much to the code, the only thing needed is to add two functions and modify two conditional statements. Below you will find a detailed breakdown of each change, so just copy and paste into the relevant sections.

GameMovement.h

Notes and Future Work