Skip to content
Roi Horowitz edited this page Nov 23, 2026 · 24 revisions

Water

Water in Animater is a region you draw over the map. You make it a water region and then decide what kind of water it is.

New in 3.8.0: all water is moving water. Every water region on every scene has the live surface, with waves and the map bending under them. There's no longer a scene option to turn it on, or a region switch to turn it off. The older still look only shows where moving water isn't drawn: on a screen at Low quality, or with the Moving water setting off.

Making a water region

  1. Draw a region over the water.
  2. As GM, right-click the region on the map, on the Tokens or Regions layer. Its region panel opens by the pointer. See Region Steps and Painted Floors for the panel itself.
  3. Pick Water as what the region is. A region named for water (river, lake, pond, sea, stream, swamp) with no floor of its own counts as water already.
  4. Open its Water section and choose the kind.

It works on any scene, including one with no map image, where the water brings its own colour.

New in 3.8.0: the region panel replaces the old right-click step menu and the Animater tab in Region configuration. That tab now only points to the panel and opens it.

To find water on a map for you, use the experimental Floor Regions generator. It took over the old water detection in 3.8.0 and now finds other floors too.

You can also paint water straight onto the map with Map Painting's Floors tab. Pick water, then which kind of water new regions are. Each kind is its own to the brush: a still pool, a river, rapids, a waterfall and the sea are kept apart, so a stroke only grows water of the kind you picked, stays off the other kinds as it stays off grass or stone, and rubs out only its own kind. To rub out a lake, pick the lake's kind first. New in 4.5.8. Before, a waterfall painted against a lake was folded into it as still water.

The kinds of water

Pick these in the region panel, under Water → Kind.

Kind What it's for Flow
Pond Lakes and ponds. The default when nothing says it flows. None
River A river's current follows its banks, so the direction mostly picks which way along them it goes. Flows toward
Rapids Fast water. Set to Swift. Nothing lives on it. Flows toward
Falls Water drops into a pool, with foam and rings where it lands. It's as loud as its stream is strong. Set to Swift. Nothing lives on it. Flows toward. With the wind, it takes the nearest compass direction and turns only when the wind really turns.
Sea Waves swing round to the shore, crowd in the shallows and arrive in sets. Waves toward: a compass direction, or With the wind

The rest of the Water section:

Control What it does
Flows toward and Current A compass of eight directions, with the wind in the middle, and a speed: Very slow, Slow, Gentle or Swift. Rivers, rapids and falls. North is up the map. When the step showing has a current of its own, a note under Current says so and offers Use the river's to go back. See Current here.
Waves toward and Beach along the shore Sea only. With the beach on, Animater's own sand runs up to a wandering waterline. With it off, the map's own ground shows through the shallows and the water fills its region to the edge.
Depth Shallow, Medium, Deep, Very deep or Clear turquoise. Changes the look only. Not on falls. New in 3.5.0: Clear turquoise uses the water's own colours, not the map's, from pale turquoise to deep blue.
Reflections Off stops reflections in this region.
Freezes in the cold Off keeps it open in a hard frost, like a hot spring.
Thin ice Ice that holds a light creature and breaks under a heavy one, with Holds up to and Refreeze below it. Off unless you turn it on. See Thin ice. New in 4.4.0.
Water sound Off silences this region's water.
More: drips, coast, waterfall… Drips from the ceiling, and the two older effects below.

The region's Animals section has its own Animal sounds switch.

Current here

When a step on a water region changes how fast it runs, the Steps section shows Current here: As the river (the Current set under Water), or Very slow, Slow, Gentle or Swift while that step shows. It uses the same words as Current, so the two can't be read as different things. New in 4.3.0: it was called Speed, and the Water section didn't say a step was overriding the river.

Thin ice

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

A water region can be thin ice: frozen over whatever the weather, safe for a light creature and dangerous for a heavy one. It's for one region on one scene, and off until a GM turns it on.

Turning it on. Right-click the region, open its Water section and turn on Thin ice. The region has to be water. Then pick Holds up to: Tiny, Small, Medium (the default), Large, Huge or Gargantuan, the sizes on an actor's sheet. Gargantuan holds every creature, so it's a way to say "frozen hard here" without turning the switch off. While thin ice is on, the region's Steps section only shows a note, because the ice sets the step, and the step's heading reads Frozen over · thin ice. Taking the region out of water turns thin ice off.

Who goes through. The ice goes by the creature's size as its system names it. For a system with no sizes it goes by the token's width, and a creature whose size can't be found is treated as safe.

  • The size you picked, or smaller, is always safe.
  • One size over cracks each square it walks onto, once per crossing. Fresh ice only ever cracks. The ice gives way where it was already cracked: a square this same walk cracked a few squares back, one an earlier move cracked, or one another heavy creature cracked. So a creature one size over can cross a lake it has never walked on and leave only cracks, but it goes in if it crosses its own tracks or someone else's. Standing still on a cracked square is safe, because nothing new is entered.
  • Two or more sizes over breaks the ice at the first square it walks onto.
  • The square a creature starts on doesn't count as entered.

Nothing waits for a move to end, so the ice acts the same however Foundry reports the walk. For a creature with an even number of squares across, the ice reads its weight on the square nearer its own corner, which keeps a Large creature's hole behind it as it walks on.

