Skip to content

Caves and Underground

Roi Horowitz edited this page Nov 23, 2026 · 9 revisions

Caves and underground

Animater can make a dungeon feel lived in, with moving air, vermin, dripping water and things in the dark.

What counts as underground

A scene is underground when you tick Scene configuration → Animater → Underground, or when its Acoustics is set to hall or cave. Rooms under a roof region count as under a ceiling too, so dust can fall there.

Underground per level. New in 3.7.0. In a scene with levels, each level can say for itself, in its own level settings: Underground (Animater) is As the scene (the default, which names what the scene is), Underground or Above ground. That gives a cellar under a farmyard, or an upper floor over a dungeon.

Underground, the sun and moon don't reach the floor except through a region marked Open to the sky.

Features that work on the whole scene

These need only an underground scene:

Feature What it does
Drafts The air flows through every open door toward the way out. Opening a door sends a gust that settles into a steady draft. A sealed room's air stands still.
Smoke in the air The fires' smoke gathers in their rooms, never through a wall or a shut door, and streams out of open doors along the draft. A haze only: it changes nothing in play.
Rats and bats Rats scurry along the walls, keeping out of the light. A few bats flit overhead. A few walls have rat holes (see below).
Moths and crawlers Moths loop round fires. Beetles and a centipede run along the foot of the walls.
Eyes in the dark A pair of eyes glints back from the dark, and is gone when a light or creature comes near. Scene configuration sets how often: Now and then (default), Often or Never.
Soot over torches The wall behind each fire light against a wall is blackened.
Pebbles underfoot A step on stone or earth now and then kicks a pebble ahead.
Dust from the ceiling A heavy creature's step shakes grit down around it. Also in rooms under a roof.

Moths can also come to one light on any map. See Fire and Lights.

Real smoke in place of the haze

New in 4.4.0. A scene can fill its rooms with smoke that counts: Scene configuration → Animater → Fires fill rooms with smoke, which needs Breakable props and Fire spreads on too. On an underground scene where all three are on, that smoke replaces the Smoke in the air haze: you get one smoke, the simulated one, round by round from what is burning and from fire lights ticked Fills the room with smoke. Where any of the three is off, the haze rolls as it always has. Smoke is a room's: a fire out of doors fills nothing.

