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.
TOPIC · 20 GUIDES
Focused English articles connected to javascript, organized with the same filters used by the main article library.
Clean stale Memory.creeps entries by comparing them with Game.creeps. Delete only confirmed dead names and keep custom task indexes in sync.
Use fill: 'transparent' for unfilled RoomVisual circles and rectangles, then add debug labels and target paths without confusing visuals with game results.
Call Game.notify(), use groupInterval and simple Memory incident state to avoid repeated alerts, preserve the checked engine result, and keep scheduling separate from external email delivery.
Build a four-mode Screeps CPU degradation scheduler with hysteresis, consecutive-tick confirmation, critical-first task tiers, stable staggering, CPU headroom guards, and gradual recovery.
Open a Screeps Room, switch to the code editor and player Console, then use read-only checks to match exact Room, Spawn, Creep, Source, and Controller data.
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.
Catch JavaScript exceptions at room or subsystem boundaries, retain bounded rate-limited evidence, pause repeatedly failing optional work, and retry after cooldown without confusing API return codes or CPU termination with exceptions.
Combine three fixed beginner roles in one small loop, submit one validated Spawn request, keep Energy phases stable, expose failure statuses, and verify accepted commands on later ticks.
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.