<?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[Understanding the result of Room.serializePath()]]></title><description><![CDATA[<p>Hello,
So I finally decided to write my own path algorithm for the creeps, but I am having trouble understanding what does Room.serializePath return.
I understand that it should return the following value format XXYYDDDDDDDDDD... But in my case XX and YY look like some random point around the start position.</p>
<p>E.g.
Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 24, &quot;E33N45&quot;)))
25241 //Go TOP</p>
<p>Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 23, &quot;E33N45&quot;)))
242482 //Go TOP-LEFT TOP-RIGHT</p>
<p>Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 22, &quot;E33N45&quot;)))
2524111 //GO TOP TOP TOP</p>
<p>Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 21, &quot;E33N45&quot;)))
24248112 //GO LEFT-RIGHT TOP TOP TOP-RIGHT</p>
<p>I understand the DDDDDDD values, but I expected XXYY to be the start location, but it is not. Am I missing something obvious here?
Note: the path in my example is formed of plain terrain.</p>
]]></description><link>http://screeps.com/forum/topic/2546/understanding-the-result-of-room-serializepath</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 03:50:27 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/2546.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Feb 2019 16:53:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Understanding the result of Room.serializePath() on Invalid Date]]></title><description><![CDATA[<p>Hello,
So I finally decided to write my own path algorithm for the creeps, but I am having trouble understanding what does Room.serializePath return.
I understand that it should return the following value format XXYYDDDDDDDDDD... But in my case XX and YY look like some random point around the start position.</p>
<p>E.g.
Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 24, &quot;E33N45&quot;)))
25241 //Go TOP</p>
<p>Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 23, &quot;E33N45&quot;)))
242482 //Go TOP-LEFT TOP-RIGHT</p>
<p>Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 22, &quot;E33N45&quot;)))
2524111 //GO TOP TOP TOP</p>
<p>Room.serializePath(new RoomPosition(25, 25, &quot;E33N45&quot;).findPathTo(new RoomPosition(25, 21, &quot;E33N45&quot;)))
24248112 //GO LEFT-RIGHT TOP TOP TOP-RIGHT</p>
<p>I understand the DDDDDDD values, but I expected XXYY to be the start location, but it is not. Am I missing something obvious here?
Note: the path in my example is formed of plain terrain.</p>
]]></description><link>http://screeps.com/forum/post/12807</link><guid isPermaLink="true">http://screeps.com/forum/post/12807</guid><dc:creator><![CDATA[Raul]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Understanding the result of Room.serializePath() on Invalid Date]]></title><description><![CDATA[<p>Why do you need to work with the raw string? You should be able to get your original path back using <code>Room.deserializePath()</code> and get the information from that.</p>
]]></description><link>http://screeps.com/forum/post/12808</link><guid isPermaLink="true">http://screeps.com/forum/post/12808</guid><dc:creator><![CDATA[JBYoshi]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Understanding the result of Room.serializePath() on Sun, 10 Feb 2019 23:59:58 GMT]]></title><description><![CDATA[<p>You always can look into game engine: <a href="https://github.com/screeps/engine/blob/8928228bae60db78c50a7382cc3490c611b03f26/src/utils.js#L981" rel="nofollow">https://github.com/screeps/engine/blob/8928228bae60db78c50a7382cc3490c611b03f26/src/utils.js#L981</a></p>
<p>Looks like first four characters is first position in path and then list of directions to the next position.</p>
]]></description><link>http://screeps.com/forum/post/12809</link><guid isPermaLink="true">http://screeps.com/forum/post/12809</guid><dc:creator><![CDATA[Flyasd1]]></dc:creator><pubDate>Sun, 10 Feb 2019 23:59:58 GMT</pubDate></item><item><title><![CDATA[Reply to Understanding the result of Room.serializePath() on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/1701">@jbyoshi</a> Yes, that's true, In the end I realised that I don't need to work with the raw data. I was just confused when i looked at it and thought i need to fully understand it if I want to make use of it.</p>
]]></description><link>http://screeps.com/forum/post/12841</link><guid isPermaLink="true">http://screeps.com/forum/post/12841</guid><dc:creator><![CDATA[Raul]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Understanding the result of Room.serializePath() on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/1890">@flyasd1</a> That's great! It is now so obvious when i look at it, don't know why i didn't realised the output. Thanks for letting me know about the engine code, I wasn't aware you can view it, still learning.</p>
]]></description><link>http://screeps.com/forum/post/12843</link><guid isPermaLink="true">http://screeps.com/forum/post/12843</guid><dc:creator><![CDATA[Raul]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Understanding the result of Room.serializePath() on Invalid Date]]></title><description><![CDATA[<p>The <code>XXYY</code> are the first tile in the path, rather than the starting point. So, basically, the right next time in the <code>D</code> direction from starting point.</p>
]]></description><link>http://screeps.com/forum/post/12847</link><guid isPermaLink="true">http://screeps.com/forum/post/12847</guid><dc:creator><![CDATA[Orlet]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>