home / skills / bbeierle12 / skill-mcp-claude / structural-physics
This skill validates structural stability and handles damage propagation for building systems in Three.js games, supporting arcade, heuristic, and realistic
npx playbooks add skill bbeierle12/skill-mcp-claude --skill structural-physicsReview the files below or copy the command above to add this skill to your agents.
---
name: structural-physics
description: Structural validation and damage systems for Three.js building games. Use when implementing building stability (Fortnite/Rust/Valheim style), damage propagation, cascading collapse, or realistic physics simulation. Supports arcade, heuristic, and realistic physics modes.
---
# Structural Physics
Stability validation and damage systems for building mechanics.
## Quick Start
```javascript
import { HeuristicValidator } from './scripts/heuristic-validator.js';
import { DamageSystem } from './scripts/damage-propagation.js';
// Rust/Valheim style stability
const validator = new HeuristicValidator({ mode: 'heuristic' });
validator.addPiece(piece);
const result = validator.validatePlacement(newPiece);
// result: { valid: true, stability: 0.85, supports: [...] }
// Damage and collapse
const damage = new DamageSystem(validator);
damage.applyDamage(piece, 50, 'physical');
damage.applyExplosiveDamage(position, 100, 10); // radius damage
```
## Reference
See `references/structural-physics-advanced.md` for:
- Physics mode comparison (arcade vs heuristic vs realistic)
- Material properties and decay rates
- Damage state thresholds
- Cascade mechanics
## Scripts
- `scripts/heuristic-validator.js` - Fast validation (Fortnite/Rust/Valheim modes)
- `scripts/stability-optimizer.js` - Caching and batch updates for large structures
- `scripts/damage-propagation.js` - Damage states, fire spread, cascading collapse
- `scripts/physics-engine-lite.js` - Optional realistic stress/strain simulation
## Physics Modes
- **Arcade** (Fortnite): Connectivity only, instant collapse, best for combat
- **Heuristic** (Rust/Valheim): Stability %, predictable rules, best for survival
- **Realistic**: Full stress/strain, computationally expensive, best for engineering sims
This skill provides structural validation and damage systems tailored for Three.js building games. It supports arcade, heuristic, and realistic physics modes to balance performance and realism for combat, survival, and engineering scenarios. Use it to determine placement validity, compute stability percentages, and simulate damage propagation and cascading collapse.
The system inspects piece connectivity, support relationships, and material properties to produce placement validation and a stability score. In arcade mode it uses connectivity rules for instant collapse behavior; in heuristic mode it computes stability percentages and predictable failure rules; in realistic mode it runs stress/strain simulations for detailed structural response. A damage subsystem maps hits, explosions, and fire into damage states and triggers cascade or collapse based on thresholds.
Which mode should I pick for a multiplayer survival game?
Use heuristic mode for predictable, player-friendly stability while keeping CPU costs moderate.
Can I combine modes for different parts of a structure?
Yes — run realistic simulations for critical components and fall back to heuristic or arcade rules for the rest to balance fidelity and performance.