Comments on: Fix Your Timestep! http://gafferongames.com Glenn Fiedler's Game Development Articles and Tutorials Tue, 07 Sep 2010 17:03:11 +0000 hourly 1 By: Glenn Fiedler http://gafferongames.com/game-physics/fix-your-timestep/#comment-1989 Glenn Fiedler Tue, 07 Sep 2010 03:39:02 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-1989 There is more to come... an analysis of input latency and multithreaded approaches etc. but these will have to wait for a bit later. I felt the old article was getting a bit stale and I'm a bit happier with it now! cheers There is more to come… an analysis of input latency and multithreaded approaches etc. but these will have to wait for a bit later. I felt the old article was getting a bit stale and I’m a bit happier with it now! cheers

]]>
By: Mitchell http://gafferongames.com/game-physics/fix-your-timestep/#comment-1974 Mitchell Mon, 06 Sep 2010 21:58:41 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-1974 Yea, that's what I meant, thanks a lot for covering it, I understand it better now. Yea, that’s what I meant, thanks a lot for covering it, I understand it better now.

]]>
By: Glenn Fiedler http://gafferongames.com/game-physics/fix-your-timestep/#comment-1968 Glenn Fiedler Mon, 06 Sep 2010 18:50:55 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-1968 I've published the article update, let me know what you think! I’ve published the article update, let me know what you think!

]]>
By: Glenn Fiedler http://gafferongames.com/game-physics/fix-your-timestep/#comment-1940 Glenn Fiedler Mon, 06 Sep 2010 03:18:07 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-1940 It's a lot simpler but it does not step forward with fixed delta time. If you don't care about completely fixed delta time then it's a perfectly good technique. I have a reworked version of this article which includes this as one of the options discussed. It’s a lot simpler but it does not step forward with fixed delta time. If you don’t care about completely fixed delta time then it’s a perfectly good technique. I have a reworked version of this article which includes this as one of the options discussed.

]]>
By: Mitchell http://gafferongames.com/game-physics/fix-your-timestep/#comment-1915 Mitchell Sat, 04 Sep 2010 23:56:54 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-1915 Wouldn't it be a lot simpler to just have a max time delta, so a physics step is never bigger than that maximum? Like this, keeping with your pseudocode: double currentTime = hires_time_in_seconds(); State state; double maxdt = 1.0 / 60.0; while ( !quit ) { double newTime = hires_time_in_seconds(); double dt = newTime - currentTime; currentTime = newTime; while (dt > maxdt) { state.physicsStep(maxdt); dt -= maxdt; } state.physicsStep(dt); render(state); } Wouldn’t it be a lot simpler to just have a max time delta, so a physics step is never bigger than that maximum? Like this, keeping with your pseudocode:

double currentTime = hires_time_in_seconds();
State state;
double maxdt = 1.0 / 60.0;

while ( !quit )
{
double newTime = hires_time_in_seconds();
double dt = newTime – currentTime;
currentTime = newTime;

while (dt > maxdt) {
state.physicsStep(maxdt);
dt -= maxdt;
}
state.physicsStep(dt);

render(state);
}

]]>
By: admin http://gafferongames.com/game-physics/fix-your-timestep/#comment-1227 admin Sun, 01 Aug 2010 09:01:18 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-1227 Basically integrate just means to advance the simulation state forward. You can try it with something simpler like euler integration, eg. x += dxdt * dt if you like. cheers Basically integrate just means to advance the simulation state forward. You can try it with something simpler like euler integration, eg. x += dxdt * dt if you like. cheers

]]>
By: admin http://gafferongames.com/game-physics/fix-your-timestep/#comment-1226 admin Sun, 01 Aug 2010 08:59:25 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-1226 This is a suitable implementation if you don't need a fixed delta time, but for general 100% repeatability and same results each time run, I generally prefer the full fixed dt myself. cheers This is a suitable implementation if you don’t need a fixed delta time, but for general 100% repeatability and same results each time run, I generally prefer the full fixed dt myself. cheers

]]>
By: Gregor http://gafferongames.com/game-physics/fix-your-timestep/#comment-385 Gregor Sat, 17 Jul 2010 08:47:52 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-385 siggraph course is brilliant, thank you siggraph course is brilliant, thank you

]]>
By: Glenn Fiedler http://gafferongames.com/game-physics/fix-your-timestep/#comment-384 Glenn Fiedler Fri, 16 Jul 2010 16:15:11 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-384 either way is good and it depends on the error you consider most acceptable during a sharp change in velocity - consider a particle moving very quickly and bouncing @ 45 degrees, cheers either way is good and it depends on the error you consider most acceptable during a sharp change in velocity – consider a particle moving very quickly and bouncing @ 45 degrees, cheers

]]>
By: Glenn Fiedler http://gafferongames.com/game-physics/fix-your-timestep/#comment-383 Glenn Fiedler Fri, 16 Jul 2010 16:13:47 +0000 http://www.gaffer.org/wordpress/fix-your-timestep/#comment-383 if your game physics is mostly simple linear motion, you'll probably get no real benefit. if you have more complex physics you'll benefit from more consistent behavior with fixed timesteps. so, work out how differently your game sim code behaves depending on framerate and if it's significant or problematic then fixing the timestep is a good idea. some examples of where this is good, tunneling at low framerates if you don't raycast, different behavior of springs at different delta time due to integrator errors etc. if your game physics is mostly simple linear motion, you’ll probably get no real benefit. if you have more complex physics you’ll benefit from more consistent behavior with fixed timesteps.

so, work out how differently your game sim code behaves depending on framerate and if it’s significant or problematic then fixing the timestep is a good idea. some examples of where this is good, tunneling at low framerates if you don’t raycast, different behavior of springs at different delta time due to integrator errors etc.

]]>