<?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: deWiTTERS Game Loop</title>
	<atom:link href="http://dev.koonsolo.com/7/dewitters-gameloop/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.koonsolo.com/7/dewitters-gameloop/</link>
	<description>A blog on how to create your own computer games (by Koen Witters)</description>
	<lastBuildDate>Thu, 29 Jul 2010 03:35:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sydney B</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-153</link>
		<dc:creator>Sydney B</dc:creator>
		<pubDate>Thu, 29 Jul 2010 03:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-153</guid>
		<description>With the implementation of loop which offers a constant game speed independent of variable FPS on a seperate thread. Would this not consume most of your cpu processing power? I tried the implemenataion by taking your exact code and running it. my CPU maxes out at 100% on one of the cores.</description>
		<content:encoded><![CDATA[<p>With the implementation of loop which offers a constant game speed independent of variable FPS on a seperate thread. Would this not consume most of your cpu processing power? I tried the implemenataion by taking your exact code and running it. my CPU maxes out at 100% on one of the cores.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shaun</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-152</link>
		<dc:creator>Shaun</dc:creator>
		<pubDate>Wed, 21 Jul 2010 15:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-152</guid>
		<description>You have two separate definitions of the &quot;tick.&quot;  GetTickCount() returns milliseconds, so that means there are 1000 ticks per second.  But in the section &quot;Constant Game Speed with Constant FPS,&quot; you redefine the &quot;tick&quot; to mean a single execution of the update function instead of a cpu clock tick.  I quickly lost any grasp of our timing units.  Can we resolve the units with the following nomenclature?

const int UPDATES_PER_SECOND = 25;
const int TICKS_PER_SECOND = 1000; // GetTickCount() dictates 1000 ticks per second
const int TICKS_PER_UPDATE = TICKS_PER_SECOND / FRAMES_PER_SECOND;

So instead of SKIP_TICKS, we would just use TICKS_PER_UPDATE.  This is clearer to me because I know what each number is measuring.</description>
		<content:encoded><![CDATA[<p>You have two separate definitions of the &#8220;tick.&#8221;  GetTickCount() returns milliseconds, so that means there are 1000 ticks per second.  But in the section &#8220;Constant Game Speed with Constant FPS,&#8221; you redefine the &#8220;tick&#8221; to mean a single execution of the update function instead of a cpu clock tick.  I quickly lost any grasp of our timing units.  Can we resolve the units with the following nomenclature?</p>
<p>const int UPDATES_PER_SECOND = 25;<br />
const int TICKS_PER_SECOND = 1000; // GetTickCount() dictates 1000 ticks per second<br />
const int TICKS_PER_UPDATE = TICKS_PER_SECOND / FRAMES_PER_SECOND;</p>
<p>So instead of SKIP_TICKS, we would just use TICKS_PER_UPDATE.  This is clearer to me because I know what each number is measuring.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Koen Witters</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-148</link>
		<dc:creator>Koen Witters</dc:creator>
		<pubDate>Tue, 06 Jul 2010 11:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-148</guid>
		<description>&lt;a href=&quot;#comment-147&quot; rel=&quot;nofollow&quot;&gt;@jon &lt;/a&gt; 
Glad you like it! Paypal to koen@koonsolo.com, or buy my game Mystic Mine ;). http://www.mysticmine.com</description>
		<content:encoded><![CDATA[<p><a href="#comment-147" rel="nofollow">@jon </a><br />
Glad you like it! Paypal to <a href="mailto:koen@koonsolo.com">koen@koonsolo.com</a>, or buy my game Mystic Mine <img src='http://dev.koonsolo.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . <a href="http://www.mysticmine.com" rel="nofollow">http://www.mysticmine.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jon</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-147</link>
		<dc:creator>jon</dc:creator>
		<pubDate>Tue, 06 Jul 2010 09:41:06 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-147</guid>
		<description>Really good stuff here. Thanks alot. Looks like this might solve my game issues. If it does , are there any donation button here ?</description>
		<content:encoded><![CDATA[<p>Really good stuff here. Thanks alot. Looks like this might solve my game issues. If it does , are there any donation button here ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-146</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Sat, 26 Jun 2010 20:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-146</guid>
		<description>Nice article, its certainly what I was looking for.

In the past I have used &quot;FPS dependent on Constant Game Speed&quot; (gameboy advanced 60fps) and &quot;Game Speed dependent on Variable FPS&quot; but I think now I want both to be variable! ie, a max display fps can be chosen and a max compute fps can be chosen (ie, 60fps display and 100fps if player accuracy is important). I think the source engine uses something like this (with compute capped to display) and that is the functionality I should aim for.

What would be the prospects of having several fps independant components? should I use semaphores and have the game objects independantly wait on results? - AI for example. or independantly different fps for input, ai, particles, physics, rendering? what could I expect from such an approach and how would I actually control such a thing?</description>
		<content:encoded><![CDATA[<p>Nice article, its certainly what I was looking for.</p>
<p>In the past I have used &#8220;FPS dependent on Constant Game Speed&#8221; (gameboy advanced 60fps) and &#8220;Game Speed dependent on Variable FPS&#8221; but I think now I want both to be variable! ie, a max display fps can be chosen and a max compute fps can be chosen (ie, 60fps display and 100fps if player accuracy is important). I think the source engine uses something like this (with compute capped to display) and that is the functionality I should aim for.</p>
<p>What would be the prospects of having several fps independant components? should I use semaphores and have the game objects independantly wait on results? &#8211; AI for example. or independantly different fps for input, ai, particles, physics, rendering? what could I expect from such an approach and how would I actually control such a thing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gideon</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-139</link>
		<dc:creator>Gideon</dc:creator>
		<pubDate>Wed, 24 Mar 2010 09:25:50 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-139</guid>
		<description>&lt;a href=&quot;#comment-138&quot; rel=&quot;nofollow&quot;&gt;@Koen Witters &lt;/a&gt; 
Hi Koen,

thanks for the quick answer \(^o^)/.
Since i´m (not yet) at the point where i need a lot of physics operations, i
will leave my implementation as it is. But i like the idea of spreading!
I am updating my game state at 50fps now, and do rendering and collision detection as fast as possible. Works like a charm ^_^.
Can´t wait for your next article!</description>
		<content:encoded><![CDATA[<p><a href="#comment-138" rel="nofollow">@Koen Witters </a><br />
Hi Koen,</p>
<p>thanks for the quick answer \(^o^)/.<br />
Since i´m (not yet) at the point where i need a lot of physics operations, i<br />
will leave my implementation as it is. But i like the idea of spreading!<br />
I am updating my game state at 50fps now, and do rendering and collision detection as fast as possible. Works like a charm ^_^.<br />
Can´t wait for your next article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Koen Witters</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-138</link>
		<dc:creator>Koen Witters</dc:creator>
		<pubDate>Tue, 23 Mar 2010 20:20:52 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-138</guid>
		<description>Hi Gideon, you should first figure out the exact problem. If your problem is that the game doesn&#039;t respond fast enough, then you should use more ticks per second for your update_game loop. (Remark that this will also make the rendering more exact).

If your problem is purely a visual one (the rendering), then you should use collision prediction in your rendering, and interpolate accordingly.

There is one other solution though, but I haven&#039;t yet written anything about it. If you use a physics engine, chance is that you need to do lots of iterations of that physics engine per update_game. What you can do is spread out those iterations while you render. For example if you need to do 20 physics iterations per update_game, you can spread those 20 iterations out while you render. This way your rendering can take advantage of more exact positions (provided by the physics engine), but your game still runs at the normal update_game rate. Hope this is a bit clear, or else I&#039;ll see if I can write another article ;).</description>
		<content:encoded><![CDATA[<p>Hi Gideon, you should first figure out the exact problem. If your problem is that the game doesn&#8217;t respond fast enough, then you should use more ticks per second for your update_game loop. (Remark that this will also make the rendering more exact).</p>
<p>If your problem is purely a visual one (the rendering), then you should use collision prediction in your rendering, and interpolate accordingly.</p>
<p>There is one other solution though, but I haven&#8217;t yet written anything about it. If you use a physics engine, chance is that you need to do lots of iterations of that physics engine per update_game. What you can do is spread out those iterations while you render. For example if you need to do 20 physics iterations per update_game, you can spread those 20 iterations out while you render. This way your rendering can take advantage of more exact positions (provided by the physics engine), but your game still runs at the normal update_game rate. Hope this is a bit clear, or else I&#8217;ll see if I can write another article <img src='http://dev.koonsolo.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gideon</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-137</link>
		<dc:creator>Gideon</dc:creator>
		<pubDate>Tue, 23 Mar 2010 17:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-137</guid>
		<description>Aloha Koen!

Great article, it helped me a lot to get some things straight for my game.
One question though..if i have very fast moving objects, how can i detect collision when checking only like 25 frames per second. It works when i do collision detection every loop (outside the update loop) and also using interpolation/prediction. But I really dont like this solution, because collision is now being checked for each time i render to the screen. Any suggestions?

Thanks in advance and sorry for my bad english (i´m german) ^^</description>
		<content:encoded><![CDATA[<p>Aloha Koen!</p>
<p>Great article, it helped me a lot to get some things straight for my game.<br />
One question though..if i have very fast moving objects, how can i detect collision when checking only like 25 frames per second. It works when i do collision detection every loop (outside the update loop) and also using interpolation/prediction. But I really dont like this solution, because collision is now being checked for each time i render to the screen. Any suggestions?</p>
<p>Thanks in advance and sorry for my bad english (i´m german) ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gideon</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-136</link>
		<dc:creator>Gideon</dc:creator>
		<pubDate>Tue, 23 Mar 2010 17:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-136</guid>
		<description>&lt;a href=&quot;#comment-135&quot; rel=&quot;nofollow&quot;&gt;@Daniel &lt;/a&gt; 
Hey Daniel,

the GetTickCount() is an example of a typical function which returns the number of ticks (usually milliseconds) since the app is running. In SDL for instance this would be SDL_GetTicks(). It is used to measure time within your application.</description>
		<content:encoded><![CDATA[<p><a href="#comment-135" rel="nofollow">@Daniel </a><br />
Hey Daniel,</p>
<p>the GetTickCount() is an example of a typical function which returns the number of ticks (usually milliseconds) since the app is running. In SDL for instance this would be SDL_GetTicks(). It is used to measure time within your application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://dev.koonsolo.com/7/dewitters-gameloop/comment-page-1/#comment-135</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Sat, 20 Mar 2010 17:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://dev.koonsolo.com/?p=7#comment-135</guid>
		<description>Awesome post, thanks.
I am a little confused tho. What is GetTickCount() function? It&#039;s be very useful if you could put an example implementation of it on the page as well.</description>
		<content:encoded><![CDATA[<p>Awesome post, thanks.<br />
I am a little confused tho. What is GetTickCount() function? It&#8217;s be very useful if you could put an example implementation of it on the page as well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
