vector recalculation

Started by kielorz
17/06/2009 16:05
Page 1 of 2
kielorz17/06/2009 16:05

how to recalculate vector for the jump? to have much precision when calculating

eDark17/06/2009 18:02(edited 17/06/2009 18:03)

maybe you should say more about what you want to calculate i don t know what exactly you re meaning.

kielorz17/06/2009 19:25(edited 17/06/2009 19:25)

vector, whose length = real jump distance - 32

eDark17/06/2009 21:52(edited 18/06/2009 12:30)

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

SchlumPF17/06/2009 22:26(edited 17/06/2009 22:31)

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)

kielorz18/06/2009 08:20(edited 18/06/2009 10:11)

ok, close thread
thx eDark, thx SchlumPF

kielorz21/06/2009 10:33

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)

SchlumPF21/06/2009 13:44(edited 21/06/2009 13:44)

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).

Lt.RAT21/06/2009 20:13

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...

SchlumPF21/06/2009 22:23

lol? all i wrote was simply an example what landing - 1 etc means...

eDark21/06/2009 22:30(edited 21/06/2009 22:45)

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?

Lt.RAT22/06/2009 00:31(edited 22/06/2009 00:45)

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.

eDark22/06/2009 01:11

... maybe you should explain your way first.

NumB22/06/2009 01:58

@ 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.

kielorz22/06/2009 14:17

but can smb just give formula? no questions because it's too hard to explain and even harder to understand

eDark22/06/2009 15:54(edited 22/06/2009 15:55)

what formula for what?

kielorz22/06/2009 16:09

formula of v(landing + 1)

no questions plz..

eDark22/06/2009 16:17(edited 22/06/2009 19:21)

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?

Grrr22/06/2009 17:06

I can't understand anything in this chineese thread. What vectors do u recalculate ? :>

SchlumPF22/06/2009 20:57

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)

Page 1 of 2

Please log in to post replies.