<?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: A* Pathfinding Project v2.5 is released!!</title>
	<atom:link href="http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/</link>
	<description>Updating the website theme...</description>
	<lastBuildDate>Sat, 04 Sep 2010 16:43:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Admin</title>
		<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/comment-page-1/#comment-761</link>
		<dc:creator>Admin</dc:creator>
		<pubDate>Tue, 15 Jun 2010 11:47:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.arongranberg.com/?p=542#comment-761</guid>
		<description>Hi Felipi

You could call AstarPath.active.Scan () every time you change something, however that would be quite slow and might make your game lag.
Instead you could use an, right now, undocumented function called SetNodes.
For example you can call.
&lt;code&gt;AstarPath.active.SetNodes (false,myTower.bounds,true);&lt;/code&gt;
This will set all nodes (if no colliders are there) in that area (myTower.bounds) to unwalkable (false, first parameter) and it will use FullPhysicsCheck (true, last parameter), which means it will check if the area is free from obstacles first instead of just setting the area to unwalkable whatever what. If you use FullPhysicsCheck, make sure that the tower isn&#039;t instantiated yet, otherwise the script will find the tower and think that the area is still unwalkable.
You can find the full syntax in the AstarPath.cs script (haven&#039;t written a page for it yet).

PS: Remember that you need to do a repath for all units when you have changed something, they don&#039;t do that automatically.</description>
		<content:encoded><![CDATA[<p>Hi Felipi</p>
<p>You could call AstarPath.active.Scan () every time you change something, however that would be quite slow and might make your game lag.<br />
Instead you could use an, right now, undocumented function called SetNodes.<br />
For example you can call.<br />
<code>AstarPath.active.SetNodes (false,myTower.bounds,true);</code><br />
This will set all nodes (if no colliders are there) in that area (myTower.bounds) to unwalkable (false, first parameter) and it will use FullPhysicsCheck (true, last parameter), which means it will check if the area is free from obstacles first instead of just setting the area to unwalkable whatever what. If you use FullPhysicsCheck, make sure that the tower isn&#8217;t instantiated yet, otherwise the script will find the tower and think that the area is still unwalkable.<br />
You can find the full syntax in the AstarPath.cs script (haven&#8217;t written a page for it yet).</p>
<p>PS: Remember that you need to do a repath for all units when you have changed something, they don&#8217;t do that automatically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: felipi</title>
		<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/comment-page-1/#comment-740</link>
		<dc:creator>felipi</dc:creator>
		<pubDate>Sat, 12 Jun 2010 13:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.arongranberg.com/?p=542#comment-740</guid>
		<description>AH! btw, i&#039;m working in a Tower defense game! And, right now my enemies move in a straight line, but soon i intend to upgrade my tower defense to let players make a maze with their towers, and so, i will need to scan the map everytime a player set up a tower in my grid. Is there any way to scan the map again every time i place a tower? Or the only options to scan the map is on startup or manually? Is there any way to call the function &quot;scanmap&quot; from another script?

Sorry if it&#039;s somewhere on this site, but i didn&#039;t find it anywhere!

Thanks!</description>
		<content:encoded><![CDATA[<p>AH! btw, i&#8217;m working in a Tower defense game! And, right now my enemies move in a straight line, but soon i intend to upgrade my tower defense to let players make a maze with their towers, and so, i will need to scan the map everytime a player set up a tower in my grid. Is there any way to scan the map again every time i place a tower? Or the only options to scan the map is on startup or manually? Is there any way to call the function &#8220;scanmap&#8221; from another script?</p>
<p>Sorry if it&#8217;s somewhere on this site, but i didn&#8217;t find it anywhere!</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: felipi</title>
		<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/comment-page-1/#comment-739</link>
		<dc:creator>felipi</dc:creator>
		<pubDate>Sat, 12 Jun 2010 13:03:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.arongranberg.com/?p=542#comment-739</guid>
		<description>sorry to post for this... but just wanted to say HOW AMUZED I AM WITH THIS!!! congratulations, it&#039;s an amazing project. had never worked with AI or pathfind, and the actual game i&#039;m working needs it and i could set everything up  in just 2 hours thanks to your project! Totally noob friendly!

When i grow up, and start selling games i will buy it!</description>
		<content:encoded><![CDATA[<p>sorry to post for this&#8230; but just wanted to say HOW AMUZED I AM WITH THIS!!! congratulations, it&#8217;s an amazing project. had never worked with AI or pathfind, and the actual game i&#8217;m working needs it and i could set everything up  in just 2 hours thanks to your project! Totally noob friendly!</p>
<p>When i grow up, and start selling games i will buy it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steen</title>
		<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/comment-page-1/#comment-672</link>
		<dc:creator>Steen</dc:creator>
		<pubDate>Tue, 01 Jun 2010 09:59:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.arongranberg.com/?p=542#comment-672</guid>
		<description>Hello, i resolved my performance issue before you replied and therefore didnt see yuor reply until i came to check up on it now. My project is done, but i thought i would just share the simple fix i did to get alot more performance.

i am moving 50 AIs and they are constantly updating their target (to follow a player)

As you mention the CharacterController is expensive. I replace the move function with simply giving the AI&#039;s a rigidbody (i had to do this anyway) and pushing the around with physics (force) in their forward direction. (this ofcourse makes them ignore terrain height, but unity has a terrain height function to return the height of your location if standing on a terrain and i simply translate them up in the Y direction to match the height)

probably not the best solution, but it solved the problem for me with very little work :)

Thanks for your work by the way, saved some trouble :)</description>
		<content:encoded><![CDATA[<p>Hello, i resolved my performance issue before you replied and therefore didnt see yuor reply until i came to check up on it now. My project is done, but i thought i would just share the simple fix i did to get alot more performance.</p>
<p>i am moving 50 AIs and they are constantly updating their target (to follow a player)</p>
<p>As you mention the CharacterController is expensive. I replace the move function with simply giving the AI&#8217;s a rigidbody (i had to do this anyway) and pushing the around with physics (force) in their forward direction. (this ofcourse makes them ignore terrain height, but unity has a terrain height function to return the height of your location if standing on a terrain and i simply translate them up in the Y direction to match the height)</p>
<p>probably not the best solution, but it solved the problem for me with very little work <img src='http://www.arongranberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for your work by the way, saved some trouble <img src='http://www.arongranberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Admin</title>
		<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/comment-page-1/#comment-584</link>
		<dc:creator>Admin</dc:creator>
		<pubDate>Tue, 11 May 2010 06:12:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.arongranberg.com/?p=542#comment-584</guid>
		<description>Hi Steen

Are you trying to control 100 AI&#039;s at the same time! Well, then you really need some speedups.
But, are you going to send a pathfinding call to all those 100 units at the same time, or are you giving them orders at different times?
First, the AIFollow script uses CharacterControllers, if you are going to use 100 units, I would not use CharacterControllers since they can be quite expensive.
Instead you can use Transform.Translate and use Raycasting for the height, works almost as good.
You can also see to it that all &quot;direction.magnitude &lt; something&quot; statement can be replaced by &quot;direction.sqrMagnitude &lt; something*something&quot; which will be much faster (square roots are not the fastest things to compute).

Are you seeing slowdowns when you send a Pathfinding call or is the performance slowdown the same the whole time?

Because you posted this question, I tried to make a scene with 100 units and tried to make it run fast, it resulted in the tips above (along with some next version stuff though)
I have posted it here: http://www.arongranberg.com/unity/a-pathfinding/massive/</description>
		<content:encoded><![CDATA[<p>Hi Steen</p>
<p>Are you trying to control 100 AI&#8217;s at the same time! Well, then you really need some speedups.<br />
But, are you going to send a pathfinding call to all those 100 units at the same time, or are you giving them orders at different times?<br />
First, the AIFollow script uses CharacterControllers, if you are going to use 100 units, I would not use CharacterControllers since they can be quite expensive.<br />
Instead you can use Transform.Translate and use Raycasting for the height, works almost as good.<br />
You can also see to it that all &#8220;direction.magnitude < something" statement can be replaced by "direction.sqrMagnitude < something*something" which will be much faster (square roots are not the fastest things to compute).</p>
<p>Are you seeing slowdowns when you send a Pathfinding call or is the performance slowdown the same the whole time?</p>
<p>Because you posted this question, I tried to make a scene with 100 units and tried to make it run fast, it resulted in the tips above (along with some next version stuff though)<br />
I have posted it here: <a href="http://www.arongranberg.com/unity/a-pathfinding/massive/" rel="nofollow">http://www.arongranberg.com/unity/a-pathfinding/massive/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steen</title>
		<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/comment-page-1/#comment-578</link>
		<dc:creator>Steen</dc:creator>
		<pubDate>Thu, 06 May 2010 09:00:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.arongranberg.com/?p=542#comment-578</guid>
		<description>if it helps the thing that seem to take up alot of power is:

coroutine AIFollow: __Compilergenerated2.MoveNext()</description>
		<content:encoded><![CDATA[<p>if it helps the thing that seem to take up alot of power is:</p>
<p>coroutine AIFollow: __Compilergenerated2.MoveNext()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steen</title>
		<link>http://www.arongranberg.com/unity/a-pathfinding-project-2-5-is-released/comment-page-1/#comment-577</link>
		<dc:creator>Steen</dc:creator>
		<pubDate>Thu, 06 May 2010 08:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.arongranberg.com/?p=542#comment-577</guid>
		<description>Hi, i&#039;m using your A* to control a lot of opponents in my game. however, when i got more than 10 enemies in my grid i really starts to take up a lot of resources. Is there a way to increase performance ? (ive tried all the stuff about @performance in the code but cant see any increased performance).

I need it to control maybe 100 AI&#039;s but at the same time, they dont have to be that good (can update less etc)</description>
		<content:encoded><![CDATA[<p>Hi, i&#8217;m using your A* to control a lot of opponents in my game. however, when i got more than 10 enemies in my grid i really starts to take up a lot of resources. Is there a way to increase performance ? (ive tried all the stuff about @performance in the code but cant see any increased performance).</p>
<p>I need it to control maybe 100 AI&#8217;s but at the same time, they dont have to be that good (can update less etc)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
