Live data from Hacker News

Doing Game Gravity Right

niksula.hut.fi

11–20 of 86 posts

Re: Doing Game Gravity Right

#11
post #7
post #4

Why does this even matter? If you have a large delta time then your game is fucked anyway. Collision detection will likely also be broken and the game is unplayably choppy anyway so it doesn't even matter.

Drops in framerate happen. Why not make a best effort for accuracy? Also, it's interesting and insightful.

> Drops in framerate happen.

No, they don't.

Game logic should run at constant 60 or more fps, even when graphics framerate is lower: http://gafferongames.com/game-physics/fix-your-timestep/

But yes, it's an interesting article, and this method allows for a bit more accuracy.

Re: Doing Game Gravity Right

#12
you are still doing it wrong. dt should not be affected by framerate. http://gafferongames.com/game-physics/fix-your-timestep/

use an accumulator to have a fixed dt no matter the framerate. With a variable step size you risk all kinds of weird bugs linked to the hard to debug rendering context. The size of dt should be consider a system parameter, tuned for your game and fixed in concrete.

Re: Doing Game Gravity Right

#13
This is still Euler integration, which has poor accuracy whenever the derivative varies with time. The standard numerical integration method is 4th order Runge Kutta. RK4 is also popular for solving many forms of differential equations.

A good summary is here: http://gafferongames.com/game-physics/integration-basics/

Re: Doing Game Gravity Right

#15
post #9

Earlier quoted context omitted.

You wouldn't believe the amount of people who plays Sims 3 at 7 fps.

Does sims 3 even have gravity?

The point being that it doesn't matter if you believe people will not play the game because game performance; if they really like it the will ignore it. And if they paid for your game you should at least try to give them an experience as good as possible.

Re: Doing Game Gravity Right

#16
post #13

This is still Euler integration, which has poor accuracy whenever the derivative varies with time. The standard numerical integration method is 4th order Runge Kutta. RK4 is also popular for solving many forms of differential equations. A good summary is here: http://gafferongames.com/game-physics/integration-basics/

Verlet Integration is another way to solve this kind of DE (i.e. DEs related to kinetics) quickly and time-reversibly... https://en.wikipedia.org/wiki/Verlet_integration

Re: Doing Game Gravity Right

#17

you are still doing it wrong. dt should not be affected by framerate. http://gafferongames.com/game-physics/fix-your-timestep/ use an accumulator to have a fixed dt no matter the framerate. With a variable step size you risk all kinds of weird bugs linked to the hard to debug rendering context. The size of dt should be consider a system parameter, tuned for your game and fixed in concrete .

It may still be wrong, but the point is that it's less wrong and it's not much extra effort.

Re: Doing Game Gravity Right

#18
post #9

Earlier quoted context omitted.

Does sims 3 even have gravity?

The point being that it doesn't matter if you believe people will not play the game because game performance; if they really like it the will ignore it. And if they paid for your game you should at least try to give them an experience as good as possible.

All games have minimum requirements.

Re: Doing Game Gravity Right

#19
post #18

Earlier quoted context omitted.

The point being that it doesn't matter if you believe people will not play the game because game performance; if they really like it the will ignore it. And if they paid for your game you should at least try to give them an experience as good as possible.

All games have minimum requirements.

Yeah, in the perfect world all your buyers will have them. In real life sometimes don't.

Plus there is a lot of things you don't know; maybe he haves the minimum requirements but he is running a lot of background process because he installed a bunch of things he doesn't use.

Post reply on HN