rts-performance

Optimizes RTS simulation performance across movement systems, ECS iteration, and rendering scalability.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/Ohmnia/site-build --skill rts-performance-ohmnia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rts-performance
Source: https://github.com/Ohmnia/site-build/tree/main/.opencode/skills/rts-performance
Command: npx skills add https://github.com/Ohmnia/site-build --skill rts-performance-ohmnia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? RTS games collapse under scale when movement systems, neighbor queries, pathfinding, and ECS iteration use inefficient patterns like O(n²) algorithms, per-frame allocations, and hidden memory churn. This Skill provides concrete performance rules for building simulations that remain stable at 20x current scale. ## Core Features & Use Cases - Bottleneck Identification: Pinpoints the real RTS bottlenecks—movement systems, neighbor queries, pathfinding, ECS iteration, visibility checks, draw calls, and memory churn—rather than blaming graphics alone. - Hot Loop Rules: Enforces for loops, cached references, and reusable buffers while banning map/filter/reduce, closures, temporary vectors, and object spreading in hot paths. - Scalability Patterns: Prescribes object pooling, flat arrays, spatial partitioning, batched updates, and reusable vector memory to keep frametimes stable and GC pressure low. - Use Case: When your unit movement system stutters at 5,000 units, apply these rules to replace per-entity allocations with pooled flat arrays and spatial partitioning for neighbor queries. ## Quick Start Review my RTS movement and neighbor query systems using the rts-performance skill and rewrite the hot loops to eliminate per-frame allocations.

Frequently Asked Questions about rts-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize RTS movement systems for thousands of units?

Replace per-entity object allocations with flat arrays and object pooling, and use spatial partitioning for neighbor queries instead of O(n²) pairwise checks. Batch updates and reuse vector memory to keep frametimes stable as unit counts grow.

What causes performance bottlenecks in RTS games?

RTS bottlenecks come from movement systems, neighbor queries, pathfinding, ECS iteration, visibility checks, draw calls, and memory churn—not graphics alone. O(n²) algorithms and per-frame allocations are the most common culprits.

Why should I avoid map, filter, and reduce in game hot loops?

These functions create closures and temporary arrays on every call, generating garbage collection pressure and unstable frametimes. Explicit for loops with cached references and reusable buffers avoid per-frame allocations entirely.

How do I reduce garbage collection pressure in an ECS simulation?

Eliminate per-frame allocations by pooling objects, reusing vector memory, and avoiding object spreading and deep cloning in iteration paths. Flat arrays and batched updates keep memory churn low and performance deterministic.

When is spatial partitioning necessary for neighbor queries?

Spatial partitioning becomes necessary when brute-force pairwise distance checks scale as O(n²) with unit count. Grids or similar structures reduce neighbor lookups to nearby cells, keeping query cost roughly constant per unit.