title: Gravity Equation - Velocity Equation | Why is it only good in certain FPS?
body: <p>The jump size with these equations decreases as amount of updates per second goes down. With a delta value multiplying gravity force and amount that jumpspeed force decreases, as well as time elapsed being added by delta every iteration (the delta value is the amount of milliseconds passed since last update), one would think that it would work fine.</p>
  
  <pre><code>//d is delta
  ...
  if(isFalling||isJumping){
  
          elapsedTime +=d;
  //the elapsed time is the total amount of time passed since one started jumping,
  //so that's logical to add the amount of time since last update.
  
          long tesquared = (long) Math.pow(elapsedTime, 2);
  //amount of time elapsed squared.
  
          jumpSpeed+=-0.0000005*elapsedTime*d;
  //this is the amount that jumpspeed is taken down by every time. 
  
          if(jumpSpeed &gt; 0){
              isJumping = true;
          } else {
              isJumping = false;
          }
          double fGravity = 0.0000001*tesquared*d;
  
  // this is the equation for gravity, the amount that the player goes down
  
          yRend += jumpSpeed - fGravity;
      //the amount it goes up, minus the amount it goes down.
          xRend -= strafeSpeed;
          oldyRend = yRend;
  
      }
  </code></pre>
  
  <p>To start a jump, one adds jumpSpeed by whatever amount.</p>
  
  <p>The problem is that when the amount of updates per second decreases, the jumps decrease in duration and magnitute. I'm fairly certain that the delta values here are fine, which means that the problem must be in the equations themselves.</p>
  
  <p>I'm thinking that <code>fGravity</code> is overrunning <code>jumpSpeed</code> more quickly when the delta is larger.</p>
  
  <p>So my question. If the problem really is in the equations themselves, what is the correct way to model the upward force of a player minus the downward gravity force other than </p>
  
  <p><code>jumpSpeed+=-0.0000005*elapsedTime*d;</code></p>
  
  <p>and</p>
  
  <p><code>double fGravity = 0.0000001*tesquared*d;</code>?</p>
  
  <p>If the problem is in the delta value not being applied correctly, then what would be the correct way to apply it?</p>