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

Floor regions

Floor regions reads the map image and helps you turn what it sees into regions with a floor: water, stone, grass, wood and so on. You click the parts you want, check them in a list, give each one its floor and settings, and save. It started as the water generator and still finds water on its own. Everything else you mark with a click.

It's experimental and off until you turn it on. Nothing is written to the scene until you save.

New in 4.0.0. The water reading, colour clicks, outline editing and Add to came first, in 3.8.0.

Read from the code, not tested live.

The regions it makes are ordinary Animater floor regions. What they do in play is covered in Water and Region Steps and Painted Floors.

Painting floors by hand (Map painting)

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

For a quick floor or a touch-up, the Map painting button in Animater's controls (a paintbrush) has a Ground tool (press 2; earlier versions called it the Floors tab). It needs no experimental switch: it reads the level's map picture once and paints straight onto it. Pick a floor, drag, and each stroke is saved as it ends.

Its Edges: Model uses the same smart model as Smart here: one download, one agreement and one background worker for both. Once this browser holds the model, Ground starts on Model by itself. Each kind of water (still pool, river, rapids, waterfall, sea) is its own floor to the brush, and Shift-drag rubs out only the floor picked. The whole tool is described on Map Painting.

Regions painted this way are ordinary floor regions: this window lists them, and the region's right-click panel changes them. Ground's More ▾ has Read the whole map…, which opens this window, shown only while Experimental: floor regions from the map is on.

The Map making tools switch (Animater settings → Interface & performance) hides the Map painting button. It does not hide the Floor regions button.

Turning it on

  1. As GM, open Animater settings → Floor & world → Ground & movement and turn on Experimental: floor regions from the map. This is for the whole world.
  2. A Floor regions button (a polygon icon) appears in the Animater controls on the left. Only GMs see it.
  3. If you'd rather not see the button on your own screen, untick Show the Floor regions button, in the same row just below. That's per screen.

Nothing else hides the button. Changed in 4.6.3: the world's Map making tools switch used to hide it too, and Animater turns that switch off by itself in a world that had not painted a map with it, so ticking the experimental setting could leave you with no button and no word why. The two switches that remain now sit together in one row; before, the button's own switch was under Interface & performance.

Setting Everyone (GM) My screen Choices or range What it does
Experimental: floor regions from the map Off — — Adds a Floor regions button in the Animater controls that proposes water and other floor regions from the level background. Off by default. It runs only when you click that button. Nothing else hides it: only Show the Floor regions button, right below, which is each screen's own.
Show the Floor regions button — On — In the Animater controls: propose water and other floor regions from this level's map (experimental).

Click the button to read the level you're looking at. The window opens on that scene and level, and saves there even if you switch scenes while it's open.

Quick start

  1. Click Floor regions. If the map has blue or teal water, it's already outlined and listed.
  2. Open the Floor picker in the toolbar and choose what you're about to mark, or leave it on Auto.
  3. Click the floor on the map. A new numbered area appears, painted in its floor's colour, with a row in the list on the right.
  4. Click a row to select it. Its settings open below the list: floor, water kind, texture and so on.
  5. Untick anything you don't want.
  6. Click the save button at the bottom (Create 3 regions, for example). The window closes and tells you what it made.

Ctrl+Z undoes your last change at any point.

What it reads

It reads the background image of the current level, the same picture the scene shows. It can also read a tile instead: see Ship decks and other tiles.

When the window opens it does three things:

  • Finds water by itself. It looks for strongly coloured blue and teal and outlines it. Grey-blue roofs and stone are turned down. Small pools start unticked, so check them.
  • Loads the regions it made before on this level, so you can change them. They're listed under On this scene.
  • Marks areas that look like your saved regions, once you have some. See Learning from your regions.

Other floors aren't found automatically. You click them.

The two selection tools

The switch at the left of the toolbar picks the tool. Your choice is remembered in this browser.

Colour

Colour follows the colour you click outwards until it changes. It's quick and downloads nothing. It works best on water and other strong colours.

  • Click a floor to add it as a new area.
  • Range chooses how far it follows: Narrow (the default) or Wide. Wide can run on into grass, banks or anything else of a similar colour.
  • Things floating in water that stand out in colour, such as a boat, are left as holes.
  • It can't follow grey or brown floors such as stone, wood, dirt or snow. With one of those picked, the help line says to switch to Smart.

Smart

Smart uses SAM 2.1 large, an image segmentation model that runs in your browser. It traces a floor from its shape and texture, not just its colour, so it handles stone, planks and dirt.

  • Click a floor to add it. It looks at a few points around your click and keeps what they agree on.
  • Shift+drag a box around a room or a pond to take what's inside.
  • Right-click a bush, rock or rug inside an area to cut it out. It stays as a hole. If the model can't tell the part from the area, such as a bridge over a small pool, it cuts the part in the colours you clicked instead.
  • 1, 2 or 3 switch the last area or cut between the model's Small, Middle and Large versions. The Size buttons at the bottom right of the map do the same. They show only while there's something to resize.
  • Same colours, next to the Floor picker, is on by default. It leaves out anything of another colour standing on the floor, such as green chairs on grey stone. The floor's own light and dark patches stay. Turn it off for a floor of many colours.

While it works, a spinning ring sits where you clicked and the cursor shows busy.

The download

The first time you switch to Smart, it asks before downloading about 456 MB. The model comes from huggingface.co and its library from cdn.jsdelivr.net. The browser keeps both, so it loads from the cache after that. If you say no, the tool goes back to Colour.

Your yes is remembered in this browser, and a model already in the cache isn't asked about again.

The map is read on your computer and isn't sent anywhere. Smart reads the map once when you switch to it, then answers each click in a moment. Without WebGPU it runs on the CPU, which is much slower, and it tells you so. New in 4.1.0: the model works in a background worker, so Foundry keeps drawing while it reads and answers; Map painting's Edges: Model and Lift from map share the same worker and download. Changed in 4.1.4: on a graphics card that can't run the model's half-precision maths, it loads on the CPU from the same download instead of failing.

Things both tools do

  • Right-click a small stray piece of an area, or a thin finger of it poking into a bush, to remove it. In Colour this is all a right-click does.
  • Click a part you took out to put it back. The other parts stay out.
  • What you take out stays out. A part removed from an area isn't picked up again by your next selection of the same floor. Another floor can still take it.
  • Scroll over the map to zoom, or use the − / + buttons and Fit. Drag to pan. Middle-drag pans in any mode, even while you edit an outline.
  • A clicked area that covers more than a quarter of the map asks in its settings whether it's really all that floor.

Choosing floors

The Floor picker in the toolbar sets the floor your next click adds: Auto, or one of Water, Stone, Pebbles, Wood, Dirt, Grass, Sand, Snow, Ice, Mud, Glass, Metal or Lava. Your last choice is remembered in this browser.

You can change any area's floor afterwards in its settings.

Auto

With Auto, a new area takes the floor of the saved regions it looks most like. If nothing looks close enough, or two floors look about equally close, it doesn't guess. The row says "Auto doesn't know this floor yet: pick one" and stays unticked until you choose a floor. You can't save a ticked area that has no floor.

With a floor picked, that floor is used, and only that floor's look (texture, pattern and so on) is taken from your saved regions.

Learning from your regions

Each region you save teaches it. It keeps a short description of how that part of the map looks, with the floor and look you gave it. The regions this tool made, already on the scene when you open it, teach it too. The world keeps the last 400 examples.

What it learns is the floor, and for that floor the water kind, floor texture, pattern, soft edge and Over water. A river's flow and the sea's waves belong to one map, so they aren't learned.

Mark areas in the toolbar marks every part of the map that looks like your saved regions, of any floor. It also runs by itself when the window opens. Each area it finds is a ticked row marked "learned". It uses Smart if you've already downloaded it and agreed, otherwise Colour. It never starts the download by itself.

If it marks something wrong, untick it or remove it. When you save, it remembers that as "not a region" and won't mark it again.

One Ctrl+Z takes back everything one marking pass added.

The changelog reports a test on 44 regions drawn by GMs on 16 adventure maps, each guessed from the other maps only: 32 right, 3 wrong and 9 left for the GM to pick.

The list

The panel on the right lists every area, largest first. Areas already saved as regions are under On this scene, and new ones under New. Each row has:

  • a tick box: save this area (or save changes to this region)
  • its number, matching the badge on the map, in its floor's colour (areas of one floor get different shades)
  • its name and status, such as "Saved · will update · Grass" or "New · not saved"
  • how much of the map it covers

Click a row to select it. The map outlines the selected area, and its settings open under the list.

Water settings for ticked water areas, above the list, sets Kind, Flows and Current for every ticked water row at once.

An area's settings

These show for the selected area. Water fields show only on water.

Setting What it does
Floor What the region is. Changing a saved region off water clears its water settings. Changing one to lava gives it lava's steps.
Step The state the floor starts in: fresh, bloodied, burnt and so on. The same list as the region's right-click menu. A saved region keeps its own list. See Region Steps and Painted Floors.
Over water For any floor you can stand on: a deck, jetty or bridge built over water. Not offered for water or lava.
Kind Water only: Still pool, River, Rapids, Waterfall or Sea. See Water.
Flows River, rapids and waterfall: a compass direction, or Follows the wind.
Current River only: Gentle or Swift. Rapids and waterfalls are always swift.
Waves toward and Beach along the shore Sea only.
Floor texture Whether the region paints its floor's texture over the map: As the scene says, Paint it or Don't paint it. Don't paint suits a map that's already painted. Lava never paints.
Pattern The floor's texture style. Shows only while the area will paint.
Soft edge How far the texture fades past the region's line, in squares, up to 3. 0 is a hard edge. Shows only while the area will paint.

Areas that will paint show on the map as the scene will draw them, lit as the scene is now, with their pattern and soft edge. For the first moment a simpler preview stands in.

Floor texture at the bottom of the window sets the texture for all ticked areas and for new ones. Each area can still differ.

The area's tools

Button What it does
Add to Click more of this floor, or another new area, on the map to join it to this one. Its floor and settings don't change. A saved region can't be pulled in this way. Done stops.
Outline Edit the outline by hand. See below.
Split Drag a loop around part of the area, such as the waterfall in a river. That part becomes its own ticked area with the same floor and settings, so you can change its kind. Done or Escape stops.
Tidy Removes all the small separate pieces of the area at once.
Remove (bin) Removes a new area. On a saved region this button is Leave unchanged instead: it unticks it, so the region isn't touched.

At the bottom of the window:

  • Remove all small spots tidies every area in one go.
  • Combine ticked merges the ticked areas into one. If one of them is a saved region, the others join it. If not, they join the largest. Two saved regions can't be combined.

Editing an outline

Select an area and click Outline. Handles appear on its outline, holes included.

  • Drag a handle to move it.
  • Double-click an edge to add a handle there.
  • Click a handle to select it, then press Delete or Backspace, or click Delete vertex.
  • Smooth shore smooths the outer edge a little each time you click it. Holes stay as they are.
  • Escape cancels a drag, and a second Escape leaves outline editing. Done leaves it too.

A change that would leave an invalid outline, or none of the area inside it, is refused and the outline stays as it was.

Undo

Ctrl+Z, or the undo button in the toolbar, takes back your last change. That covers adding, removing, cutting, resizing, splitting and outline edits, and any setting: a tick, a floor, a water kind, a texture, a pattern or an edge. It keeps the last 20 changes.

While the window is open, Ctrl+Z goes to it instead of Foundry's own undo, so it won't undo a token move by mistake. It still works with a drop-down focused, but not while you're typing in a text box.

Saving

The save button says what it will do: Create 2 regions, or Save 1 new · 2 updated when saved regions are in the list. Only ticked rows are saved.

What it changes:

  • A new area becomes a new region on this level, in its floor's colour.
  • A ticked saved region gets only what you changed: its outline if you edited it, and any setting you changed.

What it leaves alone:

  • a region's name, behaviours, and any settings you didn't change here
  • saved regions you left unticked
  • regions drawn by hand, regions on several levels or all levels, and regions on other levels. These never show in the window.

It never deletes a region. To get rid of one, delete it in Foundry as usual.

Names: new regions are named after their floor: "Water", or "Grass 1", "Grass 2" when one save makes several. Numbers carry on from the regions already on the scene, so a second save doesn't make another "Grass 1".

If an unticked area has outline edits, saving or closing the window asks first, because those edits would be lost.

Regions made by the 3.8.0 water generator open and save here as well.

Ship decks and other tiles

A Picture menu above the list appears when the level has tiles. Choose a tile to trace it instead of the map, such as a ship. Each picture keeps its own draft while you switch between them.

Saving writes the picture on screen. If other pictures still have ticked areas, it then offers Save them too, Review first or Close without saving, and says what landed. Closing the window with ticked areas on other pictures asks before it drops them. Changed in 4.6.0: before, those were silently lost.

On a tile, the solid parts of its image are proposed as areas. They start unticked with no floor, because a hull isn't water: pick each floor yourself.

  • A floor on a tile is the floor underfoot at the tile's elevation. A token within one unit of it, such as 10.5 on a deck at 10, still walks on it. Where a tile's floor and the map's floor overlap, the tile's wins.
  • A tile set to block light or weather (an awning, say) is traced as Cover. Its areas have no floor, and are saved as regions named "Overhead". Below the tile's elevation, what's under them counts as sheltered from the weather or the light, whichever the tile blocks.
  • A tile that's hidden or deleted takes its regions with it: they draw nothing and the water underneath behaves as normal water again. The regions themselves stay, so showing the tile again brings the deck back. A missing tile still shows in the menu as "Missing tile" so you can find its regions.
  • A tile that's rotated or scaled can't be traced, because its outline would land in the wrong place. If it already has regions, the window warns you when it opens, and the menu lists it marked "(rotated or scaled)" with its regions but not its picture. Reset the tile's rotation and scale to trace it.

Limits

  • Moved, scaled or rotated backgrounds. If the level's background is positioned, scaled or rotated in its configuration, the window won't open. Reset it to use the tool.
  • Video and SVG backgrounds can't be read, and it says so. Use a PNG, WebP or JPEG map.
  • Images from another site may not be readable by the browser.
  • The automatic read finds water only, and only strong blue or teal. A large roof of that colour can fool it, so untick it and click the water instead. Murky or grey water needs a click.
  • Colour can't do grey or brown floors. Use Smart.
  • Detail. The map is read at up to 1024 pixels on its long side, so outlines on a very large map follow the floor roughly. Zoom in and use Outline for fine edges.
  • A scene with no map image, or no size yet, can't be read.

See also

Technical details

For developers and the curious. Read from the 4.9.0 code, and not run or measured.

Source: scripts/ui/floor-regions-ui.mjs (the window, save plan and floor memory store), scripts/ui/smart-model.mjs (model loading), and in scripts/engines/regions/: floor-detect.mjs (automatic water read, colour clicks, region data), smart-select.mjs (smart clicks, cuts, spots), floor-memory.mjs (learning), area-outline.mjs (outline editing) and image-plane.mjs (tiles and decks). The button is registered in scripts/main.mjs.

The read. The level background is fetched and decoded once at the scene's shape, at most 1024 pixels on the long side (WATER_TUNING.maxDimension), with a 60-second timeout. Every area is a list of pixels on that read plus traced loops. The window shows a separate sharper copy, up to 4096 pixels, loaded a moment later from the browser cache, and draws its canvas at screen resolution.

Automatic water. detectWater looks for saturated pixels with a hue between 170° and 250°, finds the strongest colour peak, grows strong seeds into a weaker band, fills pale holes of a similar hue, and traces each piece. Pieces under 0.06% of the map are dropped. Pieces under 0.2% are listed unticked. Outlines are simplified to within two read pixels.

Colour clicks take the median hue and lower-quartile saturation near the click and grow four-connected. Wide widens the hue band.

Smart. The model runs in a dedicated module worker (scripts/workers/smart-model-worker.mjs, one per page, shared with Map painting); the map is transferred to it as a copy and the masks come back transferred. SAM 2.1 large (onnx-community/sam2.1-hiera-large-ONNX, fp16) through transformers.js 3.8.1. With WebGPU, the image encoder runs on the GPU and the prompt decoder on the CPU (WASM); without it, or when the adapter lacks shader-f16, both run on the CPU. The map is encoded once per picture. A click asks the model at a few nearby points and keeps their consensus. A box is sent as box points. Each mark gives three masks, which are the 1–3 sizes. Same colours trims the mask to the colours around the seed. A right-click cut tries, in order: the model's part if it's under a quarter of the area, then the part in the clicked colours (up to nine tenths of the area), then a larger model part that clearly differs in colour.

Consent and cache. The yes is kept in localStorage under animater.floorRegions (smartAgreed, set to the model's repo name), together with the last floor, tool and the Same colours tick. The model counts as cached when transformers.js's transformers-cache holds an .onnx file from that repo.

Learning. Each example is a seven-number signature: mean CIELAB colour, its spread, and a grain value (the average lightness step to neighbouring pixels). Distance is weighted towards colour. A match must be within 12, and the nearest example of a different floor must be at least 1.4 times farther, or no floor is given. Examples live in a hidden world setting, floorMemory, capped at 400, keyed by scene and region so a re-saved region replaces its entry. Rejected marks are kept as the floor none. Mark areas seeds an 8-across grid over the map and keeps pieces between 0.3% and 60% of it.

Stray spots. A right-click removes a separate piece that isn't the largest and is no more than a quarter of the area, or a thin finger. Tidy removes every piece smaller than 5% of the area's largest piece.

Saving. New regions carry flags.animater.generated = "floor-detect", and regions with the older "water-detect" mark are read the same way. Only generator regions on exactly the current level are editable. Updates are patches with only the changed flags. Shapes are written only when the outline changed. Undo keeps 20 snapshots of the areas and their settings.

Tiles. A tile plane is offered when it has an image, is on this level and has no rotation, a scale of 1 and a fit of fill. A tile with light or weather restrictions is an overhead plane. Its traced areas are the image's pixels with alpha of at least 200. Regions on a tile store their loops in tile-relative coordinates under flags.animater.imageRegion, with the tile as source. A floor on a tile covers tokens within 1 of the tile's elevation, and a tile floor wins over the map's. A region whose tile is missing or hidden is skipped when drawing.

Clone this wiki locally