<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Pathfinder cannot find path within one room]]></title><description><![CDATA[<p>Recently I've found some of my creeps unable to reach their targets using <code>moveTo</code>.
So I've tried to reproduce at <strong>shard2</strong>:</p>
<p><code>JSON.stringify(new RoomPosition(42,19,'E51S18').findPathTo(new RoomPosition(34,12,'E51S18')))</code>
returns: <code>[{&quot;x&quot;:41,&quot;y&quot;:20,&quot;dx&quot;:-1,&quot;dy&quot;:1,&quot;direction&quot;:6}]</code>
another time it returns: <code>[{&quot;x&quot;:41,&quot;y&quot;:20,&quot;dx&quot;:-1,&quot;dy&quot;:1,&quot;direction&quot;:6},{&quot;x&quot;:34,&quot;y&quot;:12,&quot;dx&quot;:-7,&quot;dy&quot;:-8,&quot;direction&quot;:8}]</code></p>
<p>Obviously an unexpected result.</p>
<p>Or this one: <code>JSON.stringify(new RoomPosition(1,44,'E54S19').findPathTo(new RoomPosition(4,11,'E54S19')))</code>
returns
<code>[{&quot;x&quot;:0,&quot;y&quot;:43,&quot;dx&quot;:-1,&quot;dy&quot;:-1,&quot;direction&quot;:8}]</code></p>
<p>Maybe someone has a look?</p>
<p>(Edited: Nothing passed a wall, but the paths are incomplete)</p>
]]></description><link>http://screeps.com/forum/topic/2853/pathfinder-cannot-find-path-within-one-room</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 00:18:19 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/2853.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 Oct 2019 22:56:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Thu, 31 Oct 2019 09:37:12 GMT]]></title><description><![CDATA[<p>Recently I've found some of my creeps unable to reach their targets using <code>moveTo</code>.
So I've tried to reproduce at <strong>shard2</strong>:</p>
<p><code>JSON.stringify(new RoomPosition(42,19,'E51S18').findPathTo(new RoomPosition(34,12,'E51S18')))</code>
returns: <code>[{&quot;x&quot;:41,&quot;y&quot;:20,&quot;dx&quot;:-1,&quot;dy&quot;:1,&quot;direction&quot;:6}]</code>
another time it returns: <code>[{&quot;x&quot;:41,&quot;y&quot;:20,&quot;dx&quot;:-1,&quot;dy&quot;:1,&quot;direction&quot;:6},{&quot;x&quot;:34,&quot;y&quot;:12,&quot;dx&quot;:-7,&quot;dy&quot;:-8,&quot;direction&quot;:8}]</code></p>
<p>Obviously an unexpected result.</p>
<p>Or this one: <code>JSON.stringify(new RoomPosition(1,44,'E54S19').findPathTo(new RoomPosition(4,11,'E54S19')))</code>
returns
<code>[{&quot;x&quot;:0,&quot;y&quot;:43,&quot;dx&quot;:-1,&quot;dy&quot;:-1,&quot;direction&quot;:8}]</code></p>
<p>Maybe someone has a look?</p>
<p>(Edited: Nothing passed a wall, but the paths are incomplete)</p>
]]></description><link>http://screeps.com/forum/post/14410</link><guid isPermaLink="true">http://screeps.com/forum/post/14410</guid><dc:creator><![CDATA[Xenofix]]></dc:creator><pubDate>Thu, 31 Oct 2019 09:37:12 GMT</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Wed, 30 Oct 2019 23:23:47 GMT]]></title><description><![CDATA[<p>Which is the wall it passes through in E54S18?</p>
<p>The E51S18 looks like it's just an issue with ops - it's a complicated room and moveTo with default options will sometimes fail. That's because the pathfinder has a default maximum operations of 2000. You can override this by passing maxOpts in the options arguement.</p>
<p>EDIT: Same with the E54S19 one. The default arguments will do fine for most rooms, but anything requiring a lot of twists and turns or going back on yourself tends to be more expensive and will hit the ops limit sooner.</p>
]]></description><link>http://screeps.com/forum/post/14411</link><guid isPermaLink="true">http://screeps.com/forum/post/14411</guid><dc:creator><![CDATA[Tigga]]></dc:creator><pubDate>Wed, 30 Oct 2019 23:23:47 GMT</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p>Thanks Tigga. That's really interesting. It shouldn't fail like this, should it?
I guess my problem is solved.</p>
<p>However the problem is still there for other players: I believe that it should always be possible to find a path inside of one room without any extra options. Most newbies rely on it. Maybe someone increases the default maxOps?</p>
]]></description><link>http://screeps.com/forum/post/14412</link><guid isPermaLink="true">http://screeps.com/forum/post/14412</guid><dc:creator><![CDATA[Xenofix]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Thu, 31 Oct 2019 00:09:40 GMT]]></title><description><![CDATA[<p>Another problem:
<code>JSON.stringify(new RoomPosition(18,49,'E54S19').findPathTo(new RoomPosition(0,44,'E54S19'),{maxOps:100000}))</code> returns <code>[]</code> every second tick and a path every other second tick. It seems to depend on <a href="https://screeps.com/a/#!/history/shard2/E54S19?t=20105689" rel="nofollow">https://screeps.com/a/#!/history/shard2/E54S19?t=20105689</a>  Every time when the creep at 18,49 is in the room, that expression returns <code>[]</code> (tested in the console).
The result is, that the creep doesn't move at all.</p>
<p>Detail: The creep calls <code>moveTo</code> with the pathOptions: <code>{ visualizePathStyle: { stroke: '#ff0000' }, ignoreCreeps: false, reusePath: 0, maxOps: 100000 }</code></p>
]]></description><link>http://screeps.com/forum/post/14413</link><guid isPermaLink="true">http://screeps.com/forum/post/14413</guid><dc:creator><![CDATA[Xenofix]]></dc:creator><pubDate>Thu, 31 Oct 2019 00:09:40 GMT</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/132">@xenofix</a> said in <a href="/forum/post/14412">Broken Pathfinder</a>:</p>
<blockquote>
<p>Thanks Tigga. That's really interesting. It shouldn't fail like this, should it?
I guess my problem is solved.</p>
<p>However the problem is still there for other players: I believe that it should always be possible to find a path inside of one room without any extra options. Most newbies rely on it. Maybe someone increases the default maxOps?</p>
</blockquote>
<p>The other thing you can do if you're sure there is a path within a room is to set <code>maxRooms</code> to 1. That constrains the pathfinder somewhat and will prevent it exploring into other rooms.</p>
<p>As for defaults - it's not easy. What if there is no path? How long should it carry on searching until it can prove there is no path? Often incomplete paths will actually do a pretty good job. Increasing maxOpts will likely have an impact on CPU, and will increase the cost of every impossible or surprisingly long path.</p>
<p>IMO there comes a point where every Screeps player has issues with pathfinding, and has to dig in and figure out how they want to solve it. There's plenty of other issues that you'll bump into with <code>moveTo</code> as you keep going. Fortunately the game provides a lot of options for interacting with pathfinding - via options, via cost matrices and via direct access to <code>Pathfinder.search</code>. Many people have thousands of lines of code dedicated to going from one place to another, and still have issues from time to time. Getting it right is part of playing the game and things like <code>moveTo</code> are really just to get you started IMO.</p>
]]></description><link>http://screeps.com/forum/post/14414</link><guid isPermaLink="true">http://screeps.com/forum/post/14414</guid><dc:creator><![CDATA[Tigga]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p>Feels like someone should write a detailed article about A* guts someday and explain the decisions behind default values. With gifs/pics and everything...</p>
<p>But generally yes, <a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/138">@Tigga</a> is right: pathfinding is a separate discipline of playing Screeps. Players are given the way of moving creeps which works good enough in most cases. But sometimes it happens that you must choose between pathing errors (which players can see) and stupidly high CPU consumption out of blue (which is much harder to find). Choosing the second would be... unwise.</p>
]]></description><link>http://screeps.com/forum/post/14422</link><guid isPermaLink="true">http://screeps.com/forum/post/14422</guid><dc:creator><![CDATA[o4kapuk]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p>There are awesome detailed articles by <a href="https://www.redblobgames.com/" rel="nofollow">Red Blob Games</a>:</p>
<ul>
<li><a href="http://theory.stanford.edu/~amitp/GameProgramming/index.html" rel="nofollow">http://theory.stanford.edu/~amitp/GameProgramming/index.html</a></li>
<li><a href="https://www.redblobgames.com/pathfinding/a-star/introduction.html" rel="nofollow">https://www.redblobgames.com/pathfinding/a-star/introduction.html</a></li>
</ul>
<p>They are really helpful for understanding A*, tuning in-game PF and even implementing you own path-finding. Actually, built-in PF is pretty nice, but its parameters should be chosen carefully.</p>
]]></description><link>http://screeps.com/forum/post/14426</link><guid isPermaLink="true">http://screeps.com/forum/post/14426</guid><dc:creator><![CDATA[Mototroller]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p>We still need a <code>PathFinder.search</code> specific write up.</p>
<p>Some tidbits I've encountered over time:</p>
<ul>
<li>It's not really A*, but jump point search.
<ul>
<li>what does that mean? I don't know, but I blame it every time it has unexpected behavior</li>
</ul>
</li>
<li>The default heuristic of 1.2 finds non-optimal paths
<ul>
<li>1 guarantees optimal but costs 50% more cpu.</li>
</ul>
</li>
<li>Heuristic values above 10 or so screw with the algorithm and searches cost a lot more ops (though not a lot more CPU).</li>
<li>It will never produce a path that moves laterally on an exit tile
<ul>
<li>this is works well with exit tile teleportation</li>
<li>this interacts badly if you're movement constrained and on an exit tile. E.g you try to path a few tiles laterally will consume all ops and still produce an incomplete path.</li>
</ul>
</li>
</ul>
]]></description><link>http://screeps.com/forum/post/14430</link><guid isPermaLink="true">http://screeps.com/forum/post/14430</guid><dc:creator><![CDATA[deft-code]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Tue, 05 Nov 2019 14:55:47 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/49">@deft-code</a> yes we do, to remove some misunderstandings at least, for example:</p>
<ul>
<li>It's not jump point search because <a href="https://en.wikipedia.org/wiki/Jump_point_search" rel="nofollow">JPS is exclusively for uniform-cost grids</a> (as far as I know; if you know an article or something which proves otherwise, please post the link). So it's not really A* but not really JPS either.</li>
<li>The default heuristic is 1 which finds optimal paths</li>
</ul>
]]></description><link>http://screeps.com/forum/post/14459</link><guid isPermaLink="true">http://screeps.com/forum/post/14459</guid><dc:creator><![CDATA[o4kapuk]]></dc:creator><pubDate>Tue, 05 Nov 2019 14:55:47 GMT</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/183">@o4kapuk</a>, You're correct. JPS is only for uniform cost grids and is fairly well researched. I've never found a paper about our odd A*/JPS combo.</p>
<p>Was the documentation incorrect or did you change the default <code>heuristicWeight</code> to 1?</p>
<p>While looking for original Heurisitic weight I figured out why <code>heuristicWeight</code>  values above 10 act funny. They're capped at 9 in the code. We should update the documentation. (Or remove the cap if it isn't needed).</p>
]]></description><link>http://screeps.com/forum/post/14463</link><guid isPermaLink="true">http://screeps.com/forum/post/14463</guid><dc:creator><![CDATA[deft-code]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/49">@deft-code</a> The documentation was incorrect, now it's fixed.</p>
]]></description><link>http://screeps.com/forum/post/14464</link><guid isPermaLink="true">http://screeps.com/forum/post/14464</guid><dc:creator><![CDATA[o4kapuk]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p>If you want to get some insights into the Screeps native PathFinder, the best way is to ask its author <a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/576">@The_General</a>.</p>
]]></description><link>http://screeps.com/forum/post/14466</link><guid isPermaLink="true">http://screeps.com/forum/post/14466</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p>Luckily I know A* very well. But I always thought there are two implementations in screeps. One PathFinder written in C++ by General and a JS JPS version, which is the default in <code>moveTo</code>. The C++ PathFinder could be activated as default for moveTo by <code>PathFinder.use(true)</code>, which is deprecated now. Did something change here? Is JPS still the default path finder or is it all <code>PathFinder</code> only now?</p>
]]></description><link>http://screeps.com/forum/post/14470</link><guid isPermaLink="true">http://screeps.com/forum/post/14470</guid><dc:creator><![CDATA[Xenofix]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/132">@xenofix</a> said in <a href="/forum/post/14470">Pathfinder cannot find path within one room</a>:</p>
<blockquote>
<p>Luckily I know A* very well. But I always thought there are two implementations in screeps. One PathFinder written in C++ by General and a JS JPS version, which is the default in <code>moveTo</code>. The C++ PathFinder could be activated as default for moveTo by <code>PathFinder.use(true)</code>, which is deprecated now. Did something change here? Is JPS still the default path finder or is it all <code>PathFinder</code> only now?</p>
</blockquote>
<p>It's been the <code>PathFinder</code> by default for everything for a few years now.</p>
]]></description><link>http://screeps.com/forum/post/14472</link><guid isPermaLink="true">http://screeps.com/forum/post/14472</guid><dc:creator><![CDATA[Orlet]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Pathfinder cannot find path within one room on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/132">@xenofix</a> Native PathFinder is JPS too, and it is activated by default unless you call <code>PathFinder.use(false)</code>.</p>
]]></description><link>http://screeps.com/forum/post/14474</link><guid isPermaLink="true">http://screeps.com/forum/post/14474</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>