<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Fix Your Timestep!</title>
	<atom:link href="http://gafferongames.com/game-physics/fix-your-timestep/feed/" rel="self" type="application/rss+xml" />
	<link>http://gafferongames.com</link>
	<description>Glenn Fiedler&#039;s Game Development Articles and Tutorials</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:56:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Ingo</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-34841</link>
		<dc:creator>Ingo</dc:creator>
		<pubDate>Wed, 18 Jan 2012 10:21:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-34841</guid>
		<description>Thanks, Glenn. I can see why simple extrapolation can be more jerky, at least generally.</description>
		<content:encoded><![CDATA[<p>Thanks, Glenn. I can see why simple extrapolation can be more jerky, at least generally.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William C</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-34619</link>
		<dc:creator>William C</dc:creator>
		<pubDate>Mon, 16 Jan 2012 20:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-34619</guid>
		<description>Hi,

There&#039;s something I&#039;ve always been curious about interpolating between the two different states. If say sprite animations were based off specific update states, how is that handle when the states are interpolated? For example, a player is at rest at the last state but now moving in the current state. When the player moves in the current frame, an animation is triggered. If alpha = 0.5, what do you do with the animation? If it is played, then the time passed for the animation will be a negative number. If I had to guess, I&#039;d say to start the animation and if the time elapsed for the anim is less than 0, just display the first frame and if the time is positive, then the animation time is the actual program time minus a fixed step time. Can you clarify if this makes any sense? Thanks!</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>There&#8217;s something I&#8217;ve always been curious about interpolating between the two different states. If say sprite animations were based off specific update states, how is that handle when the states are interpolated? For example, a player is at rest at the last state but now moving in the current state. When the player moves in the current frame, an animation is triggered. If alpha = 0.5, what do you do with the animation? If it is played, then the time passed for the animation will be a negative number. If I had to guess, I&#8217;d say to start the animation and if the time elapsed for the anim is less than 0, just display the first frame and if the time is positive, then the animation time is the actual program time minus a fixed step time. Can you clarify if this makes any sense? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Fiedler</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-34537</link>
		<dc:creator>Glenn Fiedler</dc:creator>
		<pubDate>Mon, 16 Jan 2012 06:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-34537</guid>
		<description>yes it has been used in many shipped games. of course there are inaccuracies with interpolation, but typically if the game runs acceptably at the simulation framerate -- the interpolation errors are too small to notice. if you choose to extrapolate instead these errors are usually more noticeable. cheers</description>
		<content:encoded><![CDATA[<p>yes it has been used in many shipped games. of course there are inaccuracies with interpolation, but typically if the game runs acceptably at the simulation framerate &#8212; the interpolation errors are too small to notice. if you choose to extrapolate instead these errors are usually more noticeable. cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ingo</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-34434</link>
		<dc:creator>Ingo</dc:creator>
		<pubDate>Sun, 15 Jan 2012 14:30:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-34434</guid>
		<description>Hi Glenn,

great article! I find your interpolation technique interesting. Is this something that is commonly done in games? Somewhere above, you say that it does not create (visual) penetration.  I don&#039;t see why not. Every inexpensive (relative to the actual physics computation) interpolation technique can create state that is physically not valid. If you take your example of a V-shaped bounce, interpolation could create a position that lies somewhere in white space, e.g., between the top corners of the &quot;V&quot;. If there is another small object at that location that won&#039;t actually be hit, you will get visual penetration, don&#039;t you? Or am I missing something?

Cheers</description>
		<content:encoded><![CDATA[<p>Hi Glenn,</p>
<p>great article! I find your interpolation technique interesting. Is this something that is commonly done in games? Somewhere above, you say that it does not create (visual) penetration.  I don&#8217;t see why not. Every inexpensive (relative to the actual physics computation) interpolation technique can create state that is physically not valid. If you take your example of a V-shaped bounce, interpolation could create a position that lies somewhere in white space, e.g., between the top corners of the &#8220;V&#8221;. If there is another small object at that location that won&#8217;t actually be hit, you will get visual penetration, don&#8217;t you? Or am I missing something?</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mangan</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-33404</link>
		<dc:creator>Mangan</dc:creator>
		<pubDate>Mon, 09 Jan 2012 07:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-33404</guid>
		<description>I&#039;ve gone over it again, with fresh eyes, and I see what you mean. Since alpha is never going to be 1, it is in sense equivalent. Although the way I said it seems more intuitive (to me, obviously), in terms of effect your version is the same... and arguably less likely to catch people up on the details than the derivative version I submitted.

As others said, you have a knack for teaching - explaining what needs to be said in a manner that is easy to understand quickly. I&#039;m looking forward to reading the rest of your posts.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve gone over it again, with fresh eyes, and I see what you mean. Since alpha is never going to be 1, it is in sense equivalent. Although the way I said it seems more intuitive (to me, obviously), in terms of effect your version is the same&#8230; and arguably less likely to catch people up on the details than the derivative version I submitted.</p>
<p>As others said, you have a knack for teaching &#8211; explaining what needs to be said in a manner that is easy to understand quickly. I&#8217;m looking forward to reading the rest of your posts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Fiedler</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-33337</link>
		<dc:creator>Glenn Fiedler</dc:creator>
		<pubDate>Sun, 08 Jan 2012 20:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-33337</guid>
		<description>Measure the time between the player input and the frame incorporating that input to be displayed. Does your method actually reduce this, or are you just renaming prev/current to current/next?</description>
		<content:encoded><![CDATA[<p>Measure the time between the player input and the frame incorporating that input to be displayed. Does your method actually reduce this, or are you just renaming prev/current to current/next?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mangan</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-33297</link>
		<dc:creator>Mangan</dc:creator>
		<pubDate>Sun, 08 Jan 2012 13:57:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-33297</guid>
		<description>Excellent post. Very insightful and well said. Continuing on your &quot;Final Touch&quot; approach, many people mentioned what I am about to state but I&#039;m surprised this solution didn&#039;t show up...

My concern is that rendering is always rendering (0,1] timestep behind. It will never be up-to-date.

My proposed solution follows the change from &quot;previous/current&quot; state mindset to one of &quot;current/next&quot;. We always solve up to the &quot;nextState&quot; and then interpolate from current to next. This shouldn&#039;t be an issue under the concept that a single-simulation-iteration should take far less time than rendering. We also end out loop with a negative value accumulator (meaning how much time we must &quot;wait&quot; before we arrive at the &quot;nextState&quot;).

Code changes:

Current state = Next state   (Purely for readability)
Previous state = Current state   (Purely for readability)
Inner while-loop would read: &quot;while (accumulator &gt;= 0)&quot;
Assigning of alpha value would read: &quot;const double alpha = - accumulator / dt;&quot;

Any reasoning that this wouldn&#039;t work that you can see, and if not, then any reason that it would not work better? (Takes away the concept of always being 1 step behind.)

The only thing that comes to mind would be interactions (or any event) that would alter the way the state will integrate from the rendered state to the &quot;next state&quot; that has been stored. Easy work around here is to define that such non-determinstic events are to be applied after the time has been spent to reach the &quot;next state&quot;... which should be hardly noticeable I would think.

Looking forward to your response, and I apologize if someone else mentioned this and I misread.</description>
		<content:encoded><![CDATA[<p>Excellent post. Very insightful and well said. Continuing on your &#8220;Final Touch&#8221; approach, many people mentioned what I am about to state but I&#8217;m surprised this solution didn&#8217;t show up&#8230;</p>
<p>My concern is that rendering is always rendering (0,1] timestep behind. It will never be up-to-date.</p>
<p>My proposed solution follows the change from &#8220;previous/current&#8221; state mindset to one of &#8220;current/next&#8221;. We always solve up to the &#8220;nextState&#8221; and then interpolate from current to next. This shouldn&#8217;t be an issue under the concept that a single-simulation-iteration should take far less time than rendering. We also end out loop with a negative value accumulator (meaning how much time we must &#8220;wait&#8221; before we arrive at the &#8220;nextState&#8221;).</p>
<p>Code changes:</p>
<p>Current state = Next state   (Purely for readability)<br />
Previous state = Current state   (Purely for readability)<br />
Inner while-loop would read: &#8220;while (accumulator &gt;= 0)&#8221;<br />
Assigning of alpha value would read: &#8220;const double alpha = &#8211; accumulator / dt;&#8221;</p>
<p>Any reasoning that this wouldn&#8217;t work that you can see, and if not, then any reason that it would not work better? (Takes away the concept of always being 1 step behind.)</p>
<p>The only thing that comes to mind would be interactions (or any event) that would alter the way the state will integrate from the rendered state to the &#8220;next state&#8221; that has been stored. Easy work around here is to define that such non-determinstic events are to be applied after the time has been spent to reach the &#8220;next state&#8221;&#8230; which should be hardly noticeable I would think.</p>
<p>Looking forward to your response, and I apologize if someone else mentioned this and I misread.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Fiedler</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-28915</link>
		<dc:creator>Glenn Fiedler</dc:creator>
		<pubDate>Thu, 15 Dec 2011 22:29:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-28915</guid>
		<description>Hi. When you interpolate you want to linearly combine the previous and the current frame positions and orientations according to the alpha factor. You only need to do this if you completely fix the timestep and have the accumulator left over. Perhaps you could just try the partially fixed timestep instead, where you just simulate the remainder of time.

cheers</description>
		<content:encoded><![CDATA[<p>Hi. When you interpolate you want to linearly combine the previous and the current frame positions and orientations according to the alpha factor. You only need to do this if you completely fix the timestep and have the accumulator left over. Perhaps you could just try the partially fixed timestep instead, where you just simulate the remainder of time.</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brighthead</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-28651</link>
		<dc:creator>brighthead</dc:creator>
		<pubDate>Wed, 14 Dec 2011 05:50:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-28651</guid>
		<description>hello glenn fiedler:
          i spend almost whole day to get a fully perspective about your article,however ,i have to say thank you ,after i followed your method ,all but my confusions had been settled ,the only one left is that my project has been building with box2d,so when the world-&gt;step within every deltatime , there are some remainder left over ,by your advice ,i should put the interpolation between two frames,but how i can do that ? do you have any advice further particular or there are not at all needed the interpolation?because in my observation ,my game character now running smoothly in the world.

my code here is:


   static double TIMEINTEVERAL = 1.0f/60.0f;
    static double MAX_CYCLE_NUM = 5;
   static double timeAccumulator = 0;
    
    timeAccumulator += timeStep;
    if (timeAccumulator &gt; MAX_CYCLE_NUM * TIMEINTEVERAL) {
        timeAccumulator = TIMEINTEVERAL;
    }    
    while (timeAccumulator &gt; TIMEINTEVERAL) {
        
        timeAccumulator -= TIMEINTEVERAL;
        world -&gt;Step(TIMEINTEVERAL,
                     velocityIterations,
                     positionIterations);
        
        
    }
    
    if (timeAccumulator &gt; 0) {
        const double alpha = timeAccumulator / TIMEINTEVERAL;
        
        world -&gt; Step(timeAccumulator, velocityIterations, );   // here i dont know how to do ???
    }


hopefully ,my expression is clearly</description>
		<content:encoded><![CDATA[<p>hello glenn fiedler:<br />
          i spend almost whole day to get a fully perspective about your article,however ,i have to say thank you ,after i followed your method ,all but my confusions had been settled ,the only one left is that my project has been building with box2d,so when the world-&gt;step within every deltatime , there are some remainder left over ,by your advice ,i should put the interpolation between two frames,but how i can do that ? do you have any advice further particular or there are not at all needed the interpolation?because in my observation ,my game character now running smoothly in the world.</p>
<p>my code here is:</p>
<p>   static double TIMEINTEVERAL = 1.0f/60.0f;<br />
    static double MAX_CYCLE_NUM = 5;<br />
   static double timeAccumulator = 0;</p>
<p>    timeAccumulator += timeStep;<br />
    if (timeAccumulator &gt; MAX_CYCLE_NUM * TIMEINTEVERAL) {<br />
        timeAccumulator = TIMEINTEVERAL;<br />
    }<br />
    while (timeAccumulator &gt; TIMEINTEVERAL) {</p>
<p>        timeAccumulator -= TIMEINTEVERAL;<br />
        world -&gt;Step(TIMEINTEVERAL,<br />
                     velocityIterations,<br />
                     positionIterations);</p>
<p>    }</p>
<p>    if (timeAccumulator &gt; 0) {<br />
        const double alpha = timeAccumulator / TIMEINTEVERAL;</p>
<p>        world -&gt; Step(timeAccumulator, velocityIterations, );   // here i dont know how to do ???<br />
    }</p>
<p>hopefully ,my expression is clearly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Fiedler</title>
		<link>http://gafferongames.com/game-physics/fix-your-timestep/#comment-27939</link>
		<dc:creator>Glenn Fiedler</dc:creator>
		<pubDate>Fri, 09 Dec 2011 08:10:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.gaffer.org/wordpress/fix-your-timestep/#comment-27939</guid>
		<description>Nice idea, thanks!</description>
		<content:encoded><![CDATA[<p>Nice idea, thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

