depth-sorting-occlusion — скилл для Claude Code
Помогает настроить правильный порядок отрисовки спрайтов в изометрии, чтобы персонажи не перекрывали деревья и стены на переднем плане.
npx skills add 0xheycat/isometric-game-skills --skill depth-sorting-occlusion -a claude-codeЧто делает depth-sorting-occlusion
Скилл даёт правила для изометрической сортировки глубины. В изометрии видимая глубина определяется позицией опорного тайла по формуле row + col. Модель учится сортировать объекты по возрастанию этого ключа перед отрисовкой, а при совпадении использовать координаты y и порядок создания.
Для составных и крупных спрайтов алгоритм требует брать самый передний тайл вместо центрального, а высокие конструкции делить на вертикальные слои. Пересчитывать порядок нужно при перемещении сущностей, а не каждый кадр для статики. Наивная сортировка по экранному y неизбежно ломается на многотайловых зданиях.
Какие задачи решает
- исправить перекрытие спрайтов персонажа за стенами и деревьями
- рассчитать ключ глубины для изометрических тайлов по формуле row + col
- настроить сортировку для многотайловых и высоких объектов
- оптимизировать пересортировку сцены только при движении объектов
Примеры запросов агенту
- Персонаж отображается поверх дерева, когда проходит за ним. Исправь сортировку спрайтов.
- Напиши функцию глубины для изометрической сетки с учётом многотайловых зданий.
- Проверь отрисовку: почему высокий дом перекрывает персонажа некорректно?
Как установить depth-sorting-occlusion
1Через Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill depth-sorting-occlusion -a claude-code2Вручную: положить файлы
~/.claude/skills/depth-sorting-occlusion/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/depth-sorting-occlusion/
1Через Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill depth-sorting-occlusion -a codex2Вручную: положить файлы
.agents/skills/depth-sorting-occlusion/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill depth-sorting-occlusion -a cursor2Вручную: положить файлы
.cursor/skills/depth-sorting-occlusion/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install 0xheycat/isometric-game-skills depth-sorting-occlusion2Вручную: положить файлы
.github/skills/depth-sorting-occlusion/SKILL.md1Через Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill depth-sorting-occlusion -a gemini-cli2Командой платформы
gemini skills install https://github.com/0xheycat/isometric-game-skills --path skills/depth-sorting-occlusionВручную: положить файлы
.devin/skills/depth-sorting-occlusion/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add 0xheycat/isometric-game-skills --skill depth-sorting-occlusion -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о depth-sorting-occlusion
Как установить depth-sorting-occlusion в Claude Code?
Выполните команду npx skills add 0xheycat/isometric-game-skills --skill depth-sorting-occlusion -a claude-code.
Что делает depth-sorting-occlusion?
Скилл задаёт инструкции для вычисления ключа глубины изометрических объектов и устранения артефактов наложения спрайтов.
Как скилл обрабатывает объекты, занимающие несколько клеток?
Он требует вычислять глубину составного объекта по его самому переднему занятому тайлу, а не по геометрическому центру.
Исходный текст
SKILL.md · MIT
--- name: depth-sorting-occlusion description: Use when sprites draw in the wrong order so characters appear in front of objects they should be behind in an isometric scene. license: MIT --- # Depth Sorting & Occlusion ## Overview In isometric, draw order IS depth. A character is behind a tree if its anchor tile sorts earlier. This skill gives the correct sort key and handles tall/multi-tile objects that break naive sorting. ## When to Use - Characters render in front of trees/walls they should be behind. - Tall or multi-tile objects sort incorrectly. - You added objects and the layering looks wrong. ## Process 1. Give every drawable a depth key based on its anchor tile: depth = row + col. 2. Sort all objects by depth ascending before drawing. 3. For ties, break by a secondary key (e.g. y, then creation order). 4. For multi-tile objects, sort by the FRONT-most occupied tile. 5. For very tall objects, consider splitting into stackable slices. 6. Re-sort only when objects move, not every frame if static. 7. Test the classic case: walk a character around all four sides of a tree. ```js objects.sort((a, b) => (a.row + a.col) - (b.row + b.col)); ``` ## Rationalizations (Stop Lying to Yourself) | Excuse | Reality | |---|---| | "Painter order by y is good enough" | Pure y fails for multi-tile and tall sprites. Use anchor row+col. | | "I will sort once at load" | Moving objects must re-sort. Sort on movement. | ## Red Flags - STOP if you catch yourself: - Sorting by raw y instead of anchor tile. - Multi-tile objects using their center instead of front tile. - Characters clipping through tall buildings. ## Verification You are NOT done until every box is checked: - [ ] Walking around all sides of an object always sorts correctly. - [ ] Multi-tile and tall objects occlude properly. - [ ] Sorting updates when objects move.
© 0xheycat · MIT · 0xheycat/isometric-game-skills