level-streaming
Use when the user asks about level streaming, open world streaming, World Partition, streaming cells, async loading, loading hitches or pop-in. Produces cell…
от j4flmao★ 47 звёзд на GitHub
Установить level-streaming в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Level Streaming — Deep Engineering Guide
Purpose
Open worlds don't fit in RAM or load in one frame. Level streaming keeps gigabytes on disk and only the needed few hundred MB resident, without the player ever seeing a pop-in or a hitch. This skill covers stream strategies, cell management, async load, dependency closure, transition LOD and the anti-hitch toolkit.
Agent Protocol
Trigger
"level streaming", "open world streaming", "world partition", "streaming cells", "async loading", "hitch", "pop-in".
Input Context
- Engine and storage target (SSD, HDD, mobile flash)
- World size, traversal speed and memory budget
- Existing asset/dependency format
Output Artifact
Streaming design (cell grid, budgets, load priorities) and loader code. No file unless requested.
Response Format
Cells: {size, layers}
Residency: {radius / priority rules}
Budget: {MB resident, ms per frame for integration}
Code: {snippet}
Risks: {hitches, pop-in, I/O starvation}
1. The Core Idea
world = partitioned into cells/chunks (geometry+textures+meshes+audio+nav)
player's camera + prediction → determine "in-scope" set
stream: load only in-scope, drop out-of-scope
budget: bytes aligned to disk speed; never stall the frame
Scope is defined by player relevance (distance bands + occlusion), not "whole level".
2. Stream Strategies
| Strategy | Cells | Load model | Use |
|---|---|---|---|
| Spatial cell (grid) | fixed-size cell | in-view + predict-ahead | open fields, driving |
| Zone/region | authored chunks | entrance-based | dungeons, hubs |
| Enabling trigger | scripted beams | event-driven | linear-ish |
| Persistent + streaming | base + rare | base always | hub + quest areas |
Hybrid is the norm: base persistent + spatial cells around it + scripted chunks for set-pieces. Unreal's World Partition implements the spatial-grid model (runtime grids, streaming sources, data layers, HLODs for unloaded cells); Unity uses additive scenes or Addressables for the same idea.
3. Cell Management (The Heart)
- Cell = a pak unit (see
asset-pipeline/packing): one load = one bounded read + one manifest entry. - Cell metadata: AABB, dependencies, resident state, refcount (a cell near a boundary refcounted by 2 cameras/players).
- Residency states: Unloaded → Loading → Resident → (UnloadPending) → Unloaded.
struct Cell { AABB bounds; vector<AssetId> deps; Residency state; int refs; };
4. The Predict-Ahead Rule (Anti-Pop Guarantee)
Load not just the current cell but the predictive set:
inScope = cells that (camera speed projection enters within ~2 s)
∪ (radius: camera predicts ahead)
∪ (trigger event claims)
Never "load when the player is already inside the cell" — that guarantees visible pop-in or a hitch. The streaming budget from asset-pipeline throttles you if you request too much («streaming-throttle»).
5. Async Loading (Never On the Frame Thread)
- File reads on IO threads (see
platform-abstractionfilesystem refs), decompress on workers. - Main→worker handoff is deferred: the level gets a "Loading" proxy (an occluder shell / low-poly stand-in) until the resident data arrives.
- Never
freadon the main thread — make your profiler flag any synchronous load on the game thread as a bug.
6. Dependency Closure (The Silent Loader-Breaker)
A cell "needs" materials, meshes, audio, nav (and those need their deps). The streaming system resolves the full transitive closure:
cell → [mesh_a, mat_a, tex_b] → tex_b → [sampler,cdf]
Failure mode: two cells share a dependency, both load it twice (waste + refcount chaos). Solution: a global asset cache with refcounts; cells request assets, the cache dedupes. The closure should be generated by the cook step (see asset-pipeline), not maintained by hand.
7. The Anti-Hitch Toolkit
| Tool | What it does |
|---|---|
| Deferred activation | entity activates only when fully resident |
| Proxy / low-poly shell | visible stand-in while loading |
| Progressive LOD | coarse-loaded → refine when idle (re-lod) |
| Pop-mask | a fog/cull fade near active boundaries |
| Never-load-more-than-budget | throttling (see streaming-throttle) |
| Watchdog | a cell "resident" false-flag → retry/repair |
8. Progression & Transitions
- Fade transitions: a region gate fades the world around it (spawn masked) — far less visible than pop.
- LOD-stepping: streamed-in high-res swaps the shell when ready (rare hitch = micro-shell pops, acceptable).
- Editor hot-reload should go through the same streaming path (see
asset-pipeline/hot-reload).
9. Memory & Budget Control
| Budget | Danger level |
|---|---|
| resident bytes | ~half the level RAM budget |
| load-in-flight bytes | throttled (§ streaming-throttle) |
| per-frame activation cost | < 1 ms |
| unload debt (refcount 0 linger) | collected opportunistically |
Watc
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/asset-dependencies.md
- references/async-loading.md
- references/cells-and-residency.md
- references/hitch-prevention.md
- references/progressive-transitions.md
- references/stream-strategies.md
FAQ
Что делает скилл level-streaming?
Use when the user asks about level streaming, open world streaming, World Partition, streaming cells, async loading, loading hitches or pop-in. Produces cell layout, residency rules and hitch-free load scheduling. Not for asset cooking and packaging (use asset-pipeline) or server zone sharding (use scaling-architecture).
Как установить скилл level-streaming?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл level-streaming запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…