rts-entity-architecture

Implements deterministic ECS-based RTS simulation logic with bitECS and integer combat math.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building real-time strategy game logic often leads to non-deterministic simulations, floating-point desyncs in multiplayer, and performance-killing object-oriented patterns. This Skill enforces a data-oriented architecture that keeps gameplay state out of the renderer and guarantees deterministic, server-authoritative simulation loops. ## Core Features & Use Cases - Pure Struct-of-Arrays Components: Generates bitECS-style components backed by Typed Arrays mapped to numeric entity IDs, eliminating GC churn and object reference bloat. - Deterministic Combat Pipeline: Implements event-queued damage processing with integer math, 2D armor-type multiplier lookup tables, and fixed tick-rate loops (10-30 ticks/sec) to prevent network desyncs. - Ordered System Execution: Defines a strict linear pipeline from input ingestion through AI state machines, movement, collision, combat, buffs, death cleanup, and renderer synchronization. - Use Case: When implementing a unit combat system for a multiplayer RTS, use this Skill to generate the damage event bus, integer health arrays, and armor multiplier tables that stay in sync across all networked clients. ## Quick Start Use the rts-entity-architecture skill to implement a deterministic combat damage system with integer health components and an event queue for my bitECS-based RTS game.

Frequently Asked Questions about rts-entity-architecture

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

FAQPage Schema
How do I implement deterministic combat in an RTS game?

Use integer-based health and damage values instead of floats, and process combat through an event queue rather than direct state mutation. Apply damage via a 2D armor-type multiplier lookup table with Math.floor to guarantee identical results across all networked clients.

How to structure ECS components with bitECS for performance?

Define components as flat Typed Arrays indexed by numeric entity IDs, such as Uint16Array for health values. Never allocate classes or object graphs per entity, and banish the new keyword and closures inside hot system loops to avoid GC churn.

Why does my multiplayer RTS desync across clients?

Desyncs typically come from floating-point arithmetic in combat logic or unordered system execution. Enforce integer math, a fixed tick rate of 10-30 ticks per second, and a strict linear system pipeline from input ingestion through renderer synchronization.

Should game state be stored in Three.js meshes?

No, gameplay state like health, damage, or faction flags must never live in Three.js Object3D instances. Treat the renderer as a passive viewer that reads final simulation arrays each frame and only updates visual instances.

What are the limitations of deep entity inheritance in ECS?

Deep inheritance trees like Unit -> Soldier -> Sniper create rigid hierarchies that break cache locality and complicate queries. Replace them with granular flat components that systems compose freely across any entity ID.