Difference between revisions of "Vision"
m |
RayderBlitz (talk | contribs) m (whoops, forgot the anchor) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | 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|room]] means that the room shows up in your <code>Game.rooms</code> and subsequently allows access to (but not necessarily control of) 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. |
+ | 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|room]] means that the room shows up in your <code>Game.rooms</code> and subsequently allows access to (but not necessarily control of) the room object and 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 == |
== Owned rooms == |
||
Line 11: | Line 11: | ||
== Observers == |
== Observers == |
||
− | 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 [[ |
+ | 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 [[Power#Power_Observer|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. |
[[Category:Game Knowledge]] |
[[Category:Game Knowledge]] |
Latest revision as of 23:20, 27 November 2021
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 to (but not necessarily control of) the room object and 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[edit | edit source]
Your owned rooms where you have claimed the controller will always give you vision.
Creeps, tombstones and owned objects[edit | edit source]
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[edit | edit source]
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.