Underground Features

intermediate feature

Voxel Pyramid · Guide

Below and around the maze the generator carves a set of dramatic underground features.

Pyramid underground: the river grotto, stone bridge and golden vault door

Apex light shaft and strata

A grand central light shaft (oculus) runs up to the apex, letting daylight fall deep into the monument. The buried mass is filled in strata bands (deep granite, mid rock, upper sandstone) so cut walls read as layered geology.

Looking up the apex light shaft to the oculus

Lake, lava and cascade

The deep caverns hold an underground lake, a self-lit lava pool that conforms to the cavern floor, and a wall cascade. A plank bridge with a parkour gap crosses the lake cavern, and hanging vines drop from cavern and chamber ceilings.

A cavern bulge opened along the descent, with the lake and the bridge

The self-lit lava pool in the deepest cavern

The plank bridge and its parkour gap over the cavern lake

Hanging vines dropping from the cavern ceiling

Subterranean river grotto

When Enable River is on, a serpentine river grotto crosses below the maze, with a stone bridge on the axis, a portal from the burial chamber and a treasure vault on the far bank.

The subterranean river grotto running below the maze

With Sealed Vault on, the vault closes behind a golden offering door: strike it carrying enough gold (mine the gold trim bands with the pickaxe) and the tribute is consumed as the door dissolves.

Torches and braziers

Wall torches line the carved galleries (density and spacing are configurable) and braziers mark junctions and cavern floors. Placed lights register with Voxel Play so they actually illuminate the dark interior.

Creature spawner

Populating the tomb is a separate generator, Dungeon Spawner Generator, listed in the demo World Definition next to the pyramid. Keeping it apart means you can drop it into a cave system or a dungeon of your own, and remove it from the pyramid without touching the maze.

It works in depth bands: each band covers a range of maze floors (0 is the topmost) and carries its own prefab list, density and per-chunk ceiling, so a world can grow harder the deeper you go. Placement is deterministic per seed, picks spots with headroom over a solid floor, and keeps a minimum distance from the player. Because later generation passes can still close a spot, spawns are queued and revalidated before they land. A spot is only used when the body has room on all four sides, so nothing stands sunk into a wall or a corner, and a spot next to the player is kept rather than discarded: it is used once you have moved on, which is why the corridors you actually walk are populated too.

Breaking the nests

What the bands place is a spawn nest: a stone urn with a burning core, lit so you can pick it out down a dark corridor. While it stands it keeps letting creatures out, swelling for a moment before each one so you can read what is coming, and it releases into an open cell beside itself rather than on top of you. Break it with the pickaxe and the flow stops for good, so clearing a room means dealing with the source, the way Gauntlet handles its generators.

The nest is an ordinary breakable: DungeonSpawnNest for the releasing, DungeonDamageTaker for the hit points. Swap the urn for your own model, or drop the nest from a band and put creatures straight in the prefab list instead.

Every field of the spawner and of the nest, with its default, is listed in Generator Settings; how it decides where a creature may stand is in How Generation Works.

The demo ships one creature, DungeonBlobCreature: it hops toward the player along the corridors using voxel probes rather than a NavMesh, since a streamed procedural world has none, and detonates on contact or when it goes down, cratering the tomb around it. It is a worked template to replace with your own creature and AI, not a finished enemy.

Melee framework

The demo includes a minimal combat loop so a spawned creature can actually be fought, following the same shape Voxel Play games use: cast a ray from the camera and, when it lands on a collider instead of a voxel, look for something that can take damage. Mining is untouched, because voxel hits still go through Voxel Play itself.

ComponentRole
DungeonMeleeAttackOn any scene object. Resolves a swing and applies the equipped item's hitDamage, which is why the pickaxe hits harder than bare hands.
DungeonDamageTakerOn anything that can be struck. Tracks hit points, reports each hit to the console, raises onDamaged and onDefeated, and removes the object at zero.
// react to hits from your own code
var target = creature.GetComponent<DungeonDamageTaker>();
target.onDamaged.AddListener((damage, remaining) => PlayHurtAnimation(remaining));
target.onDefeated.AddListener(() => DropLoot(creature.transform.position));

Both are deliberately small: there is no health bar, no aggro and no death animation, so the framework stays out of the way of whatever combat your game already has.

Was this page helpful?