<?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: Finite State Machines</title>
	<atom:link href="http://cheezeworld.com/finite-state-machines/feed/" rel="self" type="application/rss+xml" />
	<link>http://cheezeworld.com/finite-state-machines/</link>
	<description>The Cheeze to Your Macaroni - Games, Open Source Programming, and Other Odd Ramblings.</description>
	<lastBuildDate>Sun, 27 Feb 2011 05:06:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Why you should use Flex and Flash Together &#124; Internet Superstars</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-5649</link>
		<dc:creator>Why you should use Flex and Flash Together &#124; Internet Superstars</dc:creator>
		<pubDate>Thu, 01 Oct 2009 02:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-5649</guid>
		<description>[...] what happens when you switch between different states. (8-bit rocket has a good tutorial, so does Cheezeworld)  This will cost you some time now, but you&#8217;ll have a state machine ready to go for the [...]</description>
		<content:encoded><![CDATA[<p>[...] what happens when you switch between different states. (8-bit rocket has a good tutorial, so does Cheezeworld)  This will cost you some time now, but you&#8217;ll have a state machine ready to go for the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colby Cheeze</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-5540</link>
		<dc:creator>Colby Cheeze</dc:creator>
		<pubDate>Sat, 19 Sep 2009 17:17:46 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-5540</guid>
		<description>Thank you Brett. This was an accident of mine. I believe that I was testing something out and forgot to uncomment the code before releasing it.</description>
		<content:encoded><![CDATA[<p>Thank you Brett. This was an accident of mine. I believe that I was testing something out and forgot to uncomment the code before releasing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-5535</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Fri, 18 Sep 2009 20:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-5535</guid>
		<description>Wish I had researched before posting nonetheless found the problem...
	 	public function removeChild( a_id:String ):void
	 	{
	 		
			if( Entity( _entityMap[ a_id ] ) == null )
			{
				throw new Error( &quot; There was no entity with a matching id.&quot; );
				return;
			}
			
			//_entityMap[ a_id ].dispose();
			delete _entityMap[ a_id ];
	 	}

This block of code from Entity.as has the line _entityMap[ a_id ].dispose(); commented out.  I am not sure if this was because it was planned for later or what nor did I research what this map did but needless to say uncommenting it fixed the removal issue.  

So after change looks like this and works as expected again along with the super slowness/freezing goes away.  I assume this non removal is hogging up all the memory.  Anyway, hope this was helpful.
	 	public function removeChild( a_id:String ):void
	 	{
	 		
			if( Entity( _entityMap[ a_id ] ) == null )
			{
				throw new Error( &quot; There was no entity with a matching id.&quot; );
				return;
			}
			
			_entityMap[ a_id ].dispose();
			delete _entityMap[ a_id ];
	 	}</description>
		<content:encoded><![CDATA[<p>Wish I had researched before posting nonetheless found the problem&#8230;<br />
	 	public function removeChild( a_id:String ):void<br />
	 	{</p>
<p>			if( Entity( _entityMap[ a_id ] ) == null )<br />
			{<br />
				throw new Error( &#8221; There was no entity with a matching id.&#8221; );<br />
				return;<br />
			}</p>
<p>			//_entityMap[ a_id ].dispose();<br />
			delete _entityMap[ a_id ];<br />
	 	}</p>
<p>This block of code from Entity.as has the line _entityMap[ a_id ].dispose(); commented out.  I am not sure if this was because it was planned for later or what nor did I research what this map did but needless to say uncommenting it fixed the removal issue.  </p>
<p>So after change looks like this and works as expected again along with the super slowness/freezing goes away.  I assume this non removal is hogging up all the memory.  Anyway, hope this was helpful.<br />
	 	public function removeChild( a_id:String ):void<br />
	 	{</p>
<p>			if( Entity( _entityMap[ a_id ] ) == null )<br />
			{<br />
				throw new Error( &#8221; There was no entity with a matching id.&#8221; );<br />
				return;<br />
			}</p>
<p>			_entityMap[ a_id ].dispose();<br />
			delete _entityMap[ a_id ];<br />
	 	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-5534</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Fri, 18 Sep 2009 19:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-5534</guid>
		<description>Hey, just imported this version into my project.  I will research why but right now when I remove a Entity from the factory it draws the Sprite on the camera in the spot of removal forever.  This is something that happened after the update and once I find out what is causing I will get back to you.  Just thought you should know.  Also, seems to get real slow after a bit after this happens.</description>
		<content:encoded><![CDATA[<p>Hey, just imported this version into my project.  I will research why but right now when I remove a Entity from the factory it draws the Sprite on the camera in the spot of removal forever.  This is something that happened after the update and once I find out what is causing I will get back to you.  Just thought you should know.  Also, seems to get real slow after a bit after this happens.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-4990</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Tue, 25 Aug 2009 18:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-4990</guid>
		<description>Had downloaded your code since I came across it while pretty much starting to write my own version of the same thing.  Took me a while to follow through all your code which I wish you had commented but really impressively written.  You did alot of the work for me and really well laid out.  I actually have written my own FSM with pretty much the same style as yours but will be taking a look at yours as I plan to update my code with your newest.  By the way, I am using your code quite heavily for my own steering game I am writing and I did find a bug in one of your Vector methods, upon fixing it broke some of your steering which I didn&#039;t pursue.  

Basically, the issue I found was the following, in the code if you get a rounding error due to something directly facing something when you ask for the angle you get a NAN when pointing at something or point directly away.  

	
 		public function angleTo( vector:Vector2D ):Number
 		{
 			return Math.acos( dotOf( vector ) / ( length * vector.length ) );
 		}

Need to check the return and see if it is out of range of acos and if is return 0 or pi depending on which direction.

I would post my corrected code but I am at work and don&#039;t have it.  Also, it is under a different method because it does screw up some of the steering behavior once corrected.

Really happy to see you reposting and really like the infastructure you have created.</description>
		<content:encoded><![CDATA[<p>Had downloaded your code since I came across it while pretty much starting to write my own version of the same thing.  Took me a while to follow through all your code which I wish you had commented but really impressively written.  You did alot of the work for me and really well laid out.  I actually have written my own FSM with pretty much the same style as yours but will be taking a look at yours as I plan to update my code with your newest.  By the way, I am using your code quite heavily for my own steering game I am writing and I did find a bug in one of your Vector methods, upon fixing it broke some of your steering which I didn&#8217;t pursue.  </p>
<p>Basically, the issue I found was the following, in the code if you get a rounding error due to something directly facing something when you ask for the angle you get a NAN when pointing at something or point directly away.  </p>
<p> 		public function angleTo( vector:Vector2D ):Number<br />
 		{<br />
 			return Math.acos( dotOf( vector ) / ( length * vector.length ) );<br />
 		}</p>
<p>Need to check the return and see if it is out of range of acos and if is return 0 or pi depending on which direction.</p>
<p>I would post my corrected code but I am at work and don&#8217;t have it.  Also, it is under a different method because it does screw up some of the steering behavior once corrected.</p>
<p>Really happy to see you reposting and really like the infastructure you have created.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Porter</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-4940</link>
		<dc:creator>Porter</dc:creator>
		<pubDate>Thu, 20 Aug 2009 01:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-4940</guid>
		<description>Awesome post, this is a great example of code. I love looking at how other people code things and this is a great example of what I look for. I actually used this in my last link dump, good stuff.</description>
		<content:encoded><![CDATA[<p>Awesome post, this is a great example of code. I love looking at how other people code things and this is a great example of what I look for. I actually used this in my last link dump, good stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-4914</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 18 Aug 2009 06:10:57 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-4914</guid>
		<description>WOW, so I&#039;ve been looking for a good gaming blog to follow for awhile now... and I just came across yours... AMAZING STUFF! This is exactly what I&#039;ve been looking for. I&#039;ve been reading your blog for about 2 hours now and can stop. Thank you soo much, and keep up the great work! :)</description>
		<content:encoded><![CDATA[<p>WOW, so I&#8217;ve been looking for a good gaming blog to follow for awhile now&#8230; and I just came across yours&#8230; AMAZING STUFF! This is exactly what I&#8217;ve been looking for. I&#8217;ve been reading your blog for about 2 hours now and can stop. Thank you soo much, and keep up the great work! <img src='http://cheezeworld.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nicoChico</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-4884</link>
		<dc:creator>nicoChico</dc:creator>
		<pubDate>Fri, 14 Aug 2009 14:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-4884</guid>
		<description>Awesome.. keep writing.</description>
		<content:encoded><![CDATA[<p>Awesome.. keep writing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Orlando</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-4883</link>
		<dc:creator>Orlando</dc:creator>
		<pubDate>Fri, 14 Aug 2009 14:00:37 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-4883</guid>
		<description>Welcome back!

I was so excited to see a new update in my RSS feed, I hope to see a lot more!</description>
		<content:encoded><![CDATA[<p>Welcome back!</p>
<p>I was so excited to see a new update in my RSS feed, I hope to see a lot more!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 8bitjeff</title>
		<link>http://cheezeworld.com/finite-state-machines/comment-page-1/#comment-4878</link>
		<dc:creator>8bitjeff</dc:creator>
		<pubDate>Fri, 14 Aug 2009 03:56:06 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=198#comment-4878</guid>
		<description>Hey Colby! Nice work. This is something I looked into a while back after reading the Head First Design Patterns book, but I never fully implemented it. I have a version that is a little deeper than the GYW version, but not nearly as complete in an OOP sense as yours. That framework of yours is really coming around!</description>
		<content:encoded><![CDATA[<p>Hey Colby! Nice work. This is something I looked into a while back after reading the Head First Design Patterns book, but I never fully implemented it. I have a version that is a little deeper than the GYW version, but not nearly as complete in an OOP sense as yours. That framework of yours is really coming around!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

