Operations and DebuggingAdvancedGuide
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.
Operations and DebuggingIntermediateGuide
Measure one code section with Game.cpu.getUsed() deltas, compare equivalent server ticks, separate bucket context from profiling, and protect essential work before optional tasks.
Memory and Code StructureIntermediateGuide
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.
Memory and Code StructureIntermediateGuide
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.