Monday, January 16, 2012

Long Jumping, Part 1: Introduction to In-Game Technique

Preface

I spent quite a bit of time on a lengthy introduction where I introduced some concepts and theories I will use through the rest of this blog.  Well, that introduction is now over, but I hope those who read it understood why I did it and will benefit from what was written.  The goal of this blog is also the 'why' of things, not just the 'how'.  If I spent only time on tutorials and tips then the "why" could easily get lost.  The ultimate tip or tool in someone's arsenal is an understanding of learning - once you have this, you can discover what works for yourself.

Nevertheless, you can't have too much theory without the practice, and that is why I will now start discussing a specific discipline of KZ which also happens to be one of the most popular.  I will attempt to apply the concepts and theories I've explained thus far to illuminate how long jumping works, why it works the way it does, and how improving to great heights is possible.  This post will focus on the in-game technique of long-jumping - that is, the basic mechanics required to perform it that are a mystery to most normal CS players.  Later posts will focus on learning techniques for improving your form, and out of game techniques for maximizing comfort and control (probably the most important.)  The following is basic knowledge for a KZ player, but none of this information is intuitive or easily discovered on your own - in fact, most of it is nearly impossible to discover without help from other KZ players and these specific mechanics of the Half-life engine are not documented anywhere by Valve.

So sit back while I explain how this mysterious feat of Counter-Strike movement is performed.

I.  Introduction


Before I continue, I will link to an excellent tutorial page on the xtreme-jumps website:

http://xtreme-jumps.eu/page.php?59

Tutorials explaining the basics of long jumping can be found there, but I will also discuss the basics in this introductory post and clarify whatever I feel needs to be clarified with regards to the XJ tutorial and knowledge of long jumping in general.

Long jumping has a very self-explanatory name.  The goal is to jump as far as possible using normal CS settings.  However, there are quite a few different ways of jumping, and long jumping in KZ nomenclature has come to mean the kind where you run and jump rather than bunny hop, double-duck, etc.   Just running and jumping - plain and simple!  Except its never quite that simple, of course :).  Long jumping must not be confused with high jumping, where you are high enough off the ground that the mechanics for jumping off are somewhat different.  Nevertheless, high jumping and long jumping are otherwise exactly the same in their mechanics.

Competitive distance jumping is done on the map kz_longjumps2, which is where all of the screen shots below were taken.  Also, when discussing the measurement called 'units', these are the 'centimeters' of the Half-life engine and are little cubes that are the building blocks making up every Half-life map.

II.  A Word on High Jumps vs Long Jumps

A high jump is simply a long jump where edge friction is in effect.

What is 'edge friction'?  Well, if the edge of a block is 70 units or higher from the floor below it, then a factor in the CS engine called edge friction exists.  To get an idea of how high 70 units is, the high jump blocks on kz_longjumps 2 are 80 units high.  It really isn't all that high!

The high jump blocks on kz_longjumps2 are 80 units high.
Edge friction is a weird property that means you lose speed as you run towards the edge of the block.  The amount you lose depends on how close you get - if you are around 13.6 units away before you jump, you don't lose any speed.  The amount of speed you lose increases as you get towards the edge, so being only 10-12 units away generally results in minimal speed loss, while getting closer than 5 units causes your speed to plummet.  As you can also tell from this diagram, 13.6 units is a pretty subtle distance - only about 1/6th the distance up this block.  Another important thing to note is that running at an angle and jumping helps with high jumps.  As it turns out, running straight towards the edge has the greatest edge friction effect, while running at an angle reduces the speed lost.  Running perpendicular to the edge (or right along it) means you don't lose any speed!  When a jump is a high jump, you generally want to modify the run-and-jump accordingly - either by jumping early, jumping at an angle, or some combination of both.

The 'floor' of a high jump depends on two things - the edge where you are jumping off and how far down the next surface is.  This means that high jumps aren't actually all relative to the same floor, such as the ground floor of the map.  The game determines the vertical distance between the edge of the block and the nearest surface directly below, and if this is 70 units or over, then it becomes a high jump.  Examine these screenshots:

The edge at the top of the measurement is considered a high jump, as it is over 90 units off the 'ground floor'...


...but if you were to jump at the edge at the top of this measurement line, it would be considered a long jump because the surface below is considered the 'ground floor ' and is only about 48 below the edge, which is less than 70.  That means there would be no edge friction, and running to the very edge won't result in losing speed.  Therefore, in this case, you would have different results jumping from the same edge, depending on from where you jumped.
By now you might realize that almost all jumps in climb maps are high jumps, because so many blocks are 70 units or higher off of the ground!  Maybe long jumping is best seen as a sub-set of high jumping, in this case?

It is important to understand that with the exception of edge friction, exactly the same mechanics apply to long jumps and high jumps.  This includes ground strafe technique, first strafe, air strafes, synchronization, air time - pretty much everything that will be discussed in the breakdown below.  Therefore, they are performed almost exactly the same way.  In competitive distance jumping, high jumps are considered separate from long jumps, which are done low enough to the ground that you can jump from the very edge.  High jumps have their own room with their own blocks on kz_longjumps2, as shown in the screenshot.  However, the running, jumping, and strafing in the air involve identical principles and mechanics in both cases - high jumps are only different in that you modify your running and jump off.

The basic technique of running and jumping is the essence of climb maps.  When you jump from block to block on a climb map, you are essentially performing a series of long jumps or high jumps, even though the distance may be 200 units or less, and the only 'prestrafe' you need is around 210.  The map kz_longjumps2 is just a showcase for how far you can push the limit of running and jumping, and so you are given enough room on the block to reach the maximum ground speed.  Otherwise, you are doing the same thing that you are doing in all climb maps.  This is important to keep in mind, because this concept has implications to how we approach recording maps.  This will be covered in a separate post.


III.  Stats Plugin Breakdown

It is now pretty much accepted that a statistics plugin for analyzing your jumps is a necessity to improve in long jumping.  When statistics plugins were created, the limits for all distance jumping techniques exploded.  I will be talking a lot about the various parts of the statistics shown by these plugins when I break down the long jump, so it's important that you understand the basics of these statistics.

First off, I've created a beginner KZ/Bhop/Longjump pack which includes long jump stats that can be downloaded here:

http://www.sendspace.com/file/l0lv5u

Instructions on installation are included (they are pretty simple.)  In addition, Bjormi has created an excellent LJ stat plugin that can be found here:


It has the advantage over the one in my pack in that it shows your jumpoff and landing edge.

Observe these screen shots from a Long Jump performed using Bjormi's plugin:

Jump performed by Yours Truly
  1. Distance: shows how far you jumped, in units.  
  2. Maxspeed (gain): the maximum speed reached during your jump, which is calculated by adding the speed gained (and lost) from all of your strafes plus your prestrafe taking off.  The number in parenthesis is the total gain from all of your strafes.
  3. Prestrafe: how fast you were at the moment you took off, which is determined by how good your ground strafe was.  
  4. Strafes: the number of strafes performed is shown here.  
  5. Sync: an average of how well your strafes were synchronized.  This is determined by averaging the sync column of the strafe stats, adjusted for the airtime of each strafe.

E-mazing strafe stats performed by CowOnCrack
Here are what the strafe statistics mean, going from left to right.  Each row represents the stats for a strafe.

  1. Strafe number: the label for the strafe, in the order they were performed.  For example, the first row has the statistics for the first strafe.  
  2. Speed gained: the amount of speed that strafe got you, which is determined by how wide and how well synced it was.  
  3. Speed lost: The amount of speed lost on the strafe.  This is discussed in the long jump breakdown below.  It seems this is already included in the calculation of the gain column, and so isn't included when calculating total gain and Maxspeed.
  4. Airtime:  This is how much time you took on the strafe as a percentage of total time in the air.  
  5. Sync:  The last number shows how well synchronized that particular strafe was with the turning of your mouse.  
Block: this shows the distance between the two edges that you are jumping.  Consequently, it will tell you what block you are on in the map kz_longjumps2.  
Jumpoff: how close you were to the edge in units while jumping off.  A jumpoff of less than 1 unit is ideal for long jumps, while you usually want a jumpoff of at least 10 units for high jumps.
Landing: how close you were to the opposite edge in units right when you land.


IV.  Long Jumping Break Down

Here are the basic components of a long jump:
  1. Starting position.  This is where you are positioned on the block before you get ready to run and jump.  On climb maps, positioning is relevant because it affects the angle of the jump, and most jumps that aren't super easy have an optimal angle that you must follow to land the jump.
    Common starting position
  2. Ground strafe, also known as 'prestrafe'.  This motion involves using your forward key and strafe keys as well as turning your mouse to get the best speed possible before you take off.  Starting facing about 90 degrees away from the edge, begin by holding forward and a strafe key.  In the screenshot above you would hold forward and right strafe (to head towards the edge).   While doing this, turn slowly to the right or left (depending on which direction the edge is) while holding the corresponding strafe key.  By synchronizing the turn with your strafing, it is possible to exceed the normal engine limit of 250 units a second which would be accomplished by just holding forward, backward, or either strafe key in isolation.  There is an optimal rate of turn which will get you the best possible speed for a ground strafe, which is 275 to 277 units a second.  274-275 with an occasional 276 is a very good range for prestrafe - the best that players can normally achieve.  270 or higher is usually the low threshold to still perform decent quality jumps and not severely handicap your distance.  This optimal rate of turn isn't very fast or very slow, but right about in between these two extremes.  Test it out for yourself using the /speed command, which is a part of my KZ pack and most others.  It is a 'speedometer' which will constantly show your speed in units per second.
  3. Take off - this is the moment you press jump and at the same time (or immediately afterwards) let go of forward while continuing to hold down the strafe key and continuing to turn into your first strafe.  There are three important parts of a good takeoff:
    1. Timing:  Letting go of forward is mandatory for effective jumping - holding it down while in the air causes you to slow down.  Many beginners make this mistake, but fortunately it isn't that hard to correct.  Still, it isn't uncommon for even experienced jumpers to mistime the letting go of forward.  If you let go of forward too early, your ground speed before taking off plummets like a boulder.  Therefore most jumpers develop the habit of holding it down for a very short period right after they jump.  However, what this can do is mess with the synchronization of your first strafe a bit.  Perfect timing is releasing forward the microsecond after you jump or even right as you jump - and especially before doing your first strafe.
    2. Angle: The angle that you take off at is often relevant to climbing and competitive distance jumping.  When you are doing a block on kz_longjumps2, you want to take off at an angle relative to the edge.  This angle is slightly away from the direction you are turning towards.  In climb maps, the angle you jump at can have a surprising effect on whether or not you can make the jump.  On extreme maps, often a perfect angle is required.
        Examples of good takeoff angles for long jump blocks
    3. Edge:  Finally, the concept of edge is an important part of taking off.  If you jump too far from the edge during a long jump, you are making it harder for yourself to reach the edge of the other block because you are increasing the distance required.  That is why all long jumpers strive for a jump off edge of 0.  A 255 block jumped 5 units too early is in effect as hard as a 260 block - in other words, impossible by current Lj standards.  On the other hand, jumping early on a high jump is almost always mandatory, because running to the very edge causes you to lose so much speed that the extra distance covered doesn't come close to making up for it.
  4. First strafe.  Even though your first strafe is hopefully one of many more to come, there are a few things unique to it that are worth discussing separately.  
    1. Right or left: The first important thing is that you can either strafe left or right on your first strafe, depending on your ground strafe and take off.  For the purposes of the game engine, these are identical maneuvers.  Actually, using forward and backwards as strafe keys and your strafe keys as forwards and backwards also works - the game engine is 'omni-directional.'  This is how sideways long jumps of various kinds are accomplished.  However, on some climb maps there isn't room to ground strafe in one direction and so some jumps are are way easier (or sometimes only possible) with a certain direction prestrafe.
      Left Prestrafe Takeoff

      Right Prestrafe Takeoff
    2. The most important strafe: Your first strafe is by far the most important strafe for determining the distance of your jump.  The air time, or percent of your jump spent performing this strafe, as well as the speed gained with the strafe, are particularly important.  The more speed you get with this strafe and the first few afterwards, the farther you will go as the speed is maintained through your entire jump.
    3. Sets up the rest of the jump: Your first strafe continues from the same direction as your prestrafe and ends when you cross back over the edge of the long jump block in front of you, so this effects the shape of your jump.  A big take off angle will tend to give you a large first strafe and large subsequent strafes.
  5. Air strafes.  These are the strafes performed after your first strafe.  There are many aspects of strafe quality, discussed below:
    This diagram demonstrates a 6-strafe long jump.  The important thing to look at are the angles of the prestrafe motion and the air strafes afterwards.  Note the desire to keep the strafes evenly moving back and forth until they finally finish on the opposing edge, resulting in a straight jump.  Note also the strafes decreasing in size as you reach the edge, with the last strafe being longer and slower than the rest.  Remember to release W right as you jump or very soon after, and crouch right as you are about to land!
    1. Speed Gained - the speed gained from a strafe is determined by how wide and well synced the strafe is with the turning of your mouse.  The game engine uses the X axis of your mouse to calculate synchronization.  It doesn't really matter if you move your mouse up and down or even to some extent in circles when you strafe, as long as that x-axis is synced with your strafe keys.  Of course, in practice awkward motions will often mess up your x-axis motion, but in theory it shouldn't matter.  When you move your mouse a certain distance in CS 'space' while syncing it, a certain amount of speed is gained.  It doesn't matter if you move the mouse fast or slow - the same speed will be gained.  However, doing it quicker means you gain the speed in a quicker amount of time, which will result in further distance because that speed will carry through your jump (see below.)  
    2. Synchronization with Turning - There is a theoretical width, or distance in space, that you move your synced mouse + keys through that results in a certain amount of gain, given that your synchronization is perfect - aka, at 100%.  If it is not, then you won't gain that theoretical maximum and instead get less speed for the same width, or less bang for your buck (Yankee expression).   This means that how well synced your strafes are with your mouse turning can make a big difference.  Every strafe you do that is not 100 percent synced didn't give you as much speed as it could have.  This means that strafing at less than 100 percent sync is inefficient.  If there is a limit to how fast you can strafe, then syncing those strafes better provides a way to push your limits even further.  Low sync is a complete handicap on your distance, and doing lots of low-synced strafes is a far less efficient use of airtime than a few well synced ones.
    3. Evenness - the strafes after your first strafe should be even with your first.  The explanation will now come for why you take off at an angle - it's so that your first strafe can be performed with some sizable area to strafe in.  See the long jump diagram.  By taking off at an angle you are setting up a back and forth motion over an imaginary line connecting the two edges of the block. By strafing back and forth over this line, and then using your last strafe to even out on it, you are gaining speed in the correct vector, and jumping as straight as possible.  Even in climb maps, when analyzing jumping from one edge to another, this kind of visualization is helpful to finding that perfect path through the air which will carry you straight and evenly to the closest edge of the block you are aiming for.
    4. Airtime, or Quick Strafes - Quick strafes means that they are performed quickly in time.  Airtime is just how much time in the air you spent on the strafe as a percentage of the entire time in the air.  Contrary to what some may believe, quick strafes and airtime are the most important factors in determining distance, not the "Max Speed" statistic.  Synchronization, although important, is often less important than strafing as quickly as possible when it comes to serious distance jumping.  This holds true as long as your overall sync is not too low - if you are getting less than 75% sync then you should look to improve that first, but once you start hitting 80% sync or higher on most jumps, the distance gained from better sync hits hard diminishing returns, and this is when airtime often becomes much more important.  The first n-1 strafes (where n is the strafes you are performing) should be done in the fastest time possible with that time evenly spread among those strafes (see Evenness).  The last strafe should even you out, and be as slow and as long as possible.  If you are doing 7 strafes for example, aiming for around 13.5% airtime on every strafe but the last would produce a very good jump.  That means 19% air time on the last strafe.  See the long jump statistics break down for where you can locate the air time of your strafes.
    5. Order of Gain - You want to have higher gain on the strafes at the beginning of your jump, and less gain on the strafes at the end.  If you have been absorbing what was written so far, it should be more clear why this is the case.  Speed gained in the beginning of the jump will count for more distance than speed gained at the end.  If two cars travel for a total time of one minute, but the first car takes 5 seconds to reach 60km/hr while the second takes 10 seconds, then which goes farther?  The car that sped up quicker is traveling at its maximum speed for longer, so it travels farther even though both have a maximum speed of 60km/hr.  This explains why the 'Max Speed' statistic is deceptive. 
    6. A word on maxspeed - Maxspeed is roughly 'correlated' with distance, in that high maxspeed goes with high distance, but it is a rough correlation and not a causation.  340 or higher maxspeed is unlikely to result in anything less than 250 units distance or higher, but it might just as easily result in 251 as 257.  Likewise, it is possible to get 253 to 254 stats with less than 320 maxspeed in rare cases.  The explanation for these discrepancies is the gain over time of these strafes - big strafes resulting in huge gain are of no use if they occur over a long period of time, and likewise, strafes that aren't as big performed very quickly are of greater use.
  6. Landing.  All jumps in KZ with raw distance as the goal should have a duck at the end, which extends your time in the air and thus your distance.  The difference it makes is quite substantial - around 20 units or more if you are going faster.  In an absolute ideal situation, you would finish strafing before you ducked, because strafing while holding duck results in lost speed.  In practice, it's very difficult to avoid holding down crouch for at least a tiny duration of your final strafe.  It is important to crouch as late as possible, because this can actually make a few units of difference.  Not crouching late enough is something that will never show up on stats plugins, and can harm your distance quite a bit if you aren't paying attention.
  7. Smoothness and Speed Loss.  Sudden, jerky mouse movements combined with the movement keys will quickly result in lost speed while playing Half-life.  The long jump movement is constrained enough that it's hard to lose ridiculous amounts of speed.  Nevertheless, jerky strafe motions in the air will result in noticeable speed loss.  This loss is the second number in the strafe column, right after speed gained.  If you keep your strafes smooth, then speed loss won't be an issue.  One final note - the same issue creeps up in your ground strafe if you aren't careful.  You might find that your prestrafe keeps plummeting to 250 units/second and you can't determine why.  The reason could be that you are performing the 'flick' motion of your first strafe in anticipation - before you've completely jumped off the block!  This will destroy your speed quite nicely.
V.  Conclusion

This concludes the examination of the in-game technique of long jumping.  This post contains all of the fundamentals and game mechanics behind the long jump that took years for KZ players to discover and are not documented anywhere by Valve.  These tools will help you analyze your jumps to trouble shoot problems, but this knowledge alone won't tell you the best and most efficient methods for improving, or the optimal physical technique outside of the game.  These will be covered in the next two essays.  In the mean time, I recommend taking a breather to absorb this information.

-CoC

No comments:

Post a Comment