← Back to miito.dev

Digital Garden

October 21
Garden HubAutomotiveTypeScriptTestingSVGSQLSecurityReactPerformanceNode.jsModdingJavaScriptGame DevDevOpsDesignCSSCommunication
miito.dev
© Brian Dinh (miito.dev)
✕
✕
§ GARDEN · GAME-DEV · CLASS OPEN
NODE FILE · ENTRY

Entity Component System Architecture

FILED UNDER · GAME-DEV
①Read
②Meta

Composition over inheritance for game objects — why ECS scales where class hierarchies collapse.

Traditional OOP game engines use deep inheritance hierarchies: GameObject → Character → Enemy → FlyingEnemy → FlyingEnemyWithShield. Every new combination requires a new class. ECS inverts this: entities are just IDs, components are pure data bags, and systems are functions that operate on components. Composition replaces inheritance.

Data-Oriented Design

ECS isn't just an organizational pattern — it's a performance strategy. Components of the same type are stored contiguously in memory. When a system iterates over all Position components, it's walking a flat array with perfect cache locality. This is why ECS-based engines can simulate millions of entities where OOP hierarchies choke at thousands.

DTNRWORKSHOP ARMAMENTSSN 2012.OTT.0176