Author Topic: Framerate and Jump Height  (Read 5650 times)

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Framerate and Jump Height
« on: March 27, 2004, 04:33:14 AM »
I'm trying to make the movement completely independent of the framerate, so I ran a few tests to see how high you jump at different framerates.  The results weren't quite what I expected...

10fps:


20fps:


40fps:


80fps:


160fps:


320fps:


If you take a close look, you can actually jump HIGHER at 40fps than you can at 320. Here's some raw data at the peak of the curves:

40fps:
330
336
338
336
330

80fps:
330
332
333
333
332
330

160fps:
322
324
326
328
329
330
331
331
331
331
331
330
329
328
326
324
322

320fps:
316
317
318
319
319
319
319
319
319
319
319
319
318
317
316


So....  you can jump higher at 40fps... technically.  That means the ability to land on taller objects at higher framerates must have something to do with the air stepping code, because I can jump onto things at 320fps that I can't at 40fps.

Weird.

RoyalBlood

  • VM-68
  • Posts: 199
Re: Framerate and Jump Height
« Reply #1 on: March 27, 2004, 04:38:57 AM »
You realize that just went over most of these peoples heads =)

So technically you cant jump higher at 320fps than you can at 40fps, but yet you still can actually land on top of higher objects at 320 over 40?  So its like the matrix?  You only think you jump higher, so therefore you do  :D
« Last Edit: March 27, 2004, 04:42:08 AM by RoyalBlood »

Dirty_Taco

  • Map Committee
  • Autococker
  • Posts: 1630
_
« Reply #2 on: March 27, 2004, 01:48:12 PM »
Post removed
« Last Edit: July 26, 2010, 01:22:17 AM by Dirty_Taco »

Excalibur

  • 68 Carbine
  • Posts: 492
Re: Framerate and Jump Height
« Reply #3 on: March 27, 2004, 03:25:35 PM »
i thought i was the only one that did that
0110100101110100011100110010000001100011011000010110110001101100011001010110010000100000011000100110100101101110011000010111001001111001

Anrkist

  • VM-68
  • Posts: 103
Re: Framerate and Jump Height
« Reply #4 on: March 27, 2004, 05:06:50 PM »
Out of curiuosity.. why would you be able to jump higher at a lower fps??

RoyalBlood

  • VM-68
  • Posts: 199
Re: Framerate and Jump Height
« Reply #5 on: March 27, 2004, 06:49:39 PM »
Just a guess.  Maybe because at higher framerates, since you have more frames during your jump, the top end of the jump smooths out more, whereas at 40 it peaks a bit.  If you look at the actual numbers Jits posted, they decrease at the peak as framerate goes up.  Thats what it looks like to me just by looking at the curves and the numbers.  Of course under 40 is lower, but thats probably mostly because it just sucks when you get that low  ;)  You never want to be under 30fps anyway.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Framerate and Jump Height
« Reply #6 on: March 27, 2004, 07:01:37 PM »
loss of precision.  Quake2 uses an integer coordinate system.  When you convert a float to the closest integer, the more times you do it, the more precision you lose.

Say I'm going from 1 to 2.  In one step, if I go from 1, add 1.0, go to 2.0, convert it to an integer: 2.  Works fine, but what if I do it in 4 steps? 1, add .25, get 1.25, convert to an integer: 1.  Add .25, convert to an integer, still 1.  Add .25... you get the idea.  That's why at the highest framerate, if you look at the data there:
316
317
318
319
319
319
319
319
319
319
319
319
318
317
316

It never gets aboe 319 because the increments are so low -- not enough to reach the next integer.

Thus it baffles me that you can land higher when the actual hight you reach is lower...

RoyalBlood

  • VM-68
  • Posts: 199
Re: Framerate and Jump Height
« Reply #7 on: March 27, 2004, 07:10:19 PM »
Yeah I see what you're saying.  I dont know.  I wish I never gave up on programming, cuz this excrement is interesting me again.  But I dont know any technical details anymore, just basic programing concepts.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Framerate and Jump Height
« Reply #8 on: March 27, 2004, 10:55:16 PM »
Turns out it's not the air stepping code.  I did some more tests.  I put a series of boxes, each 1 map unit lower than the next.  I could land on the 60 unit box at 40fps, but at 300, I could barely make the 58 unit box.  Well, it's consistent with the graphs.  Now I try sand trap.  Whoa, totally different data.