A cave counts as rooms too. A very large open cave, over about 1200 squares, airs out as if it were a room of that size, so an enormous cavern clears a little faster than it strictly should (the changelog's figure). See Fire and Smoke.

Rat holes

New in 4.6.2. A rat turns at every wall, so without help the rats in a room stay in it. Now a few of a scene's walls are gnawed through, with a dark arch painted at the foot of the wall:

  • Where: walls at least a square and a half long, with the dark on at least one side, spaced well apart. A scene has at most three to eight, more on a map with more wall to run along, and none where rats are kept out.
  • What a rat does: one that has been in the same room about twelve seconds runs to the nearest hole it can reach without crossing a wall, slips in, and a few seconds later comes up, nose first, out of one of the holes furthest away, on its darker side.
  • Always the same holes: they're worked out from the walls themselves, so a map has the same holes each time it opens, and nothing is saved to the scene.
  • Orders win: a rat given an order by the GM forgets its errand. New in 4.4.0: rats and bats take the same orders as other animals (right-click one: Go here, Follow token, Circle token, Let it go), and underground the Animals panel's Place by hand offers Rat and Bat. See Wildlife and Town Life.

Read from the code, not tested live.

Features you place with a region

Cave effects are set in the region panel: as GM, quickly right-click the region on the map. Choose Cave as the kind and its Cavern section comes first.

The Cavern section

New in 3.7.0, moved into the region panel in 3.8.0. A cave region can be adjusted much as a floor is:

Setting What it does
Holds Fungus, Crystals, Lava or Mist. Shown on a Cave region with no floor of its own, unless a step has switched the effect on.
Colour or Stone Fungus: Green, Blue or Violet. Crystals: Amethyst, Quartz or Rose.
Stage Fungus: Dormant, Growing, In bloom. Crystals: Dim, Awake, Blazing. Mist: Thin, Low, Thick. A region with no stage saved shows the last.
Size 40% to 300%. Fungus stops at 200%.
How many 20% to 400%. For mist, how thick it is.
More: cobwebs, steam, bad air… Cavern, a list of every cavern effect, below.

Regions made before 3.7.0 look as they did.

Cavern effect What it does
Mist on the floor Low mist hugs the floor and parts as you walk through it. New in 3.7.0: it's there as soon as the map opens, after a change of scene or level, instead of slowly gathering again.
Glowing fungus (green, blue, violet) Clusters that breathe brighter and dimmer. Brushing past dims them for a few seconds. New in 3.7.0: the glow never shows over a creature standing on it. It stays dim, without flashing, while they stand there, and brightens once they've gone.
Crystals (amethyst, clear quartz, rose) Grow from the region's walls, lit as they turn toward a nearby light.
Lava A black crust over molten rock. Lights the rock around it orange. See Lava floors.
Cobwebs Hang in the corners and stir in the draft. Now and then a spider lowers itself. New in 3.7.0: about one spider to every three webs, up to eight.
Wet walls Water seeps down the walls and glistens.
Steam vents Steam breathes up from cracks and drifts off on the draft.
Bad air A sickly haze. Fires in it burn low, and their light reaches less far on every screen.

Cobwebs, wet walls, steam vents and bad air can dress any room, not only a cave: on another kind of region they are Room dressing in the panel's Air section.

Lava floors

New in 3.7.0. Read from the code, not tested live.

Lava is a floor of its own. Choose Lava as the region's kind, or Lava under Holds in a cave. Regions already set to lava became lava floors.

  • It walks as a floor, with embers kicked up underfoot. It uses stone's footstep sounds for now.
  • Its steps are Crust, Cracking and Molten, so a chamber can fill or cool. Crust walks as stone. See Region Steps and Painted Floors.

In code and in older notes this floor is called Cavern. The floor list's label reads "Cavern (lava; right-click it for fungus, crystals or mist)", but in the panel it shows as Lava.

Other region settings

Setting Where in the panel What it does
Drips from the ceiling Drips Water drips into a pool filling the region. Pace: Slow, Steady, Fast or Trickle. Pool: Puddle, Pool or Deep. A pool or deep water counts as a water floor for creatures walking through. Dripping sound turns its sound off.
Open to the sky Air A hole in the ceiling, a shaft or a cave mouth. Weather reaches the floor as wet ground, puddles and snow, with daylight or moonlight falling in. Lightning can come down through it. Falling rain and snow, fog and cloud stay out of the room. It can hold a window, such as a glass skylight or an iron grate.
Opens to the outside Air A way out: stairs up, a cave mouth, an air shaft. The air flows toward it. Doors on the scene's edge standing open, and regions that lead elsewhere (teleport, change level), count without this.
Climate Air New in 3.7.0. Cold makes breath show only in this region, such as a cold cave.
Keep out Animals Creatures that never come in. See Wildlife and Town Life.

A region step can also switch most of these on during play.

Cave-ins and blasts (GM)

Cave-in is a button in the Animater controls. Click where the ceiling comes down, and scroll to size it. The view shakes, rocks fall, dust rolls out, and the rubble stays. Clear rubble takes it away, with any burrow holes, after asking you. Changed in 4.6.0: it's in the Tidy up list (the broom button in the Animater controls), beside Clear ground marks and Repair broken props. Since 3.8.0 these are only in the controls: Region configuration no longer has them.

Energy blast is also in the Animater controls. Pick a kind (fire, cold, lightning, acid, force, void, radiance, sound, poison or the mind), scroll to size it and click. You get a flash, a shockwave, the energy and a mark left behind.

Fire melts snow. New in 3.3.0, and not tested live. An Energy blast of fire melts the lying snow where it lands, with an uneven edge. It's only a look and nothing is saved. The snow clears in about a second, then fills back in by the game clock, and only while snow is falling. See Snow and Wet Ground.

Both are a show only: no one is hurt. Energy blasts are heavy on the graphics card for the few seconds they play.

Doors

Bats or rats can burst through a door as it opens. See Windows and Doors.

Settings

Setting Everyone (GM) My screen Choices or range What it does
Drafts On On — In an underground scene (or one with a region marked as open to the outside), the air flows through every open door toward the way out: dust streams with it, sparks are carried along, smoke drains out. Opening a door sends a gust that settles into a steady draft; a sealed room's air stands still. Drawn at Balanced quality or better.
Smoke in the air On On — In an underground scene, the fires' smoke gathers in their rooms in slow rolling layers, lit by the fires, never through a wall or a shut door, and streams out through the open doors along the draft toward the way out. Drawn at Balanced quality or better.
Rats and bats On On — In an underground scene (Scene configuration → Animater: underground, or cave or hall acoustics), rats scurry along the walls, keeping out of the light and scattering from anyone who comes close, and a few bats flit high overhead. A few walls are gnawed through: a rat that has been in one room a while slips into a hole and comes up out of another, somewhere else on the map. Drawn at Balanced quality or better.
Rat and bat sounds On On — The rats' claws and squeaks, sharper when one bolts, and the bats' wings and chirps, quietly and a few at a time, only near enough to be heard, ringing in the room and muffled by walls. With Rats and bats on.
Moths and crawlers On On — In an underground scene, moths loop round the fires, their shadows flicking over the floor, and beetles and a centipede run along the foot of the walls, freezing and darting off, keeping out of the light. On any other map, moths come to a light set to them (Light configuration → Animater → Moths: On). Drawn at Balanced quality or better.
Eyes in the dark On On — In an underground scene, now and then a pair of eyes glints back from the dark at the edge of the view, blinks, and is gone when a light or a creature comes near. Drawn at Balanced quality or better.
Soot over torches On On — In an underground scene, the wall behind each fire light standing against a wall is blackened with soot, spreading along it. Drawn at Balanced quality or better.
Pebbles underfoot On On — In an underground scene, now and then a step on stone or earth kicks a pebble skittering ahead, bouncing and rolling to a stop. Drawn at Balanced quality or better.
Dust from the ceiling On On — Under a ceiling (an underground scene, or a room under a roof), a heavy creature's step shakes grit and dust down around it, settling on the floor: more and wider the bigger it is. Drawn at Balanced quality or better.
Dripping water On On — Where a region is marked as dripping (the region's right-click panel → Drips), water drips into dark, glistening puddles, each drop sending out a ring. Drawn at Balanced quality or better.
Cavern mist On On — Where a region is marked as mist (the region's right-click panel → Cave), low mist hugs the floor and drifts; walking through parts it, the trail closing slowly behind. Drawn at Balanced quality or better.
Glowing fungus On On — Where a region is marked as glowing fungus (the region's right-click panel → Cave), clusters of small glowing caps grow on a faint web of threads, breathing slowly brighter and dimmer; brushing past dims them for a few seconds. Green, blue or violet. Drawn at Balanced quality or better.
Crystals On On — Where a region is marked as crystals (the region's right-click panel → Cave), clusters of crystal grow out of its walls: dull in the dark, each face lit as it turns toward a nearby light, flashing when one lines up. Amethyst, clear quartz or rose. Drawn at Balanced quality or better.
Lava On On — Where a region is marked as lava (the region's right-click panel → Lava), a black crust drifts in plates over molten rock glowing up through the cracks; bubbles burst, the rock around is lit orange, and the air shimmers over it (with Heat shimmer). Drawn at Balanced quality or better.
Cobwebs On On — Where a region is marked as cobwebs (the region's right-click panel → Cave, or Air → Room dressing for any other region), dusty, torn webs hang in the corners of its walls and stir in the draft; now and then a spider lowers itself on a thread and climbs back. Drawn at Balanced quality or better.
Wet walls On On — Where a region is marked as wet walls (the region's right-click panel → Cave, or Air → Room dressing), water seeps down the walls: a dark wet band at their foot, with runs out from it, glistening where the light catches it. Drawn at Balanced quality or better.
Steam vents On On — Where a region is marked as steam vents (the region's right-click panel → Cave, or Air → Room dressing), steam breathes up from cracks in the floor, warm-lit, now and then puffing out in a burst, and drifts off on the draft. Drawn at Balanced quality or better.
Bad air On On — Where a region is marked as bad air (the region's right-click panel → Cave, or Air → Room dressing), a sickly haze hangs, swelling and thinning, leaning down the draft; the fires in it burn low, their light reaching less far. Drawn at Balanced quality or better.
Light through openings to the sky On On — In an underground scene, where a region is marked as open to the sky (the region's right-click panel → Air → Open to the sky: a hole in the ceiling, a shaft, a cave mouth), daylight falls in as a pool on the floor with a faint shaft of light and dust turning in it, away from the sun and longer when it is low; golden at dawn and dusk, silver moonlight at night. Nowhere else underground does the sun or moon reach. Drawn at Balanced quality or better.
Cave-ins On On — The GM can bring a ceiling down (the Cave-in button in the Animater controls, scroll to size it): the view shakes, rocks fall and bounce, dust rolls out on the air, and the rubble stays where it fell. Drawn at Balanced quality or better.
Energy blasts On On — The GM can set off a blast of fire, cold, lightning, acid, force, void, radiance, sound, poison or the mind (the Energy blast button in the Animater controls; scroll to size it): a flash, a shockwave bending the floor, the energy, and a mark left behind. A show only: no one is hurt. Heavy on the graphics card for the few seconds it plays. Drawn at Balanced quality or better.

How many rats, bats, moths and crawlers a scene has is set in the Animals panel. A region can ask for its own rats and bats in its panel's Animals section. See Wildlife and Town Life.

Smoke in the air stands down on a scene where Fires fill rooms with smoke is really running (with Breakable props and Fire spreads on), and comes back when it isn't. See Real smoke in place of the haze.

See also

Fire and Lights · Fire and Smoke · Wildlife and Town Life · Sounds and Voices · Region Steps and Painted Floors · Scene and Region Options

Technical details

For developers and the curious. Read from the 3.2.2 code, with 3.3.0's changes added, the 3.7.0 to 3.8.0 changes checked against the code after 3.8.12, and rat holes and the smoke handover read from the 4.9.0 code, and not run or measured.

Source: scripts/core/underground.mjs (whether a scene or level is underground), scripts/engines/motion/ cavern.mjs, indoor-air.mjs, underground-life.mjs, vermin.mjs, ceiling-dust.mjs, energy-blast.mjs and webs.mjs. Wiring is in scripts/main.mjs.

Quality. All go through bothSettingsOn: world and ...Local switches on and rank at least 2. Full, Light and Balanced draw the same, and Low and Off draw none.

Cavern

One module holding fungus, crystals, lava, mist and skylights. Layout is seeded from the scene id, so the same areas grow the same fungus, and nothing rendered is saved. A rebuild clears and rebuilds everything, after a 600 ms debounce on scene, region, wall and setting changes.

Pass Approach Layer, blend
Fungus caps Mesh, uPass 0, one quad per cap caveFloor (648), Normal
Fungus glow Same geometry, uPass 1 Glow, ADD
Crystal light Mesh of triangles with normals, lit per fragment Glow, ADD
Crystal stone PIXI.Graphics, drawn once caveFloor
Lava Quad per area, same shader twice caveFloor Normal, glow ADD
Mist Quad per area caveFloor, Normal
Skylight Quad per opening Glow, ADD

Uniforms. uTouch[12] holds where creatures were lately. uLights[8] and uLightCol[8] feed the crystals, from the 8 lights nearest the view's middle. Lava uses a Worley-style cell pattern and a 5-stop colour ramp.

Masks. RenderTextures at min(0.25, 1024 / longest side).

Cave stages (new in 3.7.0). CAVE_DECOR in region-steps.mjs holds each kind's stages, and caveLook multiplies the region's caveSize and caveAmount by the stage's own scale and amount. Saved as cavern (kind and tone, such as fungus-blue), caveStep, caveSize and caveAmount. An unset stage is the last one, so older regions keep their look. Lava is a floor (floor: lava) with ordinary steps whose effects are lava-crust, lava-cracking and lava, and LAVA_HEAT sets crust 0.05, cracking 0.3, else 0.6.

Fungus under creatures (new in 3.7.0). The glow pass reads uCover, a quarter-resolution picture of what stands over the floor, and never shows through it. Touches are kept fresh for as long as a creature stands in place, so the caps stay steadily dim and brighten only after it leaves.

Mist on a new scene (new in 3.7.0). The mist shader has no gathering ramp: its thickness doesn't depend on time, so a bank shows at full strength on the first frame. Inferred from the shader, not tested. restart on canvasTearDown only zeroes the clock.

Mist parting. A CPU Float32Array trail at a quarter square per cell, uploaded at most every 0.08 s and only while dirty.

Comment and code differ: the header says "a frame only moves the clock". tick also advances the door pull, the draft crossfade and the mist trail upload.

Drafts

A CPU simulation handed to the GPU as a small picture, not a draw pass. Cells default to half a square. draftField walks out from the openings, gathers flow downhill and blends directions twice. draftPixels packs RG direction, B speed and A gust delay per cell.

The rebuild is debounced by 250 ms, and a door opening sets the gust source for 12 s. Lamp air and cavern mist read it as a texture, while webs and underground life read it on the CPU. The mist crossfades old and new fields over 5 s.

Underground life

Mostly sprites, one layer of each: floor 649, above 765, plus the glow layer.

Thing Cap
Steam puffs 90
Pebbles 40, then the oldest go, with a 25 s life
Eye pairs 1, or 2 when set to often
Crawler paths 40
Stones per rubble heap up to 150 + 60 + 14 per fall

Rubble is saved: the last 24 cave-ins are in the scene's rubble flag, written by the GM. Each screen plays a fresh one on updateScene, and stones rebuild from the seed.

Rats and bats

Rats are a sprite, a PIXI.Graphics tail redrawn per frame and a shadow sprite, and bats a sprite and shadow. Pictures are painted once: rat 96×48 in 4 frames, bat 128×96 in 6. Bats ask about walls every third frame, in turn. Counts are an exact number set in the Animals panel when there is one (exactOr), else min(14, max(4, spots/20)) rats and 3 bats, each times the scene's scale.

Comment and code differ: the header says "a dozen at most", but the wiring allows up to 42 rats at the top scale.

Rat holes (new in 4.6.2). ratHolesAt in vermin.mjs (pure) walks the scene's walls and takes one where it is at least 1.5 squares long and a hash of its ends falls under share (0.4), at a hashed point 30% to 70% along it. It skips one lit above 0.5 on both sides 0.4 of a square out, and one within 2 squares of a hole already taken, up to count: max(3, min(8, round(spots / 30))) in the scene wiring, then filtered by the regions' rat keep-out. A rat goes for a hole every HOLE_EVERY = 12 s, to holeFor (the nearest it can reach with no wall in the way, within 14 squares), spends HOLE_UNDER 1.5 to 5 s out of sight, and comes up out of one of the four holes furthest away (holeOut), on the darker side (holeMouth). Nothing is saved. The hole picture is painted once on a 64×44 canvas.

Smoke handover (new in 4.4.0). The haze is drawn only while airHazeShows holds: the roomSmoke pair on, an underground scene, and the room-smoke simulation not running. That last test is smokeRunsOn in engines/props/smoke-round.mjs, which needs the scene's smokeFills, breakableProps and fireSpreads all on, so a scene with only the smoke switch ticked keeps its haze.

Webs

Per web, a container with a gauze sprite painted once, a fixed-strand Graphics drawn once and a loose-strand Graphics redrawn per frame, on sortLayer 690. Webs out of view are set invisible. New in 3.7.0: spiderHomes gives one spider to every three webs, rounded up, spread through the list, with MOST_SPIDERS = 8.

Ceiling dust

Sprites from two shared render textures, a 16 px chip and a 128 px cloud, on birdRoot. It's triggered by a footfall of weight at least 4, not sneaking, under a ceiling. Grit is round(30 + 90 * heavy) and puffs round(3 + 6 * heavy) per jolt. No cap across overlapping jolts was found.

Energy blasts

One shader, three meshes on one quad, with a half size of radius * 1.65:

Pass Layer Blend Purpose
0 sortLayer 490 Normal Floor bent and marked
1 sortLayer 770 Normal Smoke, ice, cloud over creatures
2 Glow ADD Light

There are 10 kinds, chosen by uType inside the fragment shader, whose loops include 24 embers, 26 sparkles, 14 bubbles and 8 arcs. uFloor is the map's own texture, so with no map picture there is no floor pass.

At SETTLED = 3.6 s the floor mesh is rendered once to a texture of at most KEPT_MOST = 2048 px and replaced by a sprite. The rest ends at ENDS = 5.6 s. At most 12 marks are kept. A comment says the shader "takes up to a second to prepare" the first time, so it's compiled once at canvasReady.

It arrives as an energy-blast socket message, accepted only from a GM. Nothing is saved.

Fire melting snow (new in 3.3.0)

A fire blast also melts lying snow. See the technical details on Snow and Wet Ground.

Clone this wiki locally