decay-upkeep

Building decay and upkeep systems for survival games. Use when implementing timer-based decay, Tool Cupboard patterns (Rust-style protection radius), resource upkeep costs, or server performance management through automatic cleanup. Balances gameplay and server health.

⭐5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

This Claude skill provides a robust framework for implementing building decay and upkeep systems in survival games. It enables developers to integrate complex game mechanics like timer-based degradation, Rust-style 'Tool Cupboard' protection zones, and resource-based maintenance costs. By automating the cleanup of abandoned structures, it effectively balances gameplay longevity with server performance optimization.

Use Cases

  • Implementing timer-based decay: Automatically apply damage to building components over time based on material durability and server-defined rates.
  • Developing Tool Cupboard systems: Create localized protection zones where structures remain intact as long as players deposit required maintenance resources.
  • Server performance management: Use the cleanup scheduler to automatically remove abandoned entities, reducing server load and maintaining high tick rates.
  • Game economy balancing: Design resource-drain mechanics that prevent infinite hoarding and encourage active player engagement with the environment.
  • Customizing decay modes: Configure different decay behaviors ranging from fast-paced 'Rust' styles to slower, tribe-based 'ARK' protection patterns.
namedecay-upkeep
descriptionBuilding decay and upkeep systems for survival games. Use when implementing timer-based decay, Tool Cupboard patterns (Rust-style protection radius), resource upkeep costs, or server performance management through automatic cleanup. Balances gameplay and server health.

Decay & Upkeep

Timer-based building decay and resource-based upkeep for survival games.

Quick Start

import { DecayManager } from './scripts/decay-manager.js';
import { UpkeepSystem } from './scripts/upkeep-system.js';
import { ToolCupboard } from './scripts/tool-cupboard.js';

// Decay without protection
const decay = new DecayManager({ 
  mode: 'rust',
  decayMultiplier: 1.0 
});
decay.addPiece(piece);
decay.tick(deltaTime); // Called every frame/tick

// Tool Cupboard protection
const tc = new ToolCupboard({
  radius: 30,
  upkeepCost: { wood: 100, stone: 50 }
});
tc.setPosition(position);
tc.depositResources({ wood: 500, stone: 250 });
// Protected pieces won't decay while upkeep is paid

Reference

See references/decay-upkeep-advanced.md for:

  • Decay rate formulas by material
  • Tool Cupboard mechanics (Rust pattern)
  • Upkeep scaling with base size
  • Server performance benefits
  • Anti-raid delay mechanics

Scripts

  • scripts/decay-manager.js - Tick-based decay, material rates, damage states
  • scripts/upkeep-system.js - Resource drain, calculation, UI data
  • scripts/tool-cupboard.js - Protection radius, authorization, resource storage
  • scripts/cleanup-scheduler.js - Server-side cleanup of abandoned structures

Decay Modes

  • Rust: Linear decay over 8-24 hours (material dependent), prevented by Tool Cupboard
  • ARK: Slower decay (days to weeks), tribe-based protection
  • Minecraft: No decay (creative/survival), optional via mods

Design Philosophy

Decay serves dual purposes in survival games: gameplay balance (prevents infinite hoarding) and server performance (removes abandoned bases). The Tool Cupboard pattern elegantly ties both together—players must actively maintain bases, and inactive players' structures automatically clean up.