Generated banner for Unity Ecs Patterns
Generated logo for Unity Ecs Patterns

Unity Ecs Patterns

Seth HobsonCommunityCreated by Seth Hobson

  • Skill
  • Guidelines
  • Software development
  • MIT
  • No issues found

From the author

Master Unity ECS (Entity Component System) with DOTS, Jobs, and Burst for high-performance game development. Use when building data-oriented games, optimizing performance, or working with large entity counts.
— the description by Seth Hobson

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured reference for implementing high-performance game logic using Unity's Entity Component System (ECS), Job System, and Burst Compiler. It contrasts traditional object-oriented programming with data-oriented design, offering patterns for component definition, system implementation using ISystem, entity querying, and managing structural changes via Entity Command Buffers. It emphasizes performance optimization through contiguous memory layout and parallel processing.

What it does

  • Defines patterns for ECS components, including data, tags, buffers, and shared components.
  • Provides templates for high-performance systems using ISystem and Burst compilation.
  • Demonstrates efficient entity querying and filtering techniques.
  • Outlines best practices for structural changes using Entity Command Buffers.
  • Offers guidance on transitioning from object-oriented to data-oriented architectures.
  • Highlights performance pitfalls like managed types and improper chunk utilization.

When to use it

  • When developing high-performance Unity games requiring mass simulation.
  • When managing thousands of entities that exceed standard object-oriented scaling.
  • When optimizing CPU-bound game logic for parallel execution.
  • When implementing data-oriented systems to improve memory cache efficiency.

Advantages

  • Promotes linear scaling for large entity counts.
  • Leverages Burst compiler for significant CPU performance gains.
  • Encourages clean, modular code through ISystem and Aspects.
  • Reduces memory fragmentation by utilizing contiguous data storage.

Usage examples

“How do I create a basic data component in Unity ECS?”
The skill provides a struct definition implementing IComponentData, ensuring it contains only pure data without methods.
“What is the recommended way to implement a system in DOTS?”
It suggests using ISystem over SystemBase for better performance and full Burst compatibility.
“How can I safely destroy entities during a system update?”
It explains the use of Entity Command Buffers (ECB) to defer structural changes like entity destruction.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/wshobson/unity-ecs-patterns/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip unity-ecs-patterns.zip -d .agents/skills

Documentation by Seth Hobson

Unity ECS Patterns

Production patterns for Unity's Data-Oriented Technology Stack (DOTS) including Entity Component System, Job System, and Burst Compiler.

When to Use This Skill

  • Building high-performance Unity games

  • Managing thousands of entities efficiently

  • Implementing data-oriented game systems

  • Optimizing CPU-bound game logic

  • Converting OOP game code to ECS

  • Using Jobs and Burst for parallelization

Core Concepts

1. ECS vs OOP
AspectTraditional OOPECS/DOTS
Data layoutObject-orientedData-oriented
MemoryScatteredContiguous
ProcessingPer-objectBatched
ScalingPoor with countLinear scaling
Best forComplex behaviorsMass simulation
2. DOTS Components
Entity: Lightweight ID (no data)
Component: Pure data (no behavior)
System: Logic that processes components
World: Container for entities
Archetype: Unique combination of components
Chunk: Memory block for same-archetype entities

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

Do's
  • Use ISystem over SystemBase - Better performance

  • Burst compile everything - Massive speedup

  • Batch structural changes - Use ECB

  • Profile with Profiler - Identify bottlenecks

  • Use Aspects - Clean component grouping

Don'ts
  • Don't use managed types - Breaks Burst

  • Don't structural change in jobs - Use ECB

  • Don't over-architect - Start simple

  • Don't ignore chunk utilization - Group similar entities

  • Don't forget disposal - Native collections leak

Files

ATTRIBUTION.md

Attribution

This folder is an unmodified copy of the Agent Skill "unity-ecs-patterns", distributed by AutoGineer (https://autogineer.com/agent-skills).

The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.

Files added by AutoGineer

  • ATTRIBUTION.md: this file, written by AutoGineer

  • LICENSE: copied from LICENSE

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Seth Hobson
Publisher
Seth Hobson (Community)
Source
wshobson/agents · plugins/game-development/skills/unity-ecs-patterns · commit 4bde316
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Seth Hobson or Seth Hobson.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download unity-ecs-patterns.zip