<?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[PTR Changelog 2018-01-18: isolated VM]]></title><description><![CDATA[<p><em>This post describes changes on the <a href="http://docs.screeps.com/ptr.html" rel="nofollow">Public Test Realm</a>.  The estimated launch date is March 5.</em></p>
<p>We're happy to introduce a new major feature that may impact your Screeps gameplay in a whole new way: <strong>isolated virtual machine</strong>. We explained this a bit in <a href="http://blog.screeps.com/2017/06/optimizations/" rel="nofollow">this blog post</a> earlier.</p>
<p><strong>TL;DR:</strong></p>
<ul>
<li>
<p>You can opt-in for an isolated VM in the new account settings UI called <a href="https://screeps.com/ptr/#!/account/runtime" rel="nofollow">Runtime</a>. This will move execution of your script to another pool of server nodes with this experimental feature enabled.
<img src="/forum/assets/uploads/files/1516270540229-chrome_2018-01-18_13-15-02.png" alt="0_1516270538209_chrome_2018-01-18_13-15-02.png" class="img-responsive img-markdown" /></p>
</li>
<li>
<p>In isolated VM you have your very own JavaScript environment, including heap memory and garbage collector.</p>
</li>
<li>
<p>Since isolated VMs can be transferred between threads within the same Node.js process, it is no longer neccessary to maintain multiple <code>global</code> instances, you always have one single <code>global</code>.</p>
</li>
<li>
<p>You can use new API method <a href="http://ptr-docs.screeps.com/api/#Game.getHeapStatistics" rel="nofollow">Game.cpu.getHeapStatistics()</a> to know how much heap memory you're using in runtime. Maximum effective limit is 256 MB for each player.</p>
</li>
</ul>
<p>Please note that this feature is still in development and considered
<strong>experimental</strong>. Please report any incorrect behavior and be ready that things will be improved over time.</p>
]]></description><link>http://screeps.com/forum/topic/2073/ptr-changelog-2018-01-18-isolated-vm</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 05:07:49 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/2073.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Jan 2018 10:12:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Thu, 01 Mar 2018 07:25:22 GMT]]></title><description><![CDATA[<p><em>This post describes changes on the <a href="http://docs.screeps.com/ptr.html" rel="nofollow">Public Test Realm</a>.  The estimated launch date is March 5.</em></p>
<p>We're happy to introduce a new major feature that may impact your Screeps gameplay in a whole new way: <strong>isolated virtual machine</strong>. We explained this a bit in <a href="http://blog.screeps.com/2017/06/optimizations/" rel="nofollow">this blog post</a> earlier.</p>
<p><strong>TL;DR:</strong></p>
<ul>
<li>
<p>You can opt-in for an isolated VM in the new account settings UI called <a href="https://screeps.com/ptr/#!/account/runtime" rel="nofollow">Runtime</a>. This will move execution of your script to another pool of server nodes with this experimental feature enabled.
<img src="/forum/assets/uploads/files/1516270540229-chrome_2018-01-18_13-15-02.png" alt="0_1516270538209_chrome_2018-01-18_13-15-02.png" class="img-responsive img-markdown" /></p>
</li>
<li>
<p>In isolated VM you have your very own JavaScript environment, including heap memory and garbage collector.</p>
</li>
<li>
<p>Since isolated VMs can be transferred between threads within the same Node.js process, it is no longer neccessary to maintain multiple <code>global</code> instances, you always have one single <code>global</code>.</p>
</li>
<li>
<p>You can use new API method <a href="http://ptr-docs.screeps.com/api/#Game.getHeapStatistics" rel="nofollow">Game.cpu.getHeapStatistics()</a> to know how much heap memory you're using in runtime. Maximum effective limit is 256 MB for each player.</p>
</li>
</ul>
<p>Please note that this feature is still in development and considered
<strong>experimental</strong>. Please report any incorrect behavior and be ready that things will be improved over time.</p>
]]></description><link>http://screeps.com/forum/post/9304</link><guid isPermaLink="true">http://screeps.com/forum/post/9304</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Thu, 01 Mar 2018 07:25:22 GMT</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Thu, 18 Jan 2018 10:38:12 GMT]]></title><description><![CDATA[<p>Great news, nice to see this implemented.</p>
<p>It seems like you currently need to save your code after switching to isolated mode, in order to force a code reload to the new virtual machine.</p>
<p>I already found a first bug, <code>Game.shard</code> seems to be undefined.</p>
]]></description><link>http://screeps.com/forum/post/9305</link><guid isPermaLink="true">http://screeps.com/forum/post/9305</guid><dc:creator><![CDATA[PostCrafter]]></dc:creator><pubDate>Thu, 18 Jan 2018 10:38:12 GMT</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>I confirm both remarks from <a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/25">@postcrafter</a>.</p>
]]></description><link>http://screeps.com/forum/post/9306</link><guid isPermaLink="true">http://screeps.com/forum/post/9306</guid><dc:creator><![CDATA[Hiryus]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/25">@postcrafter</a></p>
<blockquote>
<p>It seems like you currently need to save your code after switching to isolated mode, in order to force a code reload to the new virtual machine.</p>
</blockquote>
<p>It should not be related. Are you sure it's not just coincidence?</p>
<blockquote>
<p>I already found a first bug, <code>Game.shard</code> seems to be undefined.</p>
</blockquote>
<p>Fixed, thanks.</p>
]]></description><link>http://screeps.com/forum/post/9307</link><guid isPermaLink="true">http://screeps.com/forum/post/9307</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>So since we have now our own environment that means in theory parsing &quot;the memory&quot; is now obsolete and we are able to keep objects in it?
Or is there still a chance that the entire environment gets a reset?</p>
]]></description><link>http://screeps.com/forum/post/9308</link><guid isPermaLink="true">http://screeps.com/forum/post/9308</guid><dc:creator><![CDATA[MrFaul]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/85">@mrfaul</a> the global still behaves like it did before, it can reset at any point. So think of it like ephemeral storage, it can be used, but don't solely rely on it for permanent data.</p>
]]></description><link>http://screeps.com/forum/post/9309</link><guid isPermaLink="true">http://screeps.com/forum/post/9309</guid><dc:creator><![CDATA[ags131]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>Hm makes sense. But it would allow to keep map data around for much longer without the need to decode it every time from storage so yay <img
      src="http://screeps.com/forum/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=a1k070tfs06"
      class="not-responsive emoji emoji-android emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
]]></description><link>http://screeps.com/forum/post/9310</link><guid isPermaLink="true">http://screeps.com/forum/post/9310</guid><dc:creator><![CDATA[MrFaul]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>PTR seems to be extremely slow to reload code? Something in my code was causing timeout errors, so I cutting out bigger and bigger chunks of code, sometimes it was running, most of the time I had timeouts and very often ticks would simply stop for extended time.</p>
<pre><code class="language-text">Script execution timed out ungracefully, restarting virtual machine
</code></pre>
<p>Now I'm down to this and there are no ticks at all:</p>
<pre><code>/* eslint-disable */
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

