Falldagame changes with fps

Started by Dower
27/12/2009 22:39
Page 2 of 2
Dower29/12/2009 17:37

nDr feel free to explain more if you can, i think i'll understand.

I also found, just as you say, that sometimes you take the same amount of damage/have same fallspeed. You're saying that with 100fps the fallspeed is updated faster? Perhaps 5times faster?

This would explain why you're in the air for a longer time with higher fps aswell i suppose

Fliborecord holder Tournament #229/12/2009 21:38

I don't know much about this, but falling speed is the only factor affecting fall damage.

Lt.RAT30/12/2009 12:15(edited 30/12/2009 12:16)

Originally posted by ndR
It's all about frames, with 20fps you reach the maximum falling speed slower than with 100fps.

It`s about frames, but with 20fps your falling speed will be the same as with 100fps (with same falling time and without hit any surfaces)

Our gravity = 800
With 100 fps, frametime = 0.01 sec, 20fps = 0.05 sec

Falltime calculated like = OldFallTime - EngineFrameTime * Gravity;
for example our OldFallTime = 0, so for 20 fps other part will be 40 velocity per frame, and for 100 fps = 8 velocity per frame;

But in real time 1 20fps frame equal to 5 100 fps frames, And Total velocity for same real time are equal: 1*40 = 5*8.

And where is the problem?
Our EngineFrameTime calculated like X * 0.001; where X - integer from 0 to 50; Zero means 1000 fps, and 50 means 20fps. (10 = 100fps)
So, our real fps could be 93 (0.010753), and there is no corresponding frametime in engine - it will be 0.011. Comparision between real time and engine time - it`s another story and i dont want to describe it here.

For Example: to hit the ground we need 0.1 sec
100 fps: 10 frames with 0.01 sec = 0.1 sec - total Velocity = -80 u/s
20 fps: 2 frames with 0.05 sec = 0.1 - total Velocity = -80 u/s
But our fps isnt stable: 20fps+100fps+100fps+100fps+20fps
0.05+0.01+0.01+0.01 = 0.08 - (without last 20fps) - engine thinks "hmm, it`s not enought to hit the ground, let`s continue fall"
and now 0.08+0.05 = 0.13 - bump - engine thinks "omg player under the floor, let`s lift up him a bit", and it changes his position, but it not affected on his velocity... We got same postion of hit like with 100fps or 20 fps, etc, but now our final velocity is 0.13*800 = -104 u/s
That`s why we got different FallDamage...
Also here is another bug - HP of player in engine: Floating point value, but sometime engine used it like integer (and hp in hud integer too)... For some parts of game we have 0.1 hp, and for other parts its zero :D It cause 0hp bug, and some other bugs.
Scripters should understand this, and use or floating point value or integer - corresponding to the purpose of the plugin.

waplet30/12/2009 15:24

thanx lt'rat... so the best is while just spamming fps 20 fps 100 :D

Lt.RAT30/12/2009 18:17

yeah, to gain more dmg as possible xD

Dower30/12/2009 21:47

Originally posted by Lt.RAT
It`s about frames, but with 20fps your falling speed will be the same as with 100fps (with same falling time and without hit any surfaces)

Our gravity = 800
With 100 fps, frametime = 0.01 sec, 20fps = 0.05 sec

Falltime calculated like = OldFallTime - EngineFrameTime * Gravity;
for example our OldFallTime = 0, so for 20 fps other part will be 40 velocity per frame, and for 100 fps = 8 velocity per frame;

But in real time 1 20fps frame equal to 5 100 fps frames, And Total velocity for same real time are equal: 1*40 = 5*8.

