<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Memory-efficient pathfinding</title>
	<link>http://realtimecollisiondetection.net/blog/?p=83</link>
	<description>Coding wisdom and rants of Christer Ericson</description>
	<pubDate>Fri, 10 Sep 2010 22:54:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: tony</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2394</link>
		<author>tony</author>
		<pubDate>Wed, 01 Oct 2008 15:58:21 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2394</guid>
		<description>Check this out:
EGM's interview with Platnium games, formerly Clover Studio (Viewtiful Joe, God Hand, Okami).

1UP: Okay. God of War?

Hideki Kamiya: My impression is that it's very carefully made, the details are all carefully made. Devil May Cry was a bit rough, but I think that there's no roughness in God of War. I think that it's very well-made. So there's like a wall for your imagination or ideas, and when you're actually creating something, you don't even see the wall. But with GOW, I felt like I saw beyond the wall. So the GOW dev team's imagination and their ideas were like... beyond. That's something else that struck me. And also, I feel a bit bad about talking like somebody who is evaluating a game. But I felt like they created the game in a very good way which managed to bring in the users, they gave you a huge impactful feeling right in the beginning, and just drew you into the game. So I'm very impressed that they made the game like that.

Yusuke Hashimoto: The level of the game was very high in general. So the things that you see in the game are things that you can't even imagine. The imagination is one step ahead of you.

