Depth Sorting & Occlusion
SkillMonitoring & opsUse when sprites draw in the wrong order so characters appear in front of objects they should be behind in an isometric scene.
Use Depth Sorting & Occlusion in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Depth Sorting & Occlusion and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Depth Sorting & Occlusion skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
What this skill tells your AI
The instructions your AI receives, as published by 0xheycat/isometric-game-skills in skills/depth-sorting-occlusion/SKILL.md and read by Ahel’s review.
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
- Give every drawable a depth key based on its anchor tile: depth = row + col.
- Sort all objects by depth ascending before drawing.
- For ties, break by a secondary key (e.g. y, then creation order).
- For multi-tile objects, sort by the FRONT-most occupied tile.
- For very tall objects, consider splitting into stackable slices.
- Re-sort only when objects move, not every frame if static.
- Test the classic case: walk a character around all four sides of a tree.
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.
Signals
- GitHub stars
- 25
- Forks
- 3
- Last commit
- Aug 2026
Advanced
- Item type
- skill
- Key
depth-sorting-occlusion- Source
- github.com/0xheycat/isometric-game-skills
github.com/0xheycat/isometric-game-skills
Related picks
Skill · thedaviddias
The pick for JavaScriptmodern-javascript-patterns
Skill · wshobson
The pick for JavaScriptinternal-comms
Skill · anthropics
More in Monitoring & opsagent-eval
Skill · affaan-m
More in Monitoring & opspricing
Skill · coreyhaines31
More in Monitoring & opslark-okr
Skill · larksuite
More in Monitoring & ops