function loop() {
    console.log(&quot;running&quot;);
}

exports.loop = loop;
//# sourceMappingURL=main.js.map
</code></pre>
]]></description><link>http://screeps.com/forum/post/9313</link><guid isPermaLink="true">http://screeps.com/forum/post/9313</guid><dc:creator><![CDATA[UnFleshedOne]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>that's great news !</p>
<p>I'm sad to report that I'm unable to use it on PTR. With an empty main loop, no other files and empty Memory, it's still returning <code>[3:56:35 AM][shard0]Script execution timed out ungracefully, restarting virtual machine</code>.</p>
]]></description><link>http://screeps.com/forum/post/9314</link><guid isPermaLink="true">http://screeps.com/forum/post/9314</guid><dc:creator><![CDATA[vrs]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>There is a critical error in isolated-vm integration, ticks are stopped currently. We're working on it.</p>
]]></description><link>http://screeps.com/forum/post/9316</link><guid isPermaLink="true">http://screeps.com/forum/post/9316</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Fri, 19 Jan 2018 10:37:12 GMT]]></title><description><![CDATA[<p>Server is restarted. There is a memory leak somewhere, we're trying to track it down, but it may break a few times again.</p>
]]></description><link>http://screeps.com/forum/post/9317</link><guid isPermaLink="true">http://screeps.com/forum/post/9317</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Fri, 19 Jan 2018 10:37:12 GMT</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>Ok, got it running now.</p>
<p>minor nitpick, in the UI, the top right CPU/Memory might have some rounding issue. I'm seeing values like these: 60.799999999999955 / 290</p>
]]></description><link>http://screeps.com/forum/post/9318</link><guid isPermaLink="true">http://screeps.com/forum/post/9318</guid><dc:creator><![CDATA[vrs]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>getting this one occasionally:</p>
<p><code>[10:25:09 PM][shard0]RangeError: Array buffer allocation failed at new ArrayBuffer (&lt;anonymous&gt;) at typedArrayConstructByLength (&lt;anonymous&gt;) at new Float64Array (native) at new Heap (__runtime__:33218:27) at Object.findRoute (__runtime__:33024:13) at Object.findExit (__runtime__:33114:30) at Object.findExitTo (__runtime__:14667:29) at Object.findPathTo (__runtime__:14831:32) at Object.moveTo (__runtime__:36365:29)</code></p>
]]></description><link>http://screeps.com/forum/post/9320</link><guid isPermaLink="true">http://screeps.com/forum/post/9320</guid><dc:creator><![CDATA[vrs]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/17">@ags131</a> said in <a href="/forum/post/9309">PTR Changelog 2018-01-18: isolated VM</a>:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/85">@mrfaul</a> the global still behaves like it did before, it can reset at any point. So think of it like ephemeral storage, it can be used, but don't solely rely on it for permanent data.</p>
</blockquote>
<p>I think it would be nice if the whole memory was automatically cached to global in this case. You'd pay for the stringify at the end of the tick every time, but the parse should only be on a reset. If there's one global instance and this &quot;just works&quot; I think it should be in the backend rather than user-implemented.</p>
]]></description><link>http://screeps.com/forum/post/9326</link><guid isPermaLink="true">http://screeps.com/forum/post/9326</guid><dc:creator><![CDATA[Tigga]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/138">@tigga</a> This is a nice idea, we'll look into what we can do.</p>
]]></description><link>http://screeps.com/forum/post/9327</link><guid isPermaLink="true">http://screeps.com/forum/post/9327</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Sat, 20 Jan 2018 15:51:50 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/138">@tigga</a> you can already do that:</p>
<pre><code>let memory: any;
let lastTime: number = 0;