40fps:


80fps:


160fps:


320fps:


What's different?  The ground in Sand Trap is at -1056 quake units (-132 map units).

My theory at this point is that the difference is still caused by float to int imprecision.  The more frames you have, the more imprecision.  Since converting a float to an integer rounds DOWN to the closest integer, if you're ABOVE 0, a higher framerate makes you jump LOWER.  However,  rounding "down" a negative number (rounds down the absolute value), actually ends up giving you a HIGHER integer value (-10 > -10.1), thus the imprecision lets you jump HIGHER if you're BELOW 0, giving people with higher framerates more imprecision and the advantage.

Excalibur

  • 68 Carbine
  • Posts: 492
Re: Framerate and Jump Height
« Reply #9 on: March 28, 2004, 12:05:20 AM »
ahhh yea what he said

IronFist

  • Autococker
  • Posts: 1304
_
« Reply #10 on: March 28, 2004, 07:08:16 AM »
Post removed
« Last Edit: July 25, 2010, 10:08:14 PM by IronFist »

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Framerate and Jump Height
« Reply #11 on: March 28, 2004, 07:44:50 AM »
Make everything above 0 if you can.

Now I’m at a bit of a dilemma.  I can fix the bug and make the jump height fairly consistent across different frame rates, but it will likely enrage the high-fps lpbs when they can no longer do things like backdoor pforest.

Anrkist

  • VM-68
  • Posts: 103
Re: Framerate and Jump Height
« Reply #12 on: March 28, 2004, 09:19:41 AM »
Thats fine Jitspoe.. I am a High-FPS LPB, and would really like to see some of that BS stoped. I dont think the maps were designed for that.. so people shouldent be allowed to do it, but thats me.

FuRy

  • PGP
  • Posts: 2
Re: Framerate and Jump Height
« Reply #13 on: March 28, 2004, 10:28:35 AM »
That would be fine, a high-FPS super LPB already has advantages on some people, this shouldn't be one.  Besides, I'm sure you could do the good ol' 2 person one on pforest.

Excalibur

  • 68 Carbine
  • Posts: 492
Re: Framerate and Jump Height
« Reply #14 on: March 28, 2004, 10:48:34 AM »
im a lpb i think fix the bug. but thats prob cause im not that good of a jumper anyways :D

Belmont

  • Stingray
  • Posts: 73
Re: Framerate and Jump Height
« Reply #15 on: March 28, 2004, 11:32:50 AM »
/me 2nds

RoyalBlood

  • VM-68
  • Posts: 199
Re: Framerate and Jump Height
« Reply #16 on: March 28, 2004, 12:23:12 PM »
That is a very interesting discovery Jits.  I vote that you should fix the bug.  Theres just so many reasons for it, from the maps probably werent meant to be played that way to an increase strategy and competitiveness in matches.

Xile

  • VM-68
  • Posts: 116
Re: Framerate and Jump Height
« Reply #17 on: March 29, 2004, 12:58:27 AM »
I say fix it too, you already can jump high enough. I can do alot of jumps on 56k and still do fine. Thus, making the bigger jumps require more of a team effort and add more to the teamplay perspective the game was created on. I feel like, even though clans play as a team. It's more of everyone going their own way, and IF they die, recon back where people are. This should definetely make teamwork a bit more inticing.
« Last Edit: March 29, 2004, 01:02:04 AM by Xile »

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Framerate and Jump Height
« Reply #18 on: March 29, 2004, 07:36:11 AM »
I wanted to see just how bad this would get, so here it is at over 2000 fps.

IronFist

  • Autococker
  • Posts: 1304
_
« Reply #19 on: March 29, 2004, 08:14:31 AM »
Post removed
« Last Edit: July 25, 2010, 10:08:11 PM by IronFist »