Skip to content

Add icing placers (bamboo first) - #62

Open
macmv wants to merge 2 commits into
worktree-ground-chunk-placersfrom
worktree-icing-placers
Open

macmv wants to merge 2 commits into
worktree-ground-chunk-placersfrom
worktree-icing-placers

Conversation

@macmv

@macmv macmv commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Stacked on #61.

What

Adds IcingPlacer: a last pass of decoration that runs once a chunk is final, which is when all 8 neighbors have finished being decorated. At that point every tree is in place (including ones that grew in from a neighbor), so an icing placer can see exactly what is above it, and nothing runs after it that could overwrite it.

Icing placers only edit their own chunk, so no extra neighbors are needed. The base terrain stays 7x7 and the first chunk still needs a 3x3 decorated region.

Bamboo is the only icing placer for now.

Design

  • IcingPlacer is a separate trait from ChunkPlacer on purpose. A ChunkPlacer runs before any tree exists, so it can't take trees into account. Registering a placer in the wrong pass should not compile.
  • Registered with g.place_icing(...).
  • Generator::ice(ctx, chunk, pos) is called right before the Decorated -> NeighborDecorated flip, and from Region::generate.
  • The icing pass only looks up surface biomes (no cave or height lookups).
  • Per-placer RNG seeding matches generate, with a salt so icing does not share seeds with chunk placers.

Bamboo

The bug: bamboo placed before a tree makes the leaves skip its cells, so stalks poke through canopies. Now bamboo runs last, and a stalk is cut short to fit under the canopy. A stalk with less than 6 blocks of room is skipped.

placer::Bamboo and placer::BambooClump are replaced by icing_placer::Bamboo and icing_placer::BambooClump. Clumps use the replay helpers from #61, so they are continuous across chunk borders.

Not done / needs a look

  • Icing runs under the global chunk lock (TODO in generate_neighbor_decorated). Needs a benchmark against the current 3x3 baseline.
  • MIN_HEIGHT = 6 is a guess.
  • Not run in game. Existing worlds will see different bamboo (new seeds, shorter stalks).

Icing placers run once a chunk is final (all 8 neighbors decorated), so
every tree is already in place. They can only edit their own chunk, so no
extra neighbors are needed and chunk latency is unchanged.

Bamboo is the first icing placer. A stalk is cut short to fit under the
canopy, and skipped if there is not enough room, instead of growing
through leaves.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant