Last server records
Pro Nub

How to measure distance?

Posted by Kpoluk 18 Mar 2018 in 12:58
This article describes the operation of plugin that allows you to measure distance between two points in CS 1.6. You can use this plugin on our servers and it's included in our LAN server (click here to download it). Further all distances are measured in units.

Measuring menu is called by command /dist (or /distance, /measure):

In order to understand how it works let's make a few demonstration gaugings.

First two items create points and show their coordinates X, Y, Z. If item 4. Method is set to Aim at Point, then to create a point you just need to look at it and press 1 or 2, and if item 4. Method is set to Stand on Point, then point will be created at the place you stand on (or right under you feet if you're in the air). The results of measurement will be shown below as Height and Distance. Other menu items will be enlightened further.

Now we enter kz_longjumps3 and find there block of 240 units. Set the first point at a side of the block, and another one roughly opposite, item 7. Extra beams we'll leave in Off for now:

Red line connects our points, its length is shown as Distance and equal to 240.841 units. If we set 5. Detailed info to On, then we'll also see shifts between points dX, dY, dZ along each axis and horizontal shift dXY (Estimated LJ will be discussed later). Here you can notice that a distance between blocks is exactly what dX shows:

Same result can be obtained without a help of Detailed info. Switch 3. Autoset the other Point to On and set the first point once again. The second point will be determined automatically (plugin finds it as an intersection of normal from the first point and map's plane), so you will see that Distance is exactly 240.000:

Now if you switch 6. Epsilon to On, distance will fall to 239.938 units. The thing is that CS 1.6 engine doesn't allow the gap between player's model and map to be less than 0.03125 units. This is a very small distance that we call Epsilon. Thus in respect to the model lj block is less by 2 * 0.03125 = 0.0625 units and actually is 240 - 0.0625 = 239.9375 units long. This is the number that is printed in Distance now.

And finally we come to Estimated LJ. Firstly you should understand that player's model has a form of a box of 72 units height and 32 units width by X and Y. Sides of this box are always parallel to the map's axes. It means that when we move our mouse while standing on a point, our box stays motionless. Hence if we want to fly over 240 block our center needs to fly 208 units, and 32 units will be provided by model's width:

But what if we jump diagonally? Choose in menu 4. Method: Aim at Point, 5. Detailed info: On, 6. Epsilon: Off, 7. Extra beams: On and set the first point at the corner of block 240 and the second one at the opposite corner of block 242:

Besides the red line we see two squares (their sizes are the same as sizes of our box) and yellow line connecting their centers. These squares are found by plugin in such a way that distance between centers (i.e. length of yellow line) is minimal. To help us estimate our potential plugin adds 32 units to this distance and prints the result as Estimated LJ. Judging by Distance: 250.684 we might think that to jump from one corner to another you need to do more than 250 lj, but Estimated LJ: 244.733 suggests that this jump is actually a lot easier.

That's it, have fun with measuring!