Isometric depth sorting: draw world entities back-to-front so tall sprites occlude correctly #66
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo#66
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tall sprites (the training dummy, trees, and mobiles) are anchored at their base tile but extend upward, visually covering neighbouring tiles that are higher on screen. Today the client draws entities in dictionary order (
_players.Valuesthen_mobilesin separate loops inGameScreen.Draw) with no depth sorting, so occlusion is wrong: a player standing behind the dummy is drawn over it (looks like they walked "into"/through it), and players are always drawn over/under all creatures regardless of position.Fix
Render all world entities (players, mobiles, corpses, tall statics) in one back-to-front pass sorted by isometric depth — typically by the anchor's screen Y (or tile Y then X). A nearer entity (lower on screen) is drawn last and correctly occludes farther ones, so a tall sprite "stands" on its tile and hides whatever is behind it.
Note: this is purely visual — movement already blocks correctly on a creature's tile (server-authoritative). This only fixes the draw order / occlusion.
Definition of Done
Real-world feedback (owner testing): tree hedges are very counter-intuitive to read in-game. The player stands on the walkable lane beside a tree band, but the tall tree sprites — drawn in the map pass, entirely behind the entity pass — overlap the walkable tiles and the player, so it looks like you are standing inside/among the trees. Movement + LOS are correct server-side (you cannot enter a tree tile or shoot a bolt through one); the issue is purely the render order.
Two fixes, ideally both:
Item 2 is cheap and would immediately fix the readability even before full depth sorting lands.
marco referenced this issue2026-07-19 12:06:18 +02:00