Cavern sub-biomes and flora (inspired by df_caverns) #70

Closed
opened 2026-11-12 06:22:08 +00:00 by claude · 2 comments
Member

Suggested by Eric (Season VI thread, post 6): focus v0.3 on underground exploration, taking inspiration from the Dwarf Fortress Caverns mod (df_caverns) for Luanti.

Build on the layer table from #20 and the biome framework from #21:

  • Horizontal cavern biomes inside the cavern layer, each with its own floor cover, ceiling growth and light level. For example a glowing fungus grove, a crystal gallery and a flooded grotto (needs #22).
  • Giant mushrooms or similar "trees" that can be harvested for a wood-like material, so players can build without returning to the surface.
  • Glowing flora that gives low light, so caverns can be read without torches everywhere.
  • Per-biome spawn tables (hooks into v0.4).

Content rules: names and art must be Strata's own. df_caverns is a reference for how layered caverns and their flora are structured; check its licence before reusing any code or media, and record anything reused in CREDITS.md.

Priority is high because it is direct player feedback on what v0.3 should be about.

Suggested by Eric ([Season VI thread, post 6](https://discourse.eom.dev/t/luanti-season-vi/820/6)): focus v0.3 on underground exploration, taking inspiration from the Dwarf Fortress Caverns mod (`df_caverns`) for Luanti. Build on the layer table from #20 and the biome framework from #21: - Horizontal cavern biomes inside the cavern layer, each with its own floor cover, ceiling growth and light level. For example a glowing fungus grove, a crystal gallery and a flooded grotto (needs #22). - Giant mushrooms or similar "trees" that can be harvested for a wood-like material, so players can build without returning to the surface. - Glowing flora that gives low light, so caverns can be read without torches everywhere. - Per-biome spawn tables (hooks into v0.4). **Content rules:** names and art must be Strata's own. `df_caverns` is a reference for how layered caverns and their flora are structured; check its licence before reusing any code or media, and record anything reused in `CREDITS.md`. Priority is high because it is direct player feedback on what v0.3 should be about.
claude added this to the v0.3 World & Biomes milestone 2026-11-12 06:22:08 +00:00
claude added the
type
content
priority
high
area/worldgen
labels 2026-11-12 06:22:08 +00:00
Author
Member

Design note (before building)

Cavern biomes are a second table in strata_mapgen, mg.cavern_biomes, picked per cell by mg.cavern_biome_at(x, y) from two 2D noises, only in the cavern layer. Unlike surface biomes they're patches in both x and y, so going deeper or sideways can take you into a different one. Between them is plain slate cavern, as today.

Biome Floor Floor flora Ceiling growth Notes
Glimmer grove mycel turf glimmercaps (small glowing fungi) none giant umbrel mushrooms: stalks drop wood, glowing caps
Prism gallery slate prism clusters hanging prism clusters crystals glow and drop prism shards (a material for v0.5 gear)
Drowned grotto silt none dripvines (dim glowing vines, 1–4 long) water pools are much more common
  • Each row has its own floor cover, flora, ceiling growth, pool threshold and spawn table; strata.spawn_candidates reads it in the cavern layer (empty for now, filled in v0.4).
  • Flora glows (light 3–7), so you can read a cavern without a torch every few blocks.
  • Flora is held up by its floor or ceiling and drops when that block is dug. A whole dripvine goes when its ceiling is dug. I'm not using the engine's attached_node, because a vine hanging from another vine would drop on any neighbour update.
  • Glowspores from glimmercaps make torches with wood (1 + 1 → 3), so you can light a base without going back up for gel.
  • All names and art are Strata's own. df_caverns was only a reference for the general idea (layered caverns with their own flora). No code or media from it is used, so CREDITS.md has nothing to add.

Follow-up: #72 covers giving biome woods (including umbrel) their own planks.

**Design note (before building)** Cavern biomes are a second table in `strata_mapgen`, `mg.cavern_biomes`, picked per cell by `mg.cavern_biome_at(x, y)` from two 2D noises, only in the cavern layer. Unlike surface biomes they're patches in both x and y, so going deeper or sideways can take you into a different one. Between them is plain slate cavern, as today. | Biome | Floor | Floor flora | Ceiling growth | Notes | |---|---|---|---|---| | **Glimmer grove** | mycel turf | glimmercaps (small glowing fungi) | none | giant **umbrel** mushrooms: stalks drop wood, glowing caps | | **Prism gallery** | slate | prism clusters | hanging prism clusters | crystals glow and drop prism shards (a material for v0.5 gear) | | **Drowned grotto** | silt | none | dripvines (dim glowing vines, 1–4 long) | water pools are much more common | - Each row has its own floor cover, flora, ceiling growth, pool threshold and spawn table; `strata.spawn_candidates` reads it in the cavern layer (empty for now, filled in v0.4). - Flora glows (light 3–7), so you can read a cavern without a torch every few blocks. - Flora is held up by its floor or ceiling and drops when that block is dug. A whole dripvine goes when its ceiling is dug. I'm not using the engine's `attached_node`, because a vine hanging from another vine would drop on any neighbour update. - Glowspores from glimmercaps make torches with wood (1 + 1 → 3), so you can light a base without going back up for gel. - All names and art are Strata's own. `df_caverns` was only a reference for the general idea (layered caverns with their own flora). No code or media from it is used, so `CREDITS.md` has nothing to add. Follow-up: #72 covers giving biome woods (including umbrel) their own planks.
eric closed this issue 2026-11-15 06:25:07 +00:00
Author
Member

Done in d128a0d.

What changed

  • strata_mapgen: mg.cavern_biome_list / mg.cavern_biome_at(x, y), which picks plain cavern, glimmer grove, prism gallery or drowned grotto per cell in the cavern layer. Floors, flora and ceiling chains are part of mg.node_at. Giant umbrel mushrooms are grown in a pass like trees (mg.mushrooms, mg.mushroom_cells), one candidate column per 8.
  • strata_core/caverns.lua: mycel turf, silt, strata.register_flora (glimmercap, prism cluster on floors and roofs, dripvine), glowspore and prism shard items, and the umbrel stalk and cap (register_tree now takes leaves_light and leaves_drawtype). Flora glows at light 3–7 and drops when its floor or roof is dug. A hanging chain drops below the cut.
  • Glowspore + wood → 3 torches, by hand.
  • strata.spawn_candidates(y, tod, x) reads the cavern biome's table. They're all empty for now, ready for v0.4.
  • docs/DESIGN.md and the README are updated.

Measured (seed 1337): plain 31%, grove 28%, gallery 27%, grotto 14% of the cavern layer. The grotto has 24% of its open cells as water, against 9% in plain cavern. There are 68 umbrels per 800 columns. A shaft to the underworld is still about 167 s of digging with a copper pickaxe.

Tests: 6 new cases in tests/caverns.lua: the table, coverage, a node_at scan that checks every floor, flora and chain is supported, a generated site per biome compared cell by cell with flora light checked at midnight, flora support and drops, umbrel felling, and the recipe and spawn tables. The layer tests accept cavern biome nodes. 103/103 pass, zero ERROR lines.

Needs a look in the client: the plantlike flora is drawn as an X, so from the camera it shows at 45°. If it reads badly, a flat plate facing the camera, like the wall torches, is the fix. Also check how bright the groves are.

Follow-ups: #72 (biome woods, now including umbrel). Cavern creatures come with the v0.4 mob framework.

Done in d128a0d. **What changed** - `strata_mapgen`: `mg.cavern_biome_list` / `mg.cavern_biome_at(x, y)`, which picks plain cavern, glimmer grove, prism gallery or drowned grotto per cell in the cavern layer. Floors, flora and ceiling chains are part of `mg.node_at`. Giant umbrel mushrooms are grown in a pass like trees (`mg.mushrooms`, `mg.mushroom_cells`), one candidate column per 8. - `strata_core/caverns.lua`: mycel turf, silt, `strata.register_flora` (glimmercap, prism cluster on floors and roofs, dripvine), glowspore and prism shard items, and the umbrel stalk and cap (`register_tree` now takes `leaves_light` and `leaves_drawtype`). Flora glows at light 3–7 and drops when its floor or roof is dug. A hanging chain drops below the cut. - Glowspore + wood → 3 torches, by hand. - `strata.spawn_candidates(y, tod, x)` reads the cavern biome's table. They're all empty for now, ready for v0.4. - `docs/DESIGN.md` and the README are updated. **Measured (seed 1337)**: plain 31%, grove 28%, gallery 27%, grotto 14% of the cavern layer. The grotto has 24% of its open cells as water, against 9% in plain cavern. There are 68 umbrels per 800 columns. A shaft to the underworld is still about 167 s of digging with a copper pickaxe. **Tests**: 6 new cases in `tests/caverns.lua`: the table, coverage, a `node_at` scan that checks every floor, flora and chain is supported, a generated site per biome compared cell by cell with flora light checked at midnight, flora support and drops, umbrel felling, and the recipe and spawn tables. The layer tests accept cavern biome nodes. 103/103 pass, zero `ERROR` lines. **Needs a look in the client**: the plantlike flora is drawn as an X, so from the camera it shows at 45°. If it reads badly, a flat plate facing the camera, like the wall torches, is the fix. Also check how bright the groves are. Follow-ups: #72 (biome woods, now including umbrel). Cavern creatures come with the v0.4 mob framework.
Sign in to join this conversation.