home / skills / bbeierle12 / skill-mcp-claude / decay-upkeep

decay-upkeep skill

/skills/decay-upkeep

This skill helps you implement timer-based decay and upkeep systems with Tool Cupboard protection to balance gameplay and server health.

npx playbooks add skill bbeierle12/skill-mcp-claude --skill decay-upkeep

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
2.1 KB
---
name: decay-upkeep
description: 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.
---

# Decay & Upkeep

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

## Quick Start

```javascript
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.

Overview

This skill implements timer-based building decay and resource upkeep systems tailored for survival games. It provides configurable decay modes, Tool Cupboard-style protection radii, and automated cleanup to balance gameplay and preserve server performance. The implementation is in JavaScript and integrates with game tick/update loops.

How this skill works

The system runs on a tick-based DecayManager that tracks pieces, applies material-specific decay rates, and moves structures through damage states. An UpkeepSystem drains configured resources over time based on base size and material, and a Tool Cupboard pattern enforces protection when upkeep is paid or authorized players are nearby. A cleanup scheduler optionally removes abandoned structures to reduce server load.

When to use it

  • You need timer-based removal of unused or abandoned player structures to free server resources.
  • You want a Tool Cupboard pattern that requires periodic resource deposits to protect bases.
  • You need configurable decay rates per material or multiple decay modes (Rust, ARK, Minecraft/mod).
  • You want automatic cleanup of griefed or inactive builds to maintain gameplay balance.
  • You need upkeep scaling with base size to discourage infinite expansion.

Best practices

  • Choose decay mode and time windows that match your game pacing (shorter for fast servers, longer for persistent worlds).
  • Scale upkeep costs with footprint and material tiers to reward investment while preventing passive hoarding.
  • Use a protection radius and authorization lists to avoid accidental decay of allied structures.
  • Expose tuned defaults but allow server operators to override decayMultiplier and upkeepCost per material.
  • Run cleanup tasks during low-activity windows and batch removals to minimize performance spikes.

Example use cases

  • Rust-style server: linear 8–24 hour decay per material with Tool Cupboard preventing decay while upkeep is paid.
  • Persistent MMO: ARK-style slower decay over days for tribe-based protection and group upkeep pooling.
  • Modded Minecraft: optional decay and upkeep added to survival servers to deter large abandoned bases.
  • Performance-focused servers: automatic cleanup scheduler removes bases flagged as abandoned after anti-raid delay.
  • Competitive survival: upkeep mechanics force active play and resource management for long-term base maintenance.

FAQ

How are upkeep costs calculated?

Upkeep is computed from a base’s footprint and material tiers, then multiplied by configured rates; costs can be paid from Tool Cupboard storage or drained periodically from linked inventories.

Can I customize decay timing per material?

Yes — material-specific decay rates and a global decayMultiplier are configurable so you can tune timing per material or game mode.