dots-ecb-orchestration

Orchestrate DOTS EntityCommandBuffer recording and playback across job phases.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill dots-ecb-orchestration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dots-ecb-orchestration
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/dots-ecb-orchestration
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill dots-ecb-orchestration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents structural changes made inside scheduled DOTS jobs from causing crashes, one-frame delays, duplicated mutations, or non-deterministic replays by routing all ECB writes to the correct recorder/playback phase.

Core Features & Use Cases

  • Playback-phase selection: Chooses the right Begin*/End* EntityCommandBufferSystem based on which system will read the post-change state.
  • Deterministic ParallelWriter sorting: Enforces [ChunkIndexInQuery] sort keys for stable playback ordering when using AsParallelWriter().
  • Recording vs playback correctness: Establishes when to record, when playback happens automatically, and which anti-patterns to avoid for safe, single-frame structural updates.
  • Practical job patterns: Provides senior-grade templates for IJobEntity/IJobChunk ECB usage, including Enabled flips and entity lifecycle operations.

Quick Start

Use dots-ecb-orchestration to record your AddComponent/RemoveComponent/Instantiate/DestroyEntity or Enabled changes inside IJobEntity jobs and let the appropriate ECB system play them back at the phase your readers need.

Frequently Asked Questions about dots-ecb-orchestration

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

FAQPage Schema
How do I use EntityCommandBuffer inside IJobEntity for deterministic structural changes?

When using ParallelWriter with AsParallelWriter(), you must enforce ChunkIndexInQuery sort keys to guarantee stable playback ordering. This deterministic sorting prevents race conditions and ensures structural changes apply in a predictable sequence across parallel job execution.

How do I choose the right EntityCommandBufferSystem playback phase in Unity DOTS?

You should avoid manual playback, wrong-phase recording, and multi-frame or multi-playback misuse of EntityCommandBuffer. These anti-patterns cause one-frame delays, duplicated mutations, crashes, or non-deterministic replays by applying structural changes outside the safe ECB system lifecycle.

Can I flip the Enabled state of an entity using EntityCommandBuffer inside scheduled jobs?

Yes, you can flip the Enabled state of an entity by recording the change through EntityCommandBuffer inside IJobEntity or IJobChunk. The ECB orchestration ensures the enable or disable workflow applies deterministically during the selected initialization, simulation, or fixed-step playback phase.

Why do my Unity DOTS structural changes inside jobs cause one-frame delays or crashes?

Structural changes inside jobs cause one-frame delays or crashes when EntityCommandBuffer writes are routed to the wrong recorder or playback phase. Correct ECB system selection and deterministic ParallelWriter sorting prevent these issues by ensuring safe, single-frame structural updates.