What leaves it alone. Flying, burrowing, swimming, teleporting and blinking across (Foundry's displace) don't touch the ice, and nor does a move above or below the level's own floor.

What a break looks like. A jagged hole of dark water about the creature's width plus a square. The ice that was there floats on it as plates: a few big angular slabs split along straight lines, still nearly fitting together, pale on top with the edge of their thickness showing, the water in the seams widest where the creature went in. They tilt and swing slowly on the water, and the water's ripples run under them. Cracks are drawn as crack lines on the ice. Every screen draws the same cracks and holes, because they're saved on the region.

What the table sees and hears.

  • CRACK! floats up off a square as it cracks, and THROUGH! off one that gives way, on every screen. A square that cracked and gave way in the same move only says THROUGH!, and at most 8 words show at once.
  • A break sounds as the ice giving way, then a body going into the water a moment after, heard up to about 18 squares away and muffled by walls. There are three recordings of ice and four of water, and every screen picks the same pair for the same hole. However many squares go at once, one break is heard.
  • Cracking makes no sound. A hole melted by fire is silent, and so is coming to a map whose ice is already broken, or reloading it.
  • Code and changelog differ: the changelog speaks of a whisper to the GM for each crack and break. The code sends nothing to chat: the words and the break on the map are all there is.

Inside a hole. The floor there reads as water, so footsteps and the movement feel treat it as water. A creature standing in the hole on the level's floor is drawn sunk, as one under water, while Submerged token appearance is on. With that setting off it isn't drawn sunk. Its elevation never changes. Nothing changes HP and no condition is applied: the system's own swimming rules are yours to call.

Fire melts it. A fire area over thin ice melts the squares it covers to open water with a slushy edge. It needs Breakable props on for the scene, so with Breakable props off a fireball on thin ice does nothing. Thin ice that's already broken there keeps its hole.

Putting it back. Cracks and holes stay until a GM clears them. Refreeze, under Holds up to, asks first, then freezes over every crack and hole in that region. Repair broken props clears the thin ice of every region too. After either, the floor stops reading as water.

Who judges it. Only the active GM's screen watches the moves and writes the cracks and holes, so a GM has to be connected. Melting goes through the active GM too.

Keeping to the region

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

  • Soft edge, new in 3.3.3, can be turned off for a hard edge along the region's own line. It's in the panel's Look section, under More: soft edge…. See Region Steps and Painted Floors. A sea with a beach still has its wandering waterline.
  • Moving water with a floor texture stops at the region's edge and leaves holes clear, such as one left for a pier or boats. It used to spill past the edge and cover them, and Edge softness can no longer carry it out.
  • The older still look (at Low quality, or with Moving water off) reaches nearer its edge.
  • Narrow holes stay clear in every painted region look, not only water. See Region Steps and Painted Floors.
  • Waves are cut off at a small hole and carry on past it, as if running under it. A hole only makes a shore when it's several squares across.

Small seas

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

  • Without a beach, a sea's waterline runs along the region's edge rather than a rounded line inside it. This holds for a sea of any size.
  • Narrow water, up to about a dozen squares across, has its shore and shallows scaled to the distance from its middle to its nearest shore, so its middle no longer reads as shallows. A side along the map's edge doesn't count as a shore. Its waves cross it one way, as below.
  • Wider seas with a beach look as they did.

Waves that break

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

On a small sea, or a sea with Waves toward set to a compass direction, waves cross one way and break on a shore ahead of them. The shore they left stays calm. A small sea here is one narrower than about a dozen squares, as above.

To see breakers, raise the wind. With no wind there are none. The wind is the Strength in the Weather Panel, or the weather's own.

  • What a breaker looks like: a sharp bright front, foam behind it that ages into lace, a dark band ahead of the crest and pale water behind.
  • Timing follows the wind, as on the Beaufort scale: a wave about every 2.5 seconds in a light air, up to about every 8 seconds in a gale. They cross at a steady pace of about 0.9 squares a second, a little slower on very small water. A change of wind takes about 20 seconds to come through.
  • In a light air there are no foam lines, only ripples, soft bands and drifting gusts, and a lip of foam if there's a drawn beach.
  • A large sea following the wind, with no compass direction in Waves toward, keeps its older foam on every shore.

Waves breaking on a ship

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

Tick Animater: waves break on it in a tile's configuration, on its Appearance tab. A sea's waves then burst white along the edge of that tile's picture on the side they come from, a stretch at a time as each wave arrives, and its far side lies calm. It's meant for a ship or a rock standing in the sea. It's off unless ticked.

  • It works on a water region whose kind is Sea, while moving water is drawn. Other kinds of water ignore it.
  • It goes by the tile's own picture, so it follows the hull's shape, not the tile's frame. Moving, turning, scaling or changing the picture redraws it.
  • A hidden tile takes no waves.
  • More wind makes the bursts stronger.

Docks, bridges and rafts

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

A dock, a bridge or a raft is a region with Over water on. In the region panel, pick Ground as what it is, then turn on Over water in its section. Since 4.0.0 there's no separate Dock kind. A dock shows as Ground, and its dock settings appear in the Ground section while Over water is on. Docks made before keep working. The Floor Regions generator can also make a region with Over water on.

Leave it off for a beach or sandbar laid over a sea.

  • It hides moving water from view, sharply, wherever the two overlap, even if the region reaches past the water. The water, its waves, shores and depth run on unbroken beneath it as if it weren't there, at any width, so it never makes a shore.
  • It has a floor of its own. Turning Over water on gives it wood unless it already has a floor you can stand on, so its floor wins for footsteps over the water. Change it with Floor, whose list leaves out water and lava.
  • Built as shows for a wood, stone or metal floor: Plain, Old boards or Railed pier. Old boards and a railed pier show edge boards, planks and beam ends. With either, Posts stands posts along the long edges, in the water with ripples. Posts are on until you turn them off.
  • Where regions overlap, the panel gives each a tab, so the dock and the water under it can both be reached from the map.
  • Below it, only a swimmer is in the water. A creature below the region's elevation counts as on it unless it's using the Swim movement action. Above the region's top, it no longer counts as on it. A region without Over water keeps the plain elevation rule. The water is drawn under the region at every elevation.
  • It only hides moving water. Where the older still look is drawn instead, a painted look on the water still shows over it.
  • Swimmers keep out from under it at any elevation: ducks, fish and frogs. Turning it on is noticed at once. Birds in flight can still pass over it.
  • No reflections on its deck, new in 3.7.6. A creature standing on it isn't wading. See Reflections.

Shadows on the water

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

A region with Casts a shadow on throws a shadow on moving water under it. That's on by default for a region with Over water. For a dock, the switch, its Shadow type and, under a More line, its Softness and Darkness are in the Ground section below Over water. See Region Steps and Painted Floors for the types.

  • On moving water, the water draws the shadow, deep blue with the waves still showing. It trembles with the waves and the sun's glitter stops in it. With little sun it's fainter.
  • Length comes from the region's bottom elevation minus the water's bottom elevation, and with several regions on one water, all use the highest. A shadow only separates from the deck once its offset is more than the deck's width.
  • Several regions over one water each keep their own type, softness of edge and darkness. Soft patterns inside the shadows are shared, at the softest of them.
  • Casts a shadow without Over water shades the water but doesn't hide it.
  • A painted dock: the water runs a little under its edge, so no gap shows.

A ship's deck traced on a tile

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

The Floor Regions generator can trace a region on a tile, such as a ship, as well as on the map. See that page for how. For the water, a deck traced this way acts as any dock does while its tile is shown.

A deleted or hidden tile leaves nothing behind. While the tile is gone or hidden, a region traced on it draws nothing: no painted floor, no shadow and no cut in the water. The water reflects there again, animals can swim there and creatures wade there. The region itself is kept, so showing the tile again brings the deck back.

The older effects: coast waves and waterfall spray

In the Water section, under More: drips, coast, waterfall…, two switches draw their own effects, separately from the kinds above. Choosing the Sea or Falls kind doesn't turn them on, and turning them on doesn't choose a kind. They were the This is the sea and This is a waterfall ticks in Region configuration.

Switch What it adds Controlled by
Coast waves and tide Waves washing in and drawing back, wet sand that moves with the tide over the game's day, and crabs on the shore. The coast setting
Waterfall spray Falls the way Flows toward points, with foam at its foot, mist on the wind and a rainbow in the spray when the sun is out. While the Waterfalls setting is on, it replaces the moving water in that region. Waterfalls setting

Use whichever gives the look you want, or both.

Which water has which animals

  • Gulls live only over water marked as sea, by either the Coast waves and tide switch or the Sea kind. They're never on rivers or ponds, however wide.
  • Ducks and frogs keep to fresh water. New in 4.0.0: on a map with both a sea and a river or pond, a duck no longer lands on the sea or paddles out into it. Only when a map has no fresh water do ducks wait on the sea.
  • Herons and lily pads keep to fresh water.
  • Fish swim in water, and can leave and return where water reaches the map's edge. New in 3.8.12: one that swims off the map is replaced within seconds (5 to 15 for the first, then 6 to 20 each), and one a heron catches within 20 to 45 seconds, so a river running off the map keeps its fish.
  • Fish seen through moving water show as the painted fish, tinted by the water, not as a dark shape. New in 3.8.0.
  • Nothing lives on rapids or falls.
  • Animals need Outdoor life on for the scene, or a region's own animals. See Wildlife and Town Life.

What water reacts to

  • Swimmers, footsteps and animals send out rings. Swimmers leave a wake.
  • Submerged creatures fade to a blue silhouette (Submerged token appearance). See Movement Effects.
  • Blood clouds out and dissolves, carried along by any current. See Blood and Aftermath.
  • Water freezes in a hard frost, unless Freezes in the cold is off. See Snow and Wet Ground.
  • Region steps can turn it bloody, oily, boiling or poisoned. See Region Steps and Painted Floors.
  • The sun glints on it. Torches, lamps and the moon glint on it as described under Glints from lights and the moon. Under a roof it gets no sun or moon and barely stirs.
  • Thin ice cracks and breaks under heavy creatures. See Thin ice.

Painted floors and water

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

Moving water is drawn under painted floors. Where water lies inside a larger painted floor, such as a pond in a painted meadow, the floor is opened over the water so the pond shows. Before 4.8.0 the meadow covered it.

  • Which floor lies on which. The biggest painted floor lies at the bottom and smaller ones on top of it: a road on its meadow, a room's boards on the yard round it. Floors of the same size go by their ids, so every screen and every reload puts them in the same order.
  • Smaller water opens the floor. A floor is opened only over water smaller than itself that reaches it. A floor smaller than the water it lies on, such as an islet or stepping stones, stays on top of the water.
  • Anything built over water (a region with Over water, such as a dock) is never opened.

Sounds

  • Flowing water (a river, rapids, or any water with Flows toward set) plays running water, gentle or swift by its Current.
  • Ponds play soft lapping water, like a quiet lake shore. New in 3.8.7, changed in 3.8.8.
  • Swamps play insects and slow mud bubbles instead. That's a pond whose floor Texture style is Swamp, in the region's Look section. New in 3.8.8.
  • Falls and the Sea have their own loops.

Each is loudest at the bank and fades with distance, and frozen water is silent. Water sound off in the region's Water section silences it. All of these follow the River sounds setting, with River volume and Waterfall volume per player.

Reflections

Reflections on still water mirrors creatures and tiles on the bank in still water, and lets nearby flames and the moon glint on any water. Swift water, rapids, falls and the sea show no mirrored copies, though they glint. Turn reflections off per scene or per region, for a map that paints its own water. Off, that water gets no glints from lights either.

The setting's own description still speaks of long lights from fires and the moon's path. Since 4.3.0 the code draws glints instead, as below.

New in 3.7.6. Read from the code, not tested live:

  • Every water nearby shows its own copy. A creature can reflect below, above or to either side of it, so one on a bridge shows in the water on both sides.
  • Each copy grows and fades with its distance from the water, and eases in and out rather than jumping from one bank to the other. It keeps up with a token as it glides.
  • A creature wading in open water shows only the copy below it.
  • A region with Over water (a dock, a bridge) shows no reflection on its deck.

Token rings. With the Reflect token rings setting on, a token with Foundry's dynamic ring mirrors whole, its ring and background with the creature, as it's drawn on the map. Off, as by default, only the creature reflects. New in 4.1.2.

Lock Rotation. A token with Lock Rotation on stays upright when it's turned, and so does its reflection now. Fixed in 4.1.2: the reflection used to spin with it.

Glints from lights and the moon

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

Seen from straight above, as a map is, water shows neither a long column of light under a torch nor a path under the moon. So Animater draws glints worked out from the water's ripples instead of those.

  • Torches and lamps. A flame's glints gather in a small twinkling cluster close round it, never more than 2 squares off. A torch held over the bank gives few, one at the water's edge or over it more.
  • Only where the light reaches. A light's glints stop at walls and doors, as its light does. They never show on a dock or bridge, nor on water whose region has Reflections off.
  • The moon twinkles here and there anywhere on the water, and only when it's high. Below 35 degrees there are none, and none by day.
  • Any water glints. Swift water, the sea and falls glint too, wider and thinner, though they mirror nothing.
  • Over the lighting. Glints are drawn above Foundry's lighting, so a torch's own light can't wash them out. In bright sun a flame's glints are much fainter.
  • Carried torches glint at once: light a torch at the water or walk it there, and its glints show straight away, whether or not embers and motes are on.
  • They need Reflections on still water on, on your screen and for the scene, like the mirrored copies.

Settings

Setting Everyone (GM) My screen Choices or range What it does
Moving water On On — Water that moves: waves run along a river's current and before the wind, the map seen through them bends, and the sun, the moon and flames glint on them. Every water region on every scene. Each screen's Animation quality sets how much is drawn: Full and Light in full, Balanced simpler, Low not at all.
The coast On On — A water region marked as the sea (the region's right-click panel → Water) gets waves washing in and drawing back, wet sand that moves with the tide over the game's day, and crabs on the shore. Drawn at Balanced quality or better.
Waterfalls On On — A water region marked as a waterfall (the region's right-click panel → Water) falls the way it flows, with foam at its foot, mist on the wind and a rainbow in the spray when the sun is out. Drawn at Balanced quality or better.
Waterfall volume — 1 0 to 2 How loud waterfalls are for you: 0 silent, 1 as recorded, 2 twice as loud. Heard while River sounds are on; with Waterfalls off, a fall sounds as a river and River volume applies.
River sounds On On — Running water, gentle or swift, from any water region with a way to flow (the region's right-click panel → Water → Flows toward), quiet lapping by still water (Pond), and insects and slow mud bubbles instead where its Texture style is Swamp: loudest at the bank, fading with distance, silent while frozen. A region's Sound: Off quiets its own.
River volume — 1 0 to 2 How loud running water is for you: 0 silent, 1 as recorded, 2 twice as loud.
Reflections on still water On On — Creatures and tiles (trees, statues, walls of a ruin) on the bank mirror in still water and dripping pools, falling out across it from the nearest bank; nearby fires throw long lights across it, and the moon lays a broken path on it. Swift water shows none. Drawn at Balanced quality or better.
Reflect token rings Off — — A token with Foundry's dynamic ring mirrors whole in still water: its ring and background with the creature, as it is drawn on the map. Off: only the creature reflects.
Sun on water, snow and ice On On — Small glints of sun and a faint drifting sheen on water, more in a wind; snow and ice sparkle. Golden at dusk, silver under the moon. Water, snow and ice are the regions with that floor (or named as water), and the scene's own floor. Drawn at Balanced quality or better.

Scene and region fields

Field Where Choices
Reflections on still water Scene configuration → Animater On (default), Off
Reflections Region panel → Water On (default), Off
Freezes in the cold Region panel → Water On (default), Off
Thin ice Region panel → Water Off (default), On. New in 4.4.0.
Holds up to Region panel → Water, with Thin ice on Tiny, Small, Medium (default), Large, Huge, Gargantuan
Current here Region panel → Steps, for a step with its own current As the river (default), Very slow, Slow, Gentle, Swift. Renamed from Speed in 4.3.0.
Water sound Region panel → Water On (default), Off
Over water Region panel → Ground Off (default), On
Animater: waves break on it Tile configuration → Appearance Tick. New in 4.0.0.

Limits

  • Moving water draws according to each screen's Animation quality: Full and Light in full, Balanced simpler, Low not at all. At Low, or with the Moving water setting off, water keeps the older still look.
  • A map with waves or foam painted on its water may look better with the Moving water setting off.
  • Mirrored copies need still water. Swift water shows none, though it glints.
  • Thin ice is judged only while the active GM is connected.
  • A ship's waves and an Over water deck only act on moving water.

See also

Region Steps and Painted Floors · Map Painting · Floor Regions · Wildlife and Town Life · Scene and Region Options

Technical details

For developers and the curious. Read from the 3.2.2 code, with the changes up to 4.9.0 added, and not run or measured.

Source: scripts/engines/motion/ water-engine.mjs, water-mirror.mjs, waterfall.mjs, coast.mjs, wake-ripples.mjs, step-ripples.mjs, drips.mjs and floor-stack.mjs, and scripts/engines/regions/ thin-ice.mjs, ice-break-look.mjs, ice-break-draw.mjs, ice-break-sound.mjs and ice-break-word.mjs. Wiring is in scripts/main.mjs.

Shared. Every shader engine here builds new PIXI.Mesh(geometry, PIXI.Shader.from(...)) with a pass-through vertex shader and premultiplied output. None sets a blend mode, so PIXI's default applies (inferred, not checked). Water, ripples and drips sample the map picture from canvas.primary.background, not a capture of the rendered scene, so tiles and tokens aren't in what they refract.

sortLayer Layer
395 Moving water engine
643 Coast
645 Waterfall bodies
646 Drips, wake ripples
647 Step ripples, water mirror
649 Beach crabs
760 Waterfall mist

Quality. Coast, waterfalls, mirror and drips need rank at least 2 and have no internal simplification. Moving water reads floorDetail's water value instead: full on Full and Light, simple on Balanced, none on Low and Off. movingWaterOn in main.mjs also needs movingWater and movingWaterLocal not false. The beach's cut-out shore and its crabs ask the same test.

Moving water

One quad mesh per region with a custom fragment shader. Nothing is rebaked per frame.

Baked on the CPU from 2D canvases when a region is built:

  • uMask, at min(0.25, 1024 / longest side): red is the region's shape, green the distance from the bank, and blue, for a sea, the distance from shore.
  • uFlow, at min(0.05, 256 / longest side): direction, smoothed over 3 passes.
  • uWaves: a procedural 512×512 tiling sheet, one per engine, with repeat wrap and mipmaps.

Edges and holes (new in 3.3.2). A blur spreads past a region's edge and over any hole narrower than itself. So with a floor texture (spec.bed), heldInside gives each point of the mask's red the lesser of the blurred shape and one blurred by 1 px, and returns peak, the most any point holds. Without a texture the two shapes are the same. The output alpha is now smoothstep(uPeak * 0.4, uPeak * 0.7, mask.r), where it was smoothstep(0.0, 0.5, mask.r), for all moving water, so a narrow stream that never reaches full still shows.

Only red is held. Green and the sea's blue are still blurred, by 0.36 and at most 1.5 squares, so a hole narrower than those blurs barely changes them. That's why waves run on as if under a small hole, and a hole needs several squares to make a shore. The module gives no exact width, and this wasn't run.

Soft edge off (new in 3.3.3). Read from the 3.3.3 code, and not run. stepEdge returning 0 sets hard, and the mask's red and the sharp shape are drawn with no blur. The mask's scale still limits how fine the line is. A beach's seaEdge reads mask.b, which isn't changed, and uSoft at 0 only leaves the base width of its fade, so that waterline stays uneven.

Small seas (new in 3.3.3). Read from the 3.3.3 code, and not run. shoreFits draws the sea at min(0.05, 256 / longest side) and deepestInside runs a two-pass distance transform over it, giving the distance from its middle to its nearest shore, at least 0.3 squares. Sides on the map's edge aren't shore, and regions standing over the water don't change it.

seaBlurs turns that middle into shore: min(1.5 squares, middle * 0.5) and deep: min(3.5 squares, middle * 0.6). Worked out from those numbers, for an even strip of water, everything is full size from about 11.7 squares across. In 3.5.0 uFronts is gone, and deep below 3.5 squares makes the sea uAimed instead.

Without a beach, the waterline reads mask.g, blurred by 0.36 squares, instead of mask.b. seaShore, which painted looks use for the sea clip, takes the same blurs.

Waves that break (new in 3.5.0). Read from the 3.5.0 code, and not run. uAimed is 1 when spec.waves is a number, from a compass Waves toward, or deep is under 3.5 squares. wavePeriod is 2.5 + 5.5 * wind, and waveGap is max(1.5, min(0.9 * period, wide * 0.55)), so the pace is 0.9 squares a second until the water's width shortens the gap. uSeaState is the wind, eased over about 20 s as is the direction (turnedToward). breaker works out dense, line, dark and milk, with its breaking scaled by smoothstep(0.03, 0.3, uSeaState), and the Full shader runs a second, slanted set. Foam is a Voronoi tile from foamCells, in uCells. facing keeps it to shores ahead of the waves, and shoreLip needs uBeach. With uAimed 0 the older bore, spray and shore-wave loop stay.

Clear turquoise (new in 3.5.0). waterDepthLook gives tint, and uDepthTint mixes the colour 92% toward a ramp from vec3(0.42, 0.78, 0.76) to vec3(0.025, 0.25, 0.37) by depth. It's in the moving water shader only.

Stands over water (new in 3.3.3). Read from the 3.3.3 code, and not run. movingWaterList in main.mjs passes each water region cuts, the areas of the other regions with the overWater flag. Only the sharp shape takes them: shapeOf erases them with destination-out at a 1 px blur, and heldInside carries that into the mask's red, which decides what shows. The bank and shore channels, the flow and the sea's depth are drawn without them, and so are shoreFits and seaShore, so nothing about the water's motion changes. Unlike a hole in the water's own region, it never makes a shore. The elevation isn't looked at, and the cuts are part of the rebuild key.

The switch is Over water in the region panel (ui/region-panel-sections.mjs), in the ground and deck sections. regionKindOf in ui/region-panel-model.mjs reads a region with overWater as the kind deck, which is shown as Ground; kindFlags('deck') sets overWater: true and keeps the floor unless it's empty, water, lava or cavern, when it becomes wood. Turning it off goes through kindFlags('ground'). Built as (dockStyle) shows when floorBody(floor).post exists, which is wood, stone and metal; Posts (overPosts) when the style isn't plain.

movementFeelFloor sorts overWater regions last, because floorAt takes the last match with a floor, and tests each region at the token's elevation. For an overWater region, onWhatStandsOver in movement-feel.mjs is true when the token is below the region's bottom and its movementAction isn't swim, and the test then uses bottom instead. A call with no token skips this. Footsteps, prints and water ripples read that floor. regionFloor is null for a region with no floor flag and no water word in its name, so such a region can't win. The animals' wildGround sorts its list the same way for floorHere, and adds overDock, a test of the regions' areas with no elevation, which takes those points out of waters and inWater. The flag is also in wildKeyOf's floors key, so ticking the box rebuilds the map at once. The coast and painted looks don't read it. From 3.7.6 reflections do: see below.

Regions traced on a tile (4.0.0). regionsWithPicture in engines/regions/image-plane.mjs drops a region whose imageRegion.source is a tile with no plane, and the tile's plane is null while it's hidden. drawnRegions() in main.mjs is regionsHere() passed through it, and movingWaterList, syncFloorShadows, the animals' overDock and the mirror's decks read drawnRegions(). So while the tile is gone, its deck neither cuts nor shades the water and isn't a deck to animals or reflections. The calm water list in rebuildWater still reads regionsHere().

Samplers: 8, uSand, uMap, uMask, uFlow, uWaves, uBed, uSunlit and uTreeShade, from 3.4.0 a ninth, uOver, from 3.5.0 a tenth, uCells, from 3.8.0 uFishLook, the wildlife's painted fish picture, used when uFishLookOn is 1, and from 4.0.0 uHull. With no map picture, a 1×1 deep-water colour stands in.

Shadows on the water (new in 3.4.0). Read from the 3.4.0 code, and not run. movingWaterList passes over, the regions with overWater or castsShadow whose bounding boxes meet the water's, each with overShadowOf from region-steps.mjs, cut for overWater, casts for castsShadow, and painted. This replaces cuts: takenOut erases each cut region from the mask's red, 2 cells short of its edge when it's painted, so the water runs under it whatever Soft edge says. A dock's boards follow one another along its longer side, so they lie across it (across). make bakes them into uOver, at the mask's scale, only when there are some: red is the shape times darkness, blurred by 0.05 + soft * 0.5 squares, green is unused while contact is false, and blue which shadow it is and which way its boards go.

The shader samples it at vWorld + uToSun * uOverLift * (1 + 1.6 * clamp((0.62 - uSunColor.b) / 0.45, 0, 1)) plus a wave wobble, so a low, warm sun makes it up to 2.6 times as long. Here the colour of the sun decides that, while on the ground its height does. overPattern picks the shadow's pattern, uOverSoft is the softest dock's softness times 0.3, and the result is scaled by 0.25 + 0.75 * uSun. It cuts sunHere, which the glitter reads. movingWaterList always sets watery, so the colour mixes toward col * vec3(0.3, 0.4, 0.48) by overShade * 2.1, which keeps the waves in it. It also passes contact: false, so the green channel stays empty and overUnder is 0 on moving water. Coloured light adds a per-pane hue.

overLiftOf in water-engine.mjs is pure. A bottom that isn't finite counts as 0, so a dock and water with no bottom elevation get the shortest length, 0.15 squares. Under a roof uSun is 0.

Waves breaking on a ship (4.0.0). Read from the code, and not run. hullsOver in main.mjs lists tiles with flags.animater.wavesBreak true, not hidden, with a loaded picture, whose bounding circle meets the water's box; movingWaterList passes them as hulls only for kind === "sea". hullField draws each tile's own picture, rotated and scaled as the tile is, onto the mask's canvas and blurs it by 0.9 squares, so the field follows the picture's alpha, not its frame. It's baked into uHull only for a sea. In the shader, hullFacing keeps the white to the side whose gradient faces uSwellDir, band keeps it to a strip near the edge, and each burst is timed on dot(w, uSwellDir) / 2.4 and scaled by 0.5 + 0.5 * smoothstep(0.03, 0.4, uSeaState + uWind * 0.5). hullKey adds each hull's id, picture, frame, rotation and scale to the rebuild key, and createTile, updateTile and deleteTile on a flagged tile call floorLooksSoon. The checkbox is added to the Appearance tab by a renderTileConfig hook.

Limits: MOST_FISH = 14, MOST_LIGHTS = 6, MOST_RINGS = 16, RING_LIFE = 3. Sea uses three sine swells and three shore-wave iterations.

Updates. visible comes from a box test against the view. Sky values update every 0.5 s (SKY_EVERY), or every frame during a lightning flash, and lights every 0.2 s (LIGHTS_EVERY). Time and wind update per frame on visible meshes only.

Rebuild. A JSON key of areas, holes, angle, current, kind, wind following, wave direction, map, beach, sand, edge, depth, bed and quality, plus what stands over the water and, from 4.0.0, the hulls. A changed key drops and remakes the mesh and its textures.

#define FULL adds: the third wave size, rings across a fall's pool, step rings, a third bubble size in sea foam, a second speck size in fall foam, and lapping at the bank.

Data. From 3.8.0 there's no scene flag or region opt-out: movingWaterList takes every drawn region whose floor is water while movingWaterOn() holds, except one with the old waterfall tick while the Waterfalls setting is on. The decorations' puddles and cave pools are added as still water. Region flags include waterKind, flowTo, current, waterDepth, waveTo and seaBeach. A region whose water moves shows its painted floor as uBed.

Reflections

createWaterMirror uses a holder container masked by a PIXI.Graphics of the calm water. Inside are flipped sprites of each token's or tile's own texture, tinted. Since 4.3.0 the lamp columns and moon path are gone: glints go in their own container, glowRoot, over the lighting, masked to all the water (calm and rough), with one quad mesh per lamp cut to that light's own shape and one each for the moon on calm and on rough water.

Glints (4.3.0). Read from the code, and not run. rebuildWater passes calm water, rough water and dull (regions with reflections === "off") to waterMirror.water, so the mirror is built wherever there's water while waterMirror is on and the scene's reflections flag isn't "off". mirrorLamps reads canvas.effects.lightSources on every look, not the embers' list, which is why a carried torch counts at once; each lamp brings source.shape.points. lampGlints samples a 9×9 grid within GLINT_REACH = 2 squares, leaving out points outside the light's shape or on a deck or dull water, and drops the lamp when none are wet; without a shape, a wall between the lamp and the nearest water hides it. Strength is 0.25 while sunny (the sun up with strength over 0.3), else 1. moonGlints returns null below MOON_LOWEST = 35 degrees or while sunny. In the shader a point flashes when its ripple tilts half way from overhead toward the flame, and rough water spreads them wider.

Rings and Lock Rotation (4.1.2). With waterMirrorRings on, createRingPictures renders each ringed token's mesh into its own texture once, again only when its texture, ring data, size or tint changes. tokenTurn gives 0 for a token with lockRotation.

Limits: MAX_MIRRORS = 12, MAX_COLUMNS = 8 (now the most lamps glinting at once), MAX_TILES = 16, BIGGEST_TILE = 12 squares, LAMP_REACH = 4 squares. The nearest to the view's centre win. Selection runs every 0.25 s, token positions are fed every 50 ms and tiles every 1000 ms.

What counts as calm. waterStillness makes a region rough, with no reflections, for the old waterfall or sea tick, current === 'swift' or reflections === 'off'. rebuildWater treats the engine's Falls and Sea kinds as rough too. Reflections also need the scene's reflections flag not "off".

Every way (new in 3.7.6). Read from the code, and not run. MIRROR_WAYS is down, up, right and left, and mirrorOf is asked once per way, so each water a token reaches shows its own copy. decks, the areas of drawn overWater regions, are passed to the mirror: nothing shows on them and a token on one isn't wading.

Painted floors over water (4.8.0)

floorStack in floor-stack.mjs sorts painted floors by area, biggest first, ties by id, and gives each under: the areas of every moving water smaller than it whose bounding box meets its own, which the painter opens. A floor with over (built over water) gets none.

Thin ice (4.4.0)

Read from the code, and not run.

Flags. iceThin (exactly true) and iceHolds (one of SIZES: tiny, sm, med, lg, huge, grg; med otherwise) on the region. thinIceOn also wants the region still water: its own floor is water, or it has none and isn't a cave, deck or indoors. Leaving the water kind writes iceThin: false. activeStep in region-steps.mjs returns THIN_ICE_STEP while it's on. State is flags.animater.thinIce { cracks: { "c,r": 1 }, holes: { "c,r": <squares across> | "melt" } }, keyed by grid square and changed key by key, never written whole.

Judging. A moveToken hook, on the active GM only (isActiveGM), on the scene in view, with thin ice regions there. sizeNameOf reads the actor's size (actor.size, system.traits.size.value and so on), else the token's width. moveSince skips waypoints an earlier firing of the same move already walked (movement.id and a path signature, 8 tokens kept). walkedLegs drops legs with fly, burrow, swim or displace (OFF_THE_FLOOR), teleports, and those off the level's base elevation. squaresEntered walks each leg boundary by boundary and drops the first square. weightOffset reads an even footprint at the square nearer its corner. Per region, only squares whose middle tests inside it are passed to iceStep: holdsUp gives 0, 1 or 2 sizes over; at 2 the first square breaks; at 1 a square already cracked (stored or earlier in the walk) breaks, else it cracks. iceUpdatesFor writes them in one updateEmbeddedDocuments("Region") with { animater: { thinIce: true } }, deleting cracks through the database operator (withDeletes). Nothing is posted to chat.

Each screen. syncIceBreak reads every drawn region's state through iceBreakOf and draws cracks, shards and plates on floor layer iceBreak (sortLayer 643) and the hole's dark water on iceHoleBed (390, under the moving water). newKeys keeps what this screen has seen per region; a region seen for the first time is learned silently. New holes (not melts) play one iceBreakSound pair, chosen by a hash of the square key and region id from three ice-break-*.ogg and four body-splash-*.ogg files, the splash ICE_SPLASH_GAP_MS = 120 ms after, volumes 0.55 and 0.45, reach 18 squares, walls muffling; iceBreakVoice lets one through per 0.45 s. iceWords gives CRACK! and THROUGH! to Foundry's createScrollingText, THROUGH! winning on a shared square, capped at 8.

Floor and sinking. inIceHole asks iceHoleAt against the hole's drawn shape, and movementFeelFloor returns water there. The sinking pass passes hole to movementEnvironment for a token on the level's floor in a hole, only while underwaterLooksOn().

Melt. breakAreaThings (which needs propsOn) claims a fire area once per template when the scene has thin ice and asks the active GM (ICE_MELT_MESSAGE by socket otherwise). iceMeltSquares walks the squares where the region's box and the area's box overlap, at most 4000, and iceMeltUpdates stores each as "melt" unless it's a hole already.

Clearing. iceRefreezeUpdates deletes every key in both maps; the panel's Refreeze confirms with a dialog first and works for any GM. Repair runs iceRepairUpdates over every region of the scene.

Life and sound by the water

  • Fresh water (4.0.0). freshWaterFor in pond-life.mjs is true while any water spot isn't sea and isn't kept out. While it is, ducks and frogs don't take the sea; with none, ducks wait on the sea and fly back once there's fresh water.
  • Fish refill (3.8.12). FISH_REFILL in wildlife.mjs is { first: [5, 15], next: [6, 20], caught: [20, 45] } seconds. The changelog says a caught fish is replaced within half a minute; the code allows up to 45 s.
  • Still water sound (3.8.7, 3.8.8). readRivers in main.mjs gives a region with no flowTo the voice swamp when textureStyles.water === "swamp", else lake. It skips falls, the old sea tick, regionSound === "off", and non-still kinds with no flow.

Waterfalls

Two meshes per fall, with no baking and no samplers: the body, the region polygon triangulated with PIXI.utils.earcut, and mist, a quad past the foot. Strands are noise on a coordinate using sqrt(a), so they speed up as they fall. Only uniforms update. A rainbow needs sun height at least 15 degrees and strength at least 0.3.

Comment and code differ: the header says mist is "over everything". It's at sortLayer 760, and some layers sit higher.

The coast

One quad over the shore field's rectangle, plus sprite crabs. shoreField computes signed distance to shore on the CPU, held to FIELD_RANGE = 5 squares and stored as a byte texture with finer steps near the waterline. One sampler, uField, and uWaves[MAX_WAVES], with MAX_WAVES = 4.

Wave state is stepped on the CPU per frame while in view, after 40 steps at dt: 0.75 before the first draw. Tide comes from game.time.worldTime and the scene id, with TIDE_HOURS = 12.4, while swell uses Math.random per client. So the tide should match between screens and individual waves shouldn't. Inferred, not tested.

Wakes and step rings

Wakes. Two meshes. Rings are one quad with uRings[MAX_WAKE_RINGS], where MAX_WAKE_RINGS = 32. Arms are a strip of up to 480 quads (MAX_QUADS, three per point) from MAX_POINTS = 160, whose buffers are rewritten per frame while trails exist. The angle each side is asin(1/3), about 19.5 degrees. A water shape is baked into a RenderTexture at min(1, 1024 / longest side).

Comment and code differ: a comment in main.mjs says rings open into a V by themselves. The module builds arm strips, and uses rings only when staying put.

Step ripples. One mesh, ring-buffered at MAX_RIPPLES = 24, LIFE = 2.2 s, sampling uFloor. Buffers update on add, and a frame only moves uTime.

Dripping pools

One quad mesh per area with a per-pixel pool shader, one sampler, uFloor. MAX_DROPS = 16, MAX_POINTS = 32, MAX_STEPS = 6. The fragment shader runs a point-in-polygon loop over up to 32 corners, 2 rings and a 7-droplet crown per drop, and a 9-droplet splash per step. No view culling was found. A rebuild resets each pool's uTime.

Shader warm-up

scene-shaders.mjs lists the water programs for background compile, except drips. fullWater is passed only when quality is exactly full, though Light also draws the full shader, so a Light client would compile it at first draw. Inferred, not tested.

Clone this wiki locally