Skip to content

feat(trees): walk through tree crowns like through plants — leaves, needles and fronds, not the trunks (#2184) - #2197

Merged
marceld23 merged 2 commits into
mainfrom
feat/walk-through-tree-foliage
Oct 2, 2026
Merged

marceld23 merged 2 commits into
mainfrom
feat/walk-through-tree-foliage

Conversation

@marceld23

@marceld23 marceld23 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Closes #2184

What

You now walk, jump and fall through tree crowns — leaves, needles, fronds and the Fifi plant's leaves — the way you already walk through grass and ferns. Trunks stay solid, and so do the giant trees' branches (they are giant_log).

How

  • Shared/Definitions/TreeFoliage — the five crown keys, named once. Until now the list was hand-copied into seven places that had drifted: the server's flyer rule and the client's creature/critter probes only knew tree_leaves + giant_leaves, so a bird bounced off a pine crown.
  • ChunkMesher — crown cells lose TraitCollidable: same look, no collider. The trunk's faces toward its leaves are still emitted (foliage never seals a neighbour's face), so the trunk keeps its full collider.
  • PlayerController.IsSolidKey — a crown is no footing; IsCollidingKey inherits that. So the embedded/out-of-world guard, the crouch-to-stand headroom check, the sneak edge-stop and the "a block appeared in my cell, lift me out" path all agree with the missing collider.
  • DoorProbe.IsJamb — a crown is no door jamb any more (its own rule: "the blocks the client meshes without a collider").
  • Fauna consistency — flying creatures (server) and the client's creature ground probe and critter blocking use the shared list, so they cover every crown kind.
  • Mining and placing leaves are unaffected: block targeting walks the voxel grid, not the collider.

Deliberately unchanged

  • The Solid flag: crowns still block line of sight and light (you can still hide in a tree).
  • Ground NPCs and animals still treat crowns as solid. The server's IsCollidingBlock also decides where falling sand stops, where drop packets land and where NPCs stand, and a crown hangs above their heads anyway.
  • The Paul flower's opaque leaf slabs (paul_leaf) — platforms, not a crown.
  • Side effect: the generation-1 giant cactus is built entirely of tree_leaves, so it is walked through too. Giving it its own stem block would need a terrain-generation bump, so it is out of scope here.

Tests

  • TreeFoliageTests (new): every crown key is a shipped flora block, so the entombed rescue never fires inside a crown. Each crown renders as cutout, and the generator's giant-leaves key is in the list. Trunks stay jambs and crowns don't. A player inside any crown is not entombed; inside a trunk they are.
  • DoorwayTests.TheJambRule_CountsWallsNotFlora: tree_leaves is no jamb now; wood_log is.
  • Unity EditMode ChunkMesherTreeFoliageEditModeTests (new): every crown cell renders but emits no collider; a trunk wrapped in leaves keeps all six collider faces.

Verification

  • dotnet build --no-incremental: 0 warnings, 0 errors; dotnet format --verify-no-changes: clean.
  • Local tests (targeted: TreeFoliage, Doorway, TextureTiles, creature/NPC, flora variety, swim/void rescue): 411/411 passed. The full suite runs in CI.
  • Local Unity player build (scripts/build-client.ps1): Build Finished, Result: Success, 0 error CS, fresh BlocksBeyondTheStars.Client.dll; no generated files to commit.
  • Unity EditMode: 168 passed / 2 failed / 1 skipped. Both new ChunkMesherTreeFoliageEditModeTests pass. The two failures already fail on main and are not from this change: ChunkMesherGoldenEditModeTests has stale pins, and InputAbstractionEditModeTests lacks FeedCreature in the rebind groups. This PR also changes the golden's collider hash (crowns lose their collider), so whoever re-pins it next includes that on purpose.
  • ⚠ Playtest open: walk into an oak, pine, palm, giant tree and Fifi plant; try to stand on a crown; check that the trunk still blocks you.

🤖 Generated with Claude Code

…eedles and fronds, not the trunks (#2184)

Tree crowns (tree_leaves, pine_needles, palm_frond, giant_leaves, fifi_leaf)
keep their cutout look but no longer emit a collider; trunks and the giant
trees' branches stay solid.

- Shared TreeFoliage names the crown keys once; the list was hand-copied
  into seven places that had drifted (flyers bounced off pine crowns).
- ChunkMesher: crown cells drop TraitCollidable; a trunk's faces toward its
  leaves are still emitted, so it keeps a full collider.
- PlayerController.IsSolidKey: a crown is no footing (IsCollidingKey,
  crouch headroom, sneak edge-stop and the lift-out path follow).
- DoorProbe.IsJamb: a crown is no door jamb.
- Flyers (server), creature ground probe and critter blocking (client) use
  the shared list.
- Solid flag unchanged (crowns still block sight and light); ground NPCs and
  animals still treat crowns as solid.

Tests: TreeFoliageTests, DoorwayTests, EditMode
ChunkMesherTreeFoliageEditModeTests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@marceld23 marceld23 added enhancement New feature or request area: server GameServer / Networking / WorldHost / Api / Persistence area: client Unity client / Client.Core labels Oct 2, 2026
@marceld23 marceld23 self-assigned this Oct 2, 2026
@marceld23
marceld23 merged commit 1870350 into main Oct 2, 2026
19 checks passed
@marceld23
marceld23 deleted the feat/walk-through-tree-foliage branch October 2, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: client Unity client / Client.Core area: server GameServer / Networking / WorldHost / Api / Persistence enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Walk through tree foliage like through plants (leaves, needles, fronds — not trunks)

1 participant