vector recalculation
how to recalculate vector for the jump? to have much precision when calculating
maybe you should say more about what you want to calculate i don t know what exactly you re meaning.
vector, whose length = real jump distance - 32
ok i ll try to explain how to get it:
you have a vector to the frame before the landing and the position is correct there. Now the problem is that the point where you land is not measured as a frame so you have to extrapoalte the value with the data you have.
I m using the origin of that frame x(landing - 1) and the speed at that point.
With the height and z-speed you have at that point you can get the time till you land with the formula for jumptime.
So you get x(landing) = x(landing - 1) + vx(landing - 1) * t
Ofc we extrapolate with a quadratic function here so t is:
t = (vz(landing - 1) - sqrt(vz(landing - 1)^2-2*gravity*(z(landing - 1) - z(landing)))/gravity
gravity is -800 here!
now you calculate the distance to the jumpoff point and add 32 to the result:
distance = Sqrt( ((x(landing - 1) + vx(landing - 1) * t) - x(jumpoff))^2 + ((y(landing - 1) + vy(landing - 1) * t)- y(jumpoff))^2) + 32
formula by edark, translated into amxx can be found in js_stocks of jumpstats by exolent, those stocks you can find in exolents plguina re witten by me ^^
ljstats still shows the lower distance, distance from jumpoff to the recalculated landing origin or the landing origin cs says to us (pev_origin)
ok, close thread
thx eDark, thx SchlumPF
BUMP!!! question to eDark: how to calculate v(landing + 1)?
i need this because when extrapolating we use v(landing) but in fact we should use v(landing + 1)
v(landing - 1) = velocity one frame before landing
v(landing) = velcocity on landing
v(landing + 1) velocity one frame after landing
v(landing + 5) velocity five frames after landing
...
nope, you dont need v(landing + 1).
SchlumPF* look at extrapolation time...
For 100fps jump we should extrapolate ~0.012272 sec... It`s 1.2272 frames...
And we know only v(landing)... and for other part ~0.2272 of frame we cant get velocity from engine...
Yes we can extrapolate it with ~81 fps, but in other case we know all params to calculate next velocity, and calculate distance with 100 fps...
lol? all i wrote was simply an example what landing - 1 etc means...
lt.rat you re contradicting yourself ...
1. if we get an extrapolating time of 0.012272 sec and have a frame time of 0.01 sec the frame we re extrapolating can t be the frame before landing and so we have to use the next frame until we get the last frame before landing or something in your formula is obviously wrong.
2. the extrapolating time isn t a constant value or dependent on fps it depends on when your last frame before the real landing-time is.
3. you never use v(landing) because that is the speed after you landed.
and where did you get the idea from to extrapolate with 100fps or 81 fps? what does that even mean?
There is some misunderstanding in landing points :(
We took it from engine in some other ways than u describe here ) (wonderfull engine)
for example we need to extrapolate last frame 0.002272 sec more
1) But if we took same velocity (it used to calculate "first part" of frame already), last recalculated frame will be (1/0.012272)=81.486fps...
2) If we calculate next velocity (not next real engine value - velocity like it will be if we not hit the fround, but using new angles etc) and use it our last recalculated frame will be (1/0.002272)=440.1fps...
And for jumps with strafes, our real land point will be a bit diffrent between 1) and 2)
Why we should take already used velocity, and not calculate new one, for last part of the movement ?)
So, there is two ways, and as i understand, kielor asked about second way.
... maybe you should explain your way first.
@ lt.rat
in one server frame you can get many playerthinks (origin/velocity changes). So time will be 0.0 so this method is incurrect.
but can smb just give formula? no questions because it's too hard to explain and even harder to understand
what formula for what?
formula of v(landing + 1)
no questions plz..
there is no formula for that why would you need one? you can get v(landing + 1) from cs. And i still don t understand how you can use this value for anything usefull...
And why is it too hard to explain? or maybe lt.rat could explain it?
I can't understand anything in this chineese thread. What vectors do u recalculate ? :>
basically its calculating the jumpdistance including some other calcualtions whicha re necessarry.
kielor i already told you about landing + 1, simple get it in prethink.
lt.rat is t3h god, always when he said something edark told me hes wrong (at least when i asked edark :D)
Please log in to post replies.