feat(client): iso depth sorting + fade trees occluding the player (#66) #88

Merged
marco merged 1 commit from feat/iso-depth-sort into main 2026-07-19 12:11:17 +02:00
Owner

Closes #66. Fixes the counter-intuitive tree rendering the owner hit while testing: trees were drawn in the map pass, entirely behind the entity pass, so the player floated over every tree and you could not tell walkable lanes from tree tiles.

What changed

  • Ground (grass) draws first as a flat layer.
  • Trees + entities (players, mobiles, corpses, ground items) draw in one back-to-front pass keyed on the screen Y of each thing's foot — a nearer tree now occludes what's behind it.
  • A tree that would hide the self player is faded (30% alpha) so your character is always visible. The geometry test lives in IsoOcclusion (Client.Core, unit-tested).
  • GridRenderer splits into DrawGround / VisibleObstacles / DrawTree; GameScreen owns the sorted pass with a reused per-frame list (no allocation).

Movement + LOS were already correct server-side; this is purely the client render order.

Verify (visual)

Walk into a tree hedge: you can no longer stand "inside" trees (you never could server-side), trees in front of you occlude correctly, and any tree that would cover you turns semi-transparent so you still see your character.

Definition of Done

  • In-game, the player is occluded by trees nearer the camera and visible (tree faded) when one would cover them.
  • Walkable lanes read clearly against tree hedges.
  • IsoOcclusion has unit tests; suite green, zero warnings.
Closes #66. Fixes the counter-intuitive tree rendering the owner hit while testing: trees were drawn in the map pass, entirely behind the entity pass, so the player floated over every tree and you could not tell walkable lanes from tree tiles. ### What changed - Ground (grass) draws first as a flat layer. - Trees + entities (players, mobiles, corpses, ground items) draw in **one back-to-front pass** keyed on the screen Y of each thing's foot — a nearer tree now occludes what's behind it. - A tree that would **hide the self player is faded** (30% alpha) so your character is always visible. The geometry test lives in `IsoOcclusion` (Client.Core, unit-tested). - `GridRenderer` splits into `DrawGround` / `VisibleObstacles` / `DrawTree`; `GameScreen` owns the sorted pass with a reused per-frame list (no allocation). Movement + LOS were already correct server-side; this is purely the client render order. ### Verify (visual) Walk into a tree hedge: you can no longer stand "inside" trees (you never could server-side), trees in front of you occlude correctly, and any tree that would cover you turns semi-transparent so you still see your character. ## Definition of Done - [ ] In-game, the player is occluded by trees nearer the camera and visible (tree faded) when one would cover them. - [ ] Walkable lanes read clearly against tree hedges. - [ ] IsoOcclusion has unit tests; suite green, zero warnings.
feat(client): isometric depth sorting + fade trees occluding the player
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m50s
bd7ca2878d
Trees were drawn in the map pass, entirely behind the entity pass, so the player
floated over every tree and it was impossible to read where you could walk (#66).

Draw the ground first, then trees and entities in one back-to-front pass keyed on
the screen Y of each thing's foot, so a nearer tree occludes what's behind it. A
tree that would hide the self player is drawn faded (IsoOcclusion, unit-tested in
Client.Core) so you always see your character. The per-frame draw list is a reused
field — no allocation.

GridRenderer splits into DrawGround + VisibleObstacles + DrawTree; GameScreen owns
the sorted pass.
marco merged commit 1637f04f0e into main 2026-07-19 12:11:17 +02:00
marco deleted branch feat/iso-depth-sort 2026-07-19 12:11:17 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!88
No description provided.