structural-change-cost-model

Select lowest-cost Unity DOTS ECS state transitions by change frequency.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes guesswork from ECS state transitions by providing a canonical decision model for when to mutate values, toggle enableable components, or perform structural add/remove operations.

Core Features & Use Cases

  • Decision Tree for ECS Transitions: Select value mutation, enableable component toggles, or structural changes based on change frequency and semantic intent.
  • Frequency Rule of Thumb: Applies consistent thresholds (e.g., > 1/sec per entity) to choose the lowest-cost approach that still preserves clarity.
  • Performance Risk Guidance: Highlights runtime risks like chunk migration spikes and archetype churn, so you can avoid expensive patterns at scale.
  • Architecture Guidance: Recommends using structural boundaries to create meaningful archetypes (e.g., “Dead” entities excluded from queries) to reduce query-time complexity.

Quick Start

Apply the frequency rule to your ECS state change and choose value mutation, enableable toggle, or structural add/remove accordingly.

Frequently Asked Questions about structural-change-cost-model

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

FAQPage Schema
How do I avoid chunk migration spikes when changing entity states in Unity DOTS?

To avoid chunk migration spikes in Unity DOTS, select the lowest-cost ECS state transition using a frequency-based decision model. For high-frequency updates exceeding one per second per entity, enforce O(1) operations like value mutation or enableable component toggling instead of structural changes.

What is the cheapest way to handle frequent ECS state transitions?

The cheapest way to handle frequent ECS state transitions is applying a frequency rule of thumb. If a state changes more than once per second per entity, choose O(1) value mutation or enableable component toggling over structural add/remove operations to minimize archetype churn and runtime frame spikes.

When should I use structural add/remove operations versus enableable component toggling in ECS?

Use structural add/remove operations in ECS for low-frequency, semantically meaningful archetype boundaries, such as marking entities as Dead to exclude them from queries. Use enableable component toggling for high-frequency state changes to prevent chunk migration spikes.

How do I reduce archetype churn during high-frequency entity state changes?

Reduce archetype churn during high-frequency entity state changes by enforcing O(1) transition choices. Apply a canonical decision model that defaults to value mutation or enableable component toggling for updates exceeding one per second, reserving structural changes for rare transitions.

Does Unity DOTS performance require avoiding structural changes for entity state updates?

Unity DOTS performance optimization requires avoiding structural changes for high-frequency entity state updates. A canonical decision model enforces O(1) transitions like value mutation and enableable toggling to minimize archetype churn and chunk migration, maintaining predictable runtime frame rates.