Difference between revisions of "Vision"

From Screeps Wiki
Jump to navigation Jump to search
(Created page with "Category:Vision While there is no 'fog of war' in screeps as the user can see all rooms at all times using the client/browser, your code can not. Having vision on a ro...")
 
Line 13: Line 13:
 
== Observers ==
 
== Observers ==
   
The [[StructureObserver|observer]] that can be built in a room at [[RCL|RCL]] eight, can grant vision to a distant room up to ten rooms away by default, or up to unlimited on [[Shard|shard]] range using a [[powerCreep|powerCreep's power]]. The vision will only be available for the next game [[Tick|tick]] after calling <code>observeRoom()</code> and, will need to be constantly applied if continual vision is required.
+
The [https://docs.screeps.com/api/#StructureObserver observer] that can be built in a room at [[RCL|RCL]] eight, can grant vision to a distant room up to ten rooms away by default, or up to unlimited on [[Shard|shard]] range using a [[powerCreep|powerCreep's power]]. The vision will only be available for the next game [[Tick|tick]] after calling <code>observeRoom()</code> and, will need to be constantly applied if continual vision is required.

Revision as of 20:18, 25 October 2020


While there is no 'fog of war' in screeps as the user can see all rooms at all times using the client/browser, your code can not. Having vision on a room means that the room shows up in your Game.rooms and subsequently allows access (but not necessarily control of) to objects in the room. If you do not have vision in a room, trying to use or get objects in that room will fail. There are several ways of getting vision in a room.

Owned rooms

Your owned rooms where you have claimed the controller will always give you vision.

Creeps, tombstones and owned objects

If you have a creep in a room, you will have vision in that room. Similarly if a creep dies and leaves a tombstone, you will have vision in that room as long as they tombstone exists. Owned objects also give vision.

Observers

The observer that can be built in a room at RCL eight, can grant vision to a distant room up to ten rooms away by default, or up to unlimited on shard range using a powerCreep's power. The vision will only be available for the next game tick after calling observeRoom() and, will need to be constantly applied if continual vision is required.