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.

⭐2stars🔀0forks📁View on GitHub🕐Updated Dec 30, 2025⬇️1downloads

When & Why to Use This Skill

This Claude skill provides a comprehensive framework for implementing building decay and resource-based upkeep systems in survival games. It offers modular logic for timer-based degradation, Rust-inspired 'Tool Cupboard' protection radiuses, and automated server cleanup scripts. By balancing player resource management with server performance optimization, it helps developers create sustainable and engaging multiplayer environments.

Use Cases

  • Case 1: Implementing a Rust-style 'Tool Cupboard' system where players must deposit resources to protect their base from decaying within a specific radius.
  • Case 2: Automating server-side cleanup of abandoned structures to improve long-term server performance and reduce entity counts.
  • Case 3: Designing material-specific decay rates (e.g., wood decaying faster than stone) to add depth to survival game progression and economy.
  • Case 4: Integrating a tick-based damage system for building components that triggers when upkeep requirements are not met.
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.