And where is the problem?
Our EngineFrameTime calculated like X * 0.001; where X - integer from 0 to 50; Zero means 1000 fps, and 50 means 20fps. (10 = 100fps)
So, our real fps could be 93 (0.010753), and there is no corresponding frametime in engine - it will be 0.011. Comparision between real time and engine time - it`s another story and i dont want to describe it here.

For Example: to hit the ground we need 0.1 sec
100 fps: 10 frames with 0.01 sec = 0.1 sec - total Velocity = -80 u/s
20 fps: 2 frames with 0.05 sec = 0.1 - total Velocity = -80 u/s
But our fps isnt stable: 20fps+100fps+100fps+100fps+20fps
0.05+0.01+0.01+0.01 = 0.08 - (without last 20fps) - engine thinks "hmm, it`s not enought to hit the ground, let`s continue fall"
and now 0.08+0.05 = 0.13 - bump - engine thinks "omg player under the floor, let`s lift up him a bit", and it changes his position, but it not affected on his velocity... We got same postion of hit like with 100fps or 20 fps, etc, but now our final velocity is 0.13*800 = -104 u/s
That`s why we got different FallDamage...
Also here is another bug - HP of player in engine: Floating point value, but sometime engine used it like integer (and hp in hud integer too)... For some parts of game we have 0.1 hp, and for other parts its zero :D It cause 0hp bug, and some other bugs.
Scripters should understand this, and use or floating point value or integer - corresponding to the purpose of the plugin.



Thanks alot!

I know you said you wouldn't tell me the way that you get the engine time but if you don't mind i'd like to know that aswell.
Is it allways rounded up to the nearest 0.001?

Lt.RAT30/12/2009 22:51

It comes from realization of HL protocol...
Client send to server message with your buttons, cl_updaterate, view angles, weapon, amount of forward/side/up movement some other things and FPS...
And for FPS in that message developers assign only 1 byte (it`s values 0-255)
But minimum possible fps in engine - 20fps, so maximum value in message (1/20)*1000 = 50.
When server recived message it transform it via Value*0.001 (10*0.001 = 0.01 sec = 100 fps)
I can`t remember exact method of round-up (to upper value, to lower value, via zero or to nearest value), but should be to nearest integer value.
Annd yes, it`s raunded to "nearest" 0.001, but that cause bugs with high fps...
Between 1000 and 500 fps, only 1 engine value... Let`s take jump with constant 95 fps:
Real time = 0.0105263
Engine time = 0.01
For Jump with duck at the end we need 73 frames:
RT *73 = 0.768421 : ET *73= 0.73
In RT 0.038 sec more, ~4 100 fps frames more...
eDark called it - advantage
Lil easier to jump coz for engine it is the same thing, but for player its like + 4 frames (5.5% jump longer in realtime) For 8 strafes (73/8)=9.125 frames, its like half of the strafe in realtime...

Funksta 30/12/2009 23:31

wat.

Dower30/12/2009 23:38

Originally posted by Lt.RAT
It comes from realization of HL protocol...
Client send to server message with your buttons, cl_updaterate, view angles, weapon, amount of forward/side/up movement some other things and FPS...
And for FPS in that message developers assign only 1 byte (it`s values 0-255)
But minimum possible fps in engine - 20fps, so maximum value in message (1/20)*1000 = 50.
When server recived message it transform it via Value*0.001 (10*0.001 = 0.01 sec = 100 fps)
I can`t remember exact method of round-up (to upper value, to lower value, via zero or to nearest value), but should be to nearest integer value.
Annd yes, it`s raunded to "nearest" 0.001, but that cause bugs with high fps...
Between 1000 and 500 fps, only 1 engine value... Let`s take jump with constant 95 fps:
Real time = 0.0105263
Engine time = 0.01
For Jump with duck at the end we need 73 frames:
RT *73 = 0.768421 : ET *73= 0.73
In RT 0.038 sec more, ~4 100 fps frames more...
eDark called it - advantage
Lil easier to jump coz for engine it is the same thing, but for player its like + 4 frames (5.5% jump longer in realtime) For 8 strafes (73/8)=9.125 frames, its like half of the strafe in realtime...



Thanks alot! :)

Helped me understand much more

remake31/12/2009 12:31

Originally posted by cookie.cs
lol, dagame.

OT: i can't see any difference. i take the same DAGAME with 250 and with 20

try kz_man_ultrablock first fall sc with lower fps.

WownuK;31/12/2009 16:47

oh, thanks, my mistake

Grrr05/01/2010 22:38

saved 8 hp, falling on 1hp map

Page 2 of 2

Please log in to post replies.