<?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: Timer based Vs frame based</title>
	<atom:link href="http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/</link>
	<description>italian geek and PROgrammer</description>
	<lastBuildDate>Wed, 17 Mar 2010 22:10:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Flash tutorials &#124; AS3 Timer class tutorials roundup &#124; Lemlinh.com</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-281337</link>
		<dc:creator>Flash tutorials &#124; AS3 Timer class tutorials roundup &#124; Lemlinh.com</dc:creator>
		<pubDate>Sat, 20 Sep 2008 04:54:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-281337</guid>
		<description>[...] Read more [...]</description>
		<content:encoded><![CDATA[<p>[...] Read more [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Callaghan</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-273881</link>
		<dc:creator>Ian Callaghan</dc:creator>
		<pubDate>Thu, 11 Sep 2008 00:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-273881</guid>
		<description>If you think about it though, it really depends on the game. For example if you had a game where you had to last aslong as you could that used a true timer, it could be exploited by using cpu intensive apps to lower the frame rate.

I guess real time/frame based both have their advantages for different situations =)</description>
		<content:encoded><![CDATA[<p>If you think about it though, it really depends on the game. For example if you had a game where you had to last aslong as you could that used a true timer, it could be exploited by using cpu intensive apps to lower the frame rate.</p>
<p>I guess real time/frame based both have their advantages for different situations =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-253676</link>
		<dc:creator>Iain</dc:creator>
		<pubDate>Sun, 17 Aug 2008 16:21:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-253676</guid>
		<description>You should only ever use a time-based timer if you have time-based game code, for example onUpdate(){x += 5 * timeElapsedSinceLastFrame} 

If you have frame-based game code, for example onUpate(){x += 5} you should be using a frame based timer.

This is the fairest way to do it. I guess developers (me included) do things frame-based because it&#039;s simpler, and collision detection code etc is easier and more consistent to program. For multi-user games, for example, you have to be time-based, so it&#039;s a useful thing to learn.</description>
		<content:encoded><![CDATA[<p>You should only ever use a time-based timer if you have time-based game code, for example onUpdate(){x += 5 * timeElapsedSinceLastFrame} </p>
<p>If you have frame-based game code, for example onUpate(){x += 5} you should be using a frame based timer.</p>
<p>This is the fairest way to do it. I guess developers (me included) do things frame-based because it&#8217;s simpler, and collision detection code etc is easier and more consistent to program. For multi-user games, for example, you have to be time-based, so it&#8217;s a useful thing to learn.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jhelle</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-252921</link>
		<dc:creator>Jhelle</dc:creator>
		<pubDate>Sat, 16 Aug 2008 17:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-252921</guid>
		<description>I recently stumbled upon a discussion about this topic and within it is a nice explanation on how to make a true timer based function in AS2.0

https://www.mochiads.com/community/forum/topic/best-way-to-make-slow-motion/54949#54949</description>
		<content:encoded><![CDATA[<p>I recently stumbled upon a discussion about this topic and within it is a nice explanation on how to make a true timer based function in AS2.0</p>
<p><a href="https://www.mochiads.com/community/forum/topic/best-way-to-make-slow-motion/54949#54949" rel="nofollow">https://www.mochiads.com/community/forum/topic/best-way-to-make-slow-motion/54949#54949</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Livesinabox</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-252664</link>
		<dc:creator>Livesinabox</dc:creator>
		<pubDate>Sat, 16 Aug 2008 09:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-252664</guid>
		<description>It&#039;s a valid point, timing in flash is terrible and the slower your computer is running (if it&#039;s just busy running other apps, old or a cheap laptop running vista) then a lot of flash games become unplayable due to the frame update rate compared to the input reaction speed.

About the only thing you can do is watch the number of frames going by and average the time across a few seconds and adjust the game accordingly. I use a smoothed frame update method which instead of giving me say 70ms-&gt;20ms-&gt;40ms gives me 33ms-&gt;30ms-&gt;31ms which i use for slightly smoother motion and animation. You can see my test on my blog http://www.adventuresinactionscript.com/blog/27-07-2008/accurate-timing-with-actionscript-3

Until adobe improve their timing under all circumstances (which is probably very difficult) you&#039;ll struggle to get accurate timing - although i do have some other ideas, i haven&#039;t had time to put them into practice!

As for cheating - if someone really wants to cheat theres already tools that do this kinda thing which you&#039;ll struggle to protect against - google &quot;speed gear&quot;. Check out youtube for all the videos of people cheating in flash in various ways!</description>
		<content:encoded><![CDATA[<p>It&#8217;s a valid point, timing in flash is terrible and the slower your computer is running (if it&#8217;s just busy running other apps, old or a cheap laptop running vista) then a lot of flash games become unplayable due to the frame update rate compared to the input reaction speed.</p>
<p>About the only thing you can do is watch the number of frames going by and average the time across a few seconds and adjust the game accordingly. I use a smoothed frame update method which instead of giving me say 70ms-&gt;20ms-&gt;40ms gives me 33ms-&gt;30ms-&gt;31ms which i use for slightly smoother motion and animation. You can see my test on my blog <a href="http://www.adventuresinactionscript.com/blog/27-07-2008/accurate-timing-with-actionscript-3" rel="nofollow">http://www.adventuresinactionscript.com/blog/27-07-2008/accurate-timing-with-actionscript-3</a></p>
<p>Until adobe improve their timing under all circumstances (which is probably very difficult) you&#8217;ll struggle to get accurate timing &#8211; although i do have some other ideas, i haven&#8217;t had time to put them into practice!</p>
<p>As for cheating &#8211; if someone really wants to cheat theres already tools that do this kinda thing which you&#8217;ll struggle to protect against &#8211; google &#8220;speed gear&#8221;. Check out youtube for all the videos of people cheating in flash in various ways!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kesh</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-252594</link>
		<dc:creator>Kesh</dc:creator>
		<pubDate>Sat, 16 Aug 2008 06:33:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-252594</guid>
		<description>so limpeh, you are trying to say that he should enable an easy cheat just because there are 80 year olds with pieces of shiz computers?</description>
		<content:encoded><![CDATA[<p>so limpeh, you are trying to say that he should enable an easy cheat just because there are 80 year olds with pieces of shiz computers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-252440</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Sat, 16 Aug 2008 00:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-252440</guid>
		<description>perhaps you could monitor the frame rate and stop the game if it drops below a certain level</description>
		<content:encoded><![CDATA[<p>perhaps you could monitor the frame rate and stop the game if it drops below a certain level</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: limpeh</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-252375</link>
		<dc:creator>limpeh</dc:creator>
		<pubDate>Fri, 15 Aug 2008 22:58:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-252375</guid>
		<description>However, if you make it timer-based, then that will not be fair for those people with slower computer, am I right? That means, they have slower &#039;responding time&#039; but the time just keeps on passing.</description>
		<content:encoded><![CDATA[<p>However, if you make it timer-based, then that will not be fair for those people with slower computer, am I right? That means, they have slower &#8216;responding time&#8217; but the time just keeps on passing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prankard</title>
		<link>http://www.emanueleferonato.com/2008/08/16/timer-based-vs-frame-based/comment-page-1/#comment-252352</link>
		<dc:creator>Prankard</dc:creator>
		<pubDate>Fri, 15 Aug 2008 22:37:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=427#comment-252352</guid>
		<description>I&#039;m working on a box2d game at the moment. I was having &quot;related&quot; problems in terms of experiencing different speeds of the game for on different computers.

I always test my games on my friends PC that I built for her, it&#039;s a single core 1Ghz AMD, 512mb RAM and if it runs my game at anywhere near a playable speed I&#039;m happy.

What I used to do (and other developers used to do) was change the framerate of your game from your standard NTSC 30fps to something nearer 60. 
This way it would force your CPU draining game to try to run faster and actually playable. The problem with this was, browsers (like Safari) began to run flash faster, and with PC&#039;s speeding up in processing power it was possible to actually run the game at 60fps, which is unplayable.

Now, I&#039;ve come across frameRateKeeper.as which can be found at MajiDesign:
http://majidesign.com/forum/viewtopic.php?t=46

What it does is get the data from the system clock and monitor how fast your flash is running (actual framerate), then using the new AS3 code change the flash running framerate to speedup or slowdown your flash until you get the desired framerate.

It&#039;s very simple code and can easily been written directly into your flash (but why re-invent the wheel).

So, download it and see how it performs in browser and out of browser on your game. If you want to do some test, take out the line that changes the framerate and just monitor what rate it is running at.
Oh, and please be aware, tracing out a lot of things like frameRateKeeper currently does I wouldn&#039;t do. I only have a single core on my laptop and tracing lots of things causes my flash to run a lot slower. Just display the framerate in a dynamic textbox.

I hope this post has been useful.</description>
		<content:encoded><![CDATA[<p>I&#8217;m working on a box2d game at the moment. I was having &#8220;related&#8221; problems in terms of experiencing different speeds of the game for on different computers.</p>
<p>I always test my games on my friends PC that I built for her, it&#8217;s a single core 1Ghz AMD, 512mb RAM and if it runs my game at anywhere near a playable speed I&#8217;m happy.</p>
<p>What I used to do (and other developers used to do) was change the framerate of your game from your standard NTSC 30fps to something nearer 60.<br />
This way it would force your CPU draining game to try to run faster and actually playable. The problem with this was, browsers (like Safari) began to run flash faster, and with PC&#8217;s speeding up in processing power it was possible to actually run the game at 60fps, which is unplayable.</p>
<p>Now, I&#8217;ve come across frameRateKeeper.as which can be found at MajiDesign:<br />
<a href="http://majidesign.com/forum/viewtopic.php?t=46" rel="nofollow">http://majidesign.com/forum/viewtopic.php?t=46</a></p>
<p>What it does is get the data from the system clock and monitor how fast your flash is running (actual framerate), then using the new AS3 code change the flash running framerate to speedup or slowdown your flash until you get the desired framerate.</p>
<p>It&#8217;s very simple code and can easily been written directly into your flash (but why re-invent the wheel).</p>
<p>So, download it and see how it performs in browser and out of browser on your game. If you want to do some test, take out the line that changes the framerate and just monitor what rate it is running at.<br />
Oh, and please be aware, tracing out a lot of things like frameRateKeeper currently does I wouldn&#8217;t do. I only have a single core on my laptop and tracing lots of things causes my flash to run a lot slower. Just display the framerate in a dynamic textbox.</p>
<p>I hope this post has been useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
