Screeps: Clean Dead Creep Memory Safely
Clean stale Memory.creeps entries by comparing them with Game.creeps. Delete only confirmed dead names and keep custom task indexes in sync.
ARTICLE LIBRARY
Browse 81 published guides by system, difficulty, content type, or topic. Start with What Is Screeps? A Programming Strategy Game or follow the beginner sequence through How to Combine Your First Screeps Room Loop.
Clean stale Memory.creeps entries by comparing them with Game.creeps. Delete only confirmed dead names and keep custom task indexes in sync.
Publish versioned shard-owned channels, validate remote strings, enforce a conservative UTF-8 project budget, detect writer restarts and revision regressions, and measure freshness with local observation windows.
Distinguish local variables, disposable heap cache, and persistent Memory; initialize Creep state safely; store JSON-compatible values; and recover current game objects from IDs.
Publish versioned public RawMemory segments, request one foreign segment for the next tick, validate untrusted JSON, rotate subscriptions, and detect stream changes without confusing local, cross-shard, and foreign storage.
Resolve an exact Flag, validate its schema, bind saved object IDs to the Flag room and expected type, make fallback an explicit policy, and report configuration drift without mutating the Flag.
Save an ID with room and kind metadata, return explicit invalid, no-vision, missing, wrong-type, and ready states, and keep restoration separate from reselection and actions.
Cache derived IDs and plain data in global, rebuild after resets, invalidate with explicit versions, and keep callers correct when the cache is missing or stale.
Keep one main loop, export small functions, pass current game objects into modules, validate role contracts once per runtime, isolate per-Creep failures, and keep durable state out of module scope.
Request active Segment IDs once, read them on a later tick, distinguish unavailable from empty, validate versioned JSON, and write only after a successful read.
Enter acquire at zero Energy, enter work when full, preserve the previous phase at partial values, initialize explicitly, and keep state selection separate from actions and outcomes.
English articles are published only after source review, official API checks where applicable, JavaScript syntax review where code is present, duplicate-intent and link checks, and editorial review. Publication does not imply Console or multi-tick live-room verification; those evidence states remain separate in each guide. Review the verification method.