How Screeps Memory Saves Creep Roles and Working State
Learn why ordinary variables do not preserve Screeps state, how creep.memory maps to Memory.creeps, what data belongs in Memory, and why object IDs are safer than live game objects.
TOPIC · 5 GUIDES
Focused English articles connected to memory, organized with the same filters used by the main article library.
5 matching guides
Learn why ordinary variables do not preserve Screeps state, how creep.memory maps to Memory.creeps, what data belongs in Memory, and why object IDs are safer than live game objects.
Build a stable two-phase working state from Store boundaries, keep the previous state at partial Energy, handle initialization and invalid capacity, and separate harvesting from Controller upgrading.
Store an object ID and room name, recover the current object every tick, distinguish missing vision from a destroyed target, validate the restored type, and define an explicit invalidation policy.
Compare Memory.creeps with Game.creeps, remove only confirmed dead-name entries, synchronize explicitly managed task indexes, summarize logs, and avoid TTL-based or global deletion mistakes.
Validate segment IDs, activate one consolidated set for the next tick, distinguish unavailable from empty data, parse versioned string payloads safely, merge updates, and avoid multiple setActiveSegments calls overwriting each other.