Hideki Kamiya: In this game, they were using a camera system that was on rails. The camera follows the character like they're on rail tracks. And so it makes the game really easy to play, and of course I was impressed by that. And there were people around me who were like, "Oh, you should use that camera." But it's not something that you can easily do. To create that kind of a system, you have to pile up a lot of technology, and study a lot, and research a lot, to be able to make a camera system like that. I was like "Okay, you guys appreciate the technology, but it's not that easy. Everything in the game is not easy to make." These guys were really serious about the creation, and they put in a lot of effort in it, and that's why that game came out so well. So yeah, I played GOW2 and the PSP version, and I feel that they were very well-made.</description>
		<content:encoded><![CDATA[<p>Check this out:<br />
EGM&#8217;s interview with Platnium games, formerly Clover Studio (Viewtiful Joe, God Hand, Okami).</p>
<p>1UP: Okay. God of War?</p>
<p>Hideki Kamiya: My impression is that it&#8217;s very carefully made, the details are all carefully made. Devil May Cry was a bit rough, but I think that there&#8217;s no roughness in God of War. I think that it&#8217;s very well-made. So there&#8217;s like a wall for your imagination or ideas, and when you&#8217;re actually creating something, you don&#8217;t even see the wall. But with GOW, I felt like I saw beyond the wall. So the GOW dev team&#8217;s imagination and their ideas were like&#8230; beyond. That&#8217;s something else that struck me. And also, I feel a bit bad about talking like somebody who is evaluating a game. But I felt like they created the game in a very good way which managed to bring in the users, they gave you a huge impactful feeling right in the beginning, and just drew you into the game. So I&#8217;m very impressed that they made the game like that.</p>
<p>Yusuke Hashimoto: The level of the game was very high in general. So the things that you see in the game are things that you can&#8217;t even imagine. The imagination is one step ahead of you.</p>
<p>Hideki Kamiya: In this game, they were using a camera system that was on rails. The camera follows the character like they&#8217;re on rail tracks. And so it makes the game really easy to play, and of course I was impressed by that. And there were people around me who were like, &#8220;Oh, you should use that camera.&#8221; But it&#8217;s not something that you can easily do. To create that kind of a system, you have to pile up a lot of technology, and study a lot, and research a lot, to be able to make a camera system like that. I was like &#8220;Okay, you guys appreciate the technology, but it&#8217;s not that easy. Everything in the game is not easy to make.&#8221; These guys were really serious about the creation, and they put in a lot of effort in it, and that&#8217;s why that game came out so well. So yeah, I played GOW2 and the PSP version, and I feel that they were very well-made.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Game AI Roundup Week #39 2008: 9 Stories, 1 Video, 1 Quote, 1 Game &#8212; AiGameDev.com</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2389</link>
		<author>Game AI Roundup Week #39 2008: 9 Stories, 1 Video, 1 Quote, 1 Game &#8212; AiGameDev.com</author>
		<pubDate>Mon, 29 Sep 2008 02:22:36 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2389</guid>
		<description>[...] realtimecollisiondetection.net - Memory-efficient pathfinding [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] realtimecollisiondetection.net - Memory-efficient pathfinding [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christer</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2372</link>
		<author>christer</author>
		<pubDate>Wed, 24 Sep 2008 07:11:54 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2372</guid>
		<description>There are lots of reasons if you think about the problem more. For example, Lee's algorithm trivially maps to GPGPU architectures, whereas A* does not (the priority queue, or similar, for handling the open/closed lists is not GPGPU friendly). Furthermore, running Lee's algorithm on GPGPU trivially parallelizes and we can easily execute 4 pathfinding problems in parallel in a shader using a single rendertarget (one per component).

Enter Akers' algorithm. With a single RGBA8 buffer we can now do not just 4 problems in parallel, but 16 problems in parallel (as each only requires 2 out of 8 bits available). Then add MRTs on top of that for even more parallelization.

Always explore options. Always know multiple algorithms. Other reasons to care left as an exercise for the reader.</description>
		<content:encoded><![CDATA[<p>There are lots of reasons if you think about the problem more. For example, Lee&#8217;s algorithm trivially maps to GPGPU architectures, whereas A* does not (the priority queue, or similar, for handling the open/closed lists is not GPGPU friendly). Furthermore, running Lee&#8217;s algorithm on GPGPU trivially parallelizes and we can easily execute 4 pathfinding problems in parallel in a shader using a single rendertarget (one per component).</p>
<p>Enter Akers&#8217; algorithm. With a single RGBA8 buffer we can now do not just 4 problems in parallel, but 16 problems in parallel (as each only requires 2 out of 8 bits available). Then add MRTs on top of that for even more parallelization.</p>
<p>Always explore options. Always know multiple algorithms. Other reasons to care left as an exercise for the reader.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: StoneCypher</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2368</link>
		<author>StoneCypher</author>
		<pubDate>Tue, 23 Sep 2008 21:58:25 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2368</guid>
		<description>I'm a little confused why you feel that people writing games should be familiar with these algorithms.  Traditional pathfinding algorithms like A* will search significantly fewer cells in significantly less ram (your approach is low-memory only if you pretend that the mutable part of the map you're using to keep track of what's been touched isn't to be counted.)

This approach is slow and memory hungry in comparison to normal methods.  Please profile it.</description>
		<content:encoded><![CDATA[<p>I&#8217;m a little confused why you feel that people writing games should be familiar with these algorithms.  Traditional pathfinding algorithms like A* will search significantly fewer cells in significantly less ram (your approach is low-memory only if you pretend that the mutable part of the map you&#8217;re using to keep track of what&#8217;s been touched isn&#8217;t to be counted.)</p>
<p>This approach is slow and memory hungry in comparison to normal methods.  Please profile it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SolomonS</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2358</link>
		<author>SolomonS</author>
		<pubDate>Tue, 23 Sep 2008 05:18:51 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2358</guid>
		<description>I was about to write a response further outlining my objection, which made me think about it some more, and I realized you're right; the encoding is even more clever than I realized.

The bit (no pun intended) I was missing was that on arrival of the goal cell during the flood-fill stage, you don't need any previous path information; just knowing the previous depth is actually good enough, because knowing any 2 bits in the sequence uniquely determines your spot in the sequence.

Anyways, cool algorithm!</description>
		<content:encoded><![CDATA[<p>I was about to write a response further outlining my objection, which made me think about it some more, and I realized you&#8217;re right; the encoding is even more clever than I realized.</p>
<p>The bit (no pun intended) I was missing was that on arrival of the goal cell during the flood-fill stage, you don&#8217;t need any previous path information; just knowing the previous depth is actually good enough, because knowing any 2 bits in the sequence uniquely determines your spot in the sequence.</p>
<p>Anyways, cool algorithm!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christer</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2356</link>
		<author>christer</author>
		<pubDate>Tue, 23 Sep 2008 04:11:13 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2356</guid>
		<description>"This approach doesn’t quite work with the Akers modification"

Sure it does, you do exactly the same thing in both algorithms! For Akers' algorithm you start at the goal (which had a value of 1), and then go, in sequence, to successive neighboring squares with the following values: 1, 0, 0, 1, 1, 0, 0, &#8230;.

The beauty of Akers' encoding is that following the sequence backwards (based on wherever in the sequence you were when you reached the goal) will make you arrive at the start every time!</description>
		<content:encoded><![CDATA[<p>&#8220;This approach doesn’t quite work with the Akers modification&#8221;</p>
<p>Sure it does, you do exactly the same thing in both algorithms! For Akers&#8217; algorithm you start at the goal (which had a value of 1), and then go, in sequence, to successive neighboring squares with the following values: 1, 0, 0, 1, 1, 0, 0, &hellip;.</p>
<p>The beauty of Akers&#8217; encoding is that following the sequence backwards (based on wherever in the sequence you were when you reached the goal) will make you arrive at the start every time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SolomonS</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2354</link>
		<author>SolomonS</author>
		<pubDate>Tue, 23 Sep 2008 00:41:52 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2354</guid>
		<description>My understanding of the Lee algorithm is that you first mark cells until the goal is reached, and then walk backwards from the goal to the starting cell.  This approach doesn't quite work with the Akers modification, though I suppose you could just pass in the preceding cells bit pattern during the first pass, or something along those lines.

I don't believe just passing in the depth is sufficient, however.</description>
		<content:encoded><![CDATA[<p>My understanding of the Lee algorithm is that you first mark cells until the goal is reached, and then walk backwards from the goal to the starting cell.  This approach doesn&#8217;t quite work with the Akers modification, though I suppose you could just pass in the preceding cells bit pattern during the first pass, or something along those lines.</p>
<p>I don&#8217;t believe just passing in the depth is sufficient, however.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christer</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2348</link>
		<author>christer</author>
		<pubDate>Sun, 21 Sep 2008 23:04:03 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2348</guid>
		<description>But you know where you are in the sequence! In my example you arrive at the goal cell with a "1" and the preceeding steps were &#8230;, 0, 0, 1.</description>
		<content:encoded><![CDATA[<p>But you know where you are in the sequence! In my example you arrive at the goal cell with a &#8220;1&#8243; and the preceeding steps were &hellip;, 0, 0, 1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SolomonS</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2347</link>
		<author>SolomonS</author>
		<pubDate>Sun, 21 Sep 2008 22:36:11 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2347</guid>
		<description>I'm most likely missing some subtle detail, but my objection wasn't directed towards resolving multiple paths of of equal length.  Without knowing where you are in the sequence, it seems like it's possible to head off in the wrong direction for a couple cells before realizing it.</description>
		<content:encoded><![CDATA[<p>I&#8217;m most likely missing some subtle detail, but my objection wasn&#8217;t directed towards resolving multiple paths of of equal length.  Without knowing where you are in the sequence, it seems like it&#8217;s possible to head off in the wrong direction for a couple cells before realizing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christer</title>
		<link>http://realtimecollisiondetection.net/blog/?p=83#comment-2346</link>
		<author>christer</author>
		<pubDate>Sun, 21 Sep 2008 21:44:54 +0000</pubDate>
		<guid>http://realtimecollisiondetection.net/blog/?p=83#comment-2346</guid>
		<description>In both Lee's algorithm and in Akers' algorithm we have multiple paths that all are of optimal length (above there are 6 possible paths). When there are multiple choices we just pick arbitrarily (or perhaps based on a secondary criteria, such as to avoid path turns when possible).

Both algorithms, as described above, assume a 4-connected neighborhood. If you want to include paths that use diagonal moves then you need to also flood-fill diagonally during the search phase of the algorithm, otherwise you won't necessarily reach the goal from start. Consider e.g. a chess board where all black squares are obstacles and start and goal are at opposite sides of the board on white squares (at A8 and H1); here there exists a path (along the diagonal), but the 4-connected flood-fill cannot number any squares.

Lee's algorithm trivially adjusts to diagonal moves, Akers' might too (haven't thought about it).
</description>
		<content:encoded><![CDATA[<p>In both Lee&#8217;s algorithm and in Akers&#8217; algorithm we have multiple paths that all are of optimal length (above there are 6 possible paths). When there are multiple choices we just pick arbitrarily (or perhaps based on a secondary criteria, such as to avoid path turns when possible).</p>
<p>Both algorithms, as described above, assume a 4-connected neighborhood. If you want to include paths that use diagonal moves then you need to also flood-fill diagonally during the search phase of the algorithm, otherwise you won&#8217;t necessarily reach the goal from start. Consider e.g. a chess board where all black squares are obstacles and start and goal are at opposite sides of the board on white squares (at A8 and H1); here there exists a path (along the diagonal), but the 4-connected flood-fill cannot number any squares.</p>
<p>Lee&#8217;s algorithm trivially adjusts to diagonal moves, Akers&#8217; might too (haven&#8217;t thought about it).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