export function load_memory() {

  // const start = Game.cpu.getUsed();
  if (lastTime &amp;&amp; memory &amp;&amp; Game.time === (lastTime + 1)) {
    delete global.Memory;
    global.Memory = memory;
    RawMemory._parsed = memory;
    // console.log(&quot;Tick has same GID!&quot;);
  } else {
    // noinspection TsLint
    Memory.rooms;
    memory = RawMemory._parsed;
  }
  lastTime = Game.time;
  // const end = Game.cpu.getUsed();
  // console.log(&quot;memory loaded&quot;, lastTime, end - start);
}
</code></pre>
<p>this snippet is from slack, not sure who posted it ,)
this also will work on the live server, when 2 ticks run on the same server, which happens quite often.</p>
]]></description><link>http://screeps.com/forum/post/9328</link><guid isPermaLink="true">http://screeps.com/forum/post/9328</guid><dc:creator><![CDATA[W4rl0ck]]></dc:creator><pubDate>Sat, 20 Jan 2018 15:51:50 GMT</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/10">@w4rl0ck</a> I'd seen that before and my post reminded me of it as well! I actually implemented it today (with some help from <a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/25">@PostCrafter</a>). IIUC it's a bit hacky because _parsed isn't part of the spec.</p>
]]></description><link>http://screeps.com/forum/post/9330</link><guid isPermaLink="true">http://screeps.com/forum/post/9330</guid><dc:creator><![CDATA[Tigga]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p>PTR seems to be running really slowly right now, which is making testing harder.</p>
]]></description><link>http://screeps.com/forum/post/9331</link><guid isPermaLink="true">http://screeps.com/forum/post/9331</guid><dc:creator><![CDATA[tedivm]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><strong>Native <code>PathFinder</code> is now enabled in isolated-vm server nodes.</strong></p>
]]></description><link>http://screeps.com/forum/post/9346</link><guid isPermaLink="true">http://screeps.com/forum/post/9346</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><code>PathFinder</code> seems to be fine, but there are relatively rare errors, see below:</p>
<details><summary>Spoiler:</summary>
<pre><code>RangeError: Array buffer allocation failed
    at new ArrayBuffer ()
    at typedArrayConstructByLength ()
    at new Float64Array (native)
    at new Heap (:33344:27)
    // ======= ^ Screeps space
    at Object.findRoute (:33150:13)
    at Object.Creep.moveTo2 (__prototypes:1130:34)
    at Role.work (scout:179:27)
    at legacy_loop (main:1328:60)
    at LEGACY.run (main:1425:9)
    at Kernel:44:77
    // ======= ^ userspace
</code></pre>
<p>and</p>
<pre><code>RangeError: Array buffer allocation failed
    at new ArrayBuffer ()
    at typedArrayConstructByLength ()
    at new Uint8Array (native)
    at new  (:39248:22)
    // ======= ^ Screeps space
    at staticRoomCallback (__prototypes:356:21)
    at global.civilRoomCallback (__prototypes:421:21)
    at roomCallback (__prototypes:1151:24)
    at :33018:31
    at Object.exports.search (:33030:19)
    at Object.search (:39286:38)
    // ======= ^ userspace
</code></pre>
</details>
<p>Moreover, sometimes <code>V8 heap overflow</code> errors appear unexpectedly, cannot track them for now.</p>
]]></description><link>http://screeps.com/forum/post/9354</link><guid isPermaLink="true">http://screeps.com/forum/post/9354</guid><dc:creator><![CDATA[Mototroller]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/43">@mototroller</a> You seem to exceed your heap memory quota, and game engine is no longer able to allocate some space for its needs.</p>
]]></description><link>http://screeps.com/forum/post/9360</link><guid isPermaLink="true">http://screeps.com/forum/post/9360</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Wed, 24 Jan 2018 09:42:14 GMT]]></title><description><![CDATA[<p>Will we get isolated-vm support for private servers as well?</p>
<p>I had the idea of giving bot creators a tool to create a binary of their bot's isolate snapshot that can be shared without publishing the source code.
Currently bot publisher are trying to not publish a lot of offensive code, because it's going to be used on the official server, which in turn is hindering the experience of newer players.
If this idea were to be implemented they could hold back parts of their code just like they do now, but publish the entire bot including military.</p>
<p>Actually implementing the upload and use of a binary snapshot can be taken care of by a mod, I'm just interested in whether we will get full isolated-vm support.</p>
]]></description><link>http://screeps.com/forum/post/9367</link><guid isPermaLink="true">http://screeps.com/forum/post/9367</guid><dc:creator><![CDATA[PostCrafter]]></dc:creator><pubDate>Wed, 24 Jan 2018 09:42:14 GMT</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/25">@postcrafter</a> We'll port it to private server <code>driver</code> once its implementation is finalized enough. <code>isolated-vm</code> library still doesn't have all features enabled on Windows, for example.</p>
<p>Bot snapshots is an interesting idea, but could be a bit tricky, since snapshots are architecture-dependent.</p>
]]></description><link>http://screeps.com/forum/post/9368</link><guid isPermaLink="true">http://screeps.com/forum/post/9368</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><strong><code>Game.cpu.getUsed</code> method now works with nanoseconds precision like the non-ivm version.</strong></p>
]]></description><link>http://screeps.com/forum/post/9471</link><guid isPermaLink="true">http://screeps.com/forum/post/9471</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Fri, 02 Mar 2018 07:55:06 GMT]]></title><description><![CDATA[<p><strong>isolated-vm is now available in private servers!</strong></p>
<p>In order to switch your server to this experimental functionality, use <code>beta</code> prerelease tag:</p>
<pre><code class="language-bash">npm install screeps@beta
</code></pre>
<p>Please note that some mods may become non-functional since <code>playerSandbox</code> event is not implemented yet.</p>
<p>It is recommended to set <code>runners_cnt</code> to 1 in your <code>.screepsrc</code> file, since otherwise it will create multiple global environments for each player. There is a new option <code>runner_threads</code> instead which should be set to the number of your CPU cores.</p>
]]></description><link>http://screeps.com/forum/post/9659</link><guid isPermaLink="true">http://screeps.com/forum/post/9659</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Fri, 02 Mar 2018 07:55:06 GMT</pubDate></item><item><title><![CDATA[Reply to PTR Changelog 2018-01-18: isolated VM on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/3">@artch</a> <code>Game.shard.name</code> is not defined in the current beta</p>
]]></description><link>http://screeps.com/forum/post/9675</link><guid isPermaLink="true">http://screeps.com/forum/post/9675</guid><dc:creator><![CDATA[W4rl0ck]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>