<?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[Module initialization code not running every tick]]></title><description><![CDATA[<p>I have a module that requires code to run every tick. I attempt to do this by constructing a new object, placing this code in the constructor and passing that as the export of the module, but the code is only running once every 8 or so ticks. This code should be running every tick.</p>]]></description><link>http://screeps.com/forum/topic/191/module-initialization-code-not-running-every-tick</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 04:38:29 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/191.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Mar 2017 22:28:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Module initialization code not running every tick on Invalid Date]]></title><description><![CDATA[<p>I have a module that requires code to run every tick. I attempt to do this by constructing a new object, placing this code in the constructor and passing that as the export of the module, but the code is only running once every 8 or so ticks. This code should be running every tick.</p>]]></description><link>http://screeps.com/forum/post/935</link><guid isPermaLink="true">http://screeps.com/forum/post/935</guid><dc:creator><![CDATA[Crusher48]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Module initialization code not running every tick on Invalid Date]]></title><description><![CDATA[<p>Read up on this - <a href="http://support.screeps.com/hc/en-us/articles/204825672-New-main-loop-architecture" rel="nofollow noreferrer">http://support.screeps.com/hc/en-us/articles/204825672-New-main-loop-architecture</a></p>
<p>And this - <a href="http://support.screeps.com/hc/en-us/articles/203032752-Understanding-game-loop-time-and-ticks" rel="nofollow noreferrer">http://support.screeps.com/hc/en-us/articles/203032752-Understanding-game-loop-time-and-ticks</a></p>]]></description><link>http://screeps.com/forum/post/936</link><guid isPermaLink="true">http://screeps.com/forum/post/936</guid><dc:creator><![CDATA[tedivm]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Module initialization code not running every tick on Invalid Date]]></title><description><![CDATA[<p>specially if your using the constructor of an exported module it will only "construct" when the module constructs which is infrequently. It should be happening once every 30 ticks or maybe even less. </p>
<p>I would have to see the code to be sure, but generally, a good pattern for screeps is to have a tick() function and do your setup there, leave module level constructors for free temporary volatile memory, and config settings.</p>]]></description><link>http://screeps.com/forum/post/937</link><guid isPermaLink="true">http://screeps.com/forum/post/937</guid><dc:creator><![CDATA[coteyr]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>