<?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[Inconsistent isActive() checks (re-claimed rooms)]]></title><description><![CDATA[<p>Hey, I found a bug.  Seems like there's inconsistency in several areas of the code. I believe it has to do with this latest patch:</p>
<p><a href="https://github.com/screeps/engine/commit/91c9bf03a13743d3837b082f26b0a7689021237d" rel="nofollow noreferrer">https://github.com/screeps/engine/commit/91c9bf03a13743d3837b082f26b0a7689021237d</a></p>
<p> </p>
<p>To sum it up - Active structures are determined by range to the controller. But ties aren't broken consistently.  Extensions (and other structures probably) in re-claimed rooms are messed up.  I'm getting 4 different sets of information.</p>
<p>1. Visual - Some extensions look normal, some are red (duh).</p>
<p>2. Structure.isActive() - One of the red extensions returns TRUE. One of the normal extensions returns FALSE.</p>
<p>3. Room.energyAvailable - The number agrees with what I see visually (not from isActive() )</p>
<p>4. Spawn.createCreep() - This will pull energy from extensions that are visually (#1) marked as active, rather than checking isActive().</p>
<p> </p>
<p>What causes the issue?</p>
<p>I think isActive() is based on range to the controller. Ties aren't resolved consistently.</p>
<p> </p>
<p>Why is this an issue? </p>
<p>When I'm re-claiming a room, I inherit the extensions. To keep my extension fillers focused, I filter the extensions based in isActive().... So yeah, the room never fills up, and my spawn process gets choked up.</p>
<p> </p>
<p>How'd I resolve it?</p>
<p>Well, on my end - I kept deleting extensions until the problematic extensions were on a path frequented often, so they got filled up in passing.  Not totally ideal.</p>
<p> </p>
<p>Thanks! Hopefully someone better at this than me can take a look!</p>
<p>Dewey</p>
<p> </p>
<p>p.s. I started deleting extensions soon after this: <a href="https://screeps.com/a/#!/history/W59N46?t=19734400" rel="nofollow noreferrer">https://screeps.com/a/#!/history/W59N46?t=19734400</a></p>
<p><br>Currently marked normal, but isActive() == false: 5927f47427ccaf9c36aae085</p>
<p>Currently marked red,but isActive() == true: 5925da43966ccf98054823e9</p>]]></description><link>http://screeps.com/forum/topic/83/inconsistent-isactive-checks-re-claimed-rooms</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Mar 2026 00:23:24 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/83.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Jun 2017 01:52:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inconsistent isActive() checks (re-claimed rooms) on Invalid Date]]></title><description><![CDATA[<p>Hey, I found a bug.  Seems like there's inconsistency in several areas of the code. I believe it has to do with this latest patch:</p>
<p><a href="https://github.com/screeps/engine/commit/91c9bf03a13743d3837b082f26b0a7689021237d" rel="nofollow noreferrer">https://github.com/screeps/engine/commit/91c9bf03a13743d3837b082f26b0a7689021237d</a></p>
<p> </p>
<p>To sum it up - Active structures are determined by range to the controller. But ties aren't broken consistently.  Extensions (and other structures probably) in re-claimed rooms are messed up.  I'm getting 4 different sets of information.</p>
<p>1. Visual - Some extensions look normal, some are red (duh).</p>
<p>2. Structure.isActive() - One of the red extensions returns TRUE. One of the normal extensions returns FALSE.</p>
<p>3. Room.energyAvailable - The number agrees with what I see visually (not from isActive() )</p>
<p>4. Spawn.createCreep() - This will pull energy from extensions that are visually (#1) marked as active, rather than checking isActive().</p>
<p> </p>
<p>What causes the issue?</p>
<p>I think isActive() is based on range to the controller. Ties aren't resolved consistently.</p>
<p> </p>
<p>Why is this an issue? </p>
<p>When I'm re-claiming a room, I inherit the extensions. To keep my extension fillers focused, I filter the extensions based in isActive().... So yeah, the room never fills up, and my spawn process gets choked up.</p>
<p> </p>
<p>How'd I resolve it?</p>
<p>Well, on my end - I kept deleting extensions until the problematic extensions were on a path frequented often, so they got filled up in passing.  Not totally ideal.</p>
<p> </p>
<p>Thanks! Hopefully someone better at this than me can take a look!</p>
<p>Dewey</p>
<p> </p>
<p>p.s. I started deleting extensions soon after this: <a href="https://screeps.com/a/#!/history/W59N46?t=19734400" rel="nofollow noreferrer">https://screeps.com/a/#!/history/W59N46?t=19734400</a></p>
<p><br>Currently marked normal, but isActive() == false: 5927f47427ccaf9c36aae085</p>
<p>Currently marked red,but isActive() == true: 5925da43966ccf98054823e9</p>]]></description><link>http://screeps.com/forum/post/434</link><guid isPermaLink="true">http://screeps.com/forum/post/434</guid><dc:creator><![CDATA[Dewey]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>