Grass and bushes in the editor
Paint grass and bushes, pick a patch and give it settings of its own, shape every part of its look, say what it is to the rules, and set it on fire while the map plays. Everything here is in the Terrain panel (left rail), under the layer's paint buttons.
- Open the Terrain panel and, under your grass layer's name (Grass), click one of its styles (your game declares the layer: see Grass and bushes).
- Paint on the map.
- Open Grass and bushes under the layer and pick Preset › Tall grass.
Done: the grass you painted is tall grass, on this map.
To clear grass while you shape or paint the ground, tick the brush's Clear scenery and grass (see Terrain and painting): every layer drawn as grass or bushes is cut under the brush, but the one the brush itself paints.
Pick a patch
A layer of grass has a Patch tool. Its tiles say how it picks cells; the same five are on the tool bar while it is picked.
| Tile | How it picks |
|---|---|
| Rectangle | Drag out a rectangle of cells |
| Circle | Drag out a circle, from its middle |
| Polygon | Click its corners; a click on the first closes it |
| Wand | A click picks the patch under it: the cells that touch, of its style. Wand: any style picks the grass that touches whatever its style |
| By style | A click picks every cell of the style under it |
Shift adds to what is picked, Alt takes away, Escape (or a click without a drag) lets go. Picked cells are outlined, and counted under Patch. Map symmetry is applied to every pick. A selection is never saved and is no step of Undo.
Give it its own settings
With cells picked:
- Its own settings makes a new style of the style most of them have, paints it on them, and opens its settings below.
- Use style… paints them with a style there is.
- Clear takes their grass away; Fill puts grass on those that have none.
- Let go drops the selection.
Styles
Styles, a fold of its own (open until you fold it; its bar says how many styles there are), lists the layer's styles: a colour chip, the name, the map's for one this map made, and how many cells it has. Click a style to pick its cells (Shift adds, Alt takes away) and open its settings; with the layer's brush picked, the brush paints it. + New style makes one of the layer's look, painted nowhere yet.
In a style's settings:
- Set for: This map (its definitions and look, saved with the map, over the game's) or Every map (the game's) (the game's
data.jsonandcellLayers.json). - Name and Colour (its chip, and the Grass styles overlay).
- Duplicate copies it, look and all. Merge into paints its cells with the style picked under Its cells go to and takes it away; Delete takes it away, its cells going there (or to No grass). Undo brings it back.
- Its look and its Gameplay (a fold of its own, folded until you open it; its bar says whether the style hides units and how long it burns), below.
A layer has at most 255 styles; past that, merge two to make room.
The Grass and bushes panel
The fold sets the layer's look, or a style's in its settings. Each group is a fold of its own, remembered as you leave it. At first only Drawn as, Size and Colour are open; Presets and the rest are folded. A group's bar says what is set in it (Shape says Blades · 5 · 0.09 wide, Colour shows the foot, tips and tint as swatches, Walked on says off when it is off), and in a style a dot shows the groups the style sets some of its own fields in.
Each group shows its common rows first; the rest are under its More fold (the table below has every row). Type in Find a setting to show only the rows with those words; their groups and their More open while you search, and Escape empties the box. Collapse all folds every group and its More; Expand all opens them all.
In a style, a row it does not set shows the layer's value greyed: Its own sets it for the style, As the layer gives it back; All as the layer gives all back. On the layer, ↺ gives a row back to what the game says, and As the game has it gives all back. Each change is one step of Undo, and you see it at once.
| Group | Rows | Under More |
|---|---|---|
| Drawn as | Tall grass, Models or Nothing; for models, a weight for each, Add a model…, Upload… | See-through round own units; for models Shadows (Cast, Near the camera, None) |
| Shape | Kind (Tuft, Blades, Crossed cards, A model); for tufts and blades Blades, Blade width, Curve; for cards Cards, Picture; for a model Model | Spread; for blades Taper, Droop, Parts near, Parts further, Parts far; for cards Cut-off |
| Size | Height, Each its size | Each its width, Bigger in patches, Patches across, Smaller at the edge, Size at the edge |
| Rotation | Turned, Lean | Faces the wind, Leans towards (Each its own, Downwind, One way), Upright on slopes |
| Colour | Foot, Tips, Tint | Colours between (+ Colour between), Lighter, darker, Hue, Strength, Patches, Patches turn to, Patches across, Ground's colour, Dried out, Dries to |
| Placing | Density, Clumps | Clumps across, Thinner at the edge, Thickness at the edge, Scattered, Slopes, Only on tiles, Never on tiles, Off water, Off cliffs, Off buildings, Off scenery, Off roads, Seed (⚄ for another), Patches across |
| Wind | Sway, Stiffness; Preview wind blows here alone and is never saved (the map's own wind is in the Look panel), Gust blows once over the patch | Waves, Flutter, Leans downwind, Speed, Sheen |
| Walked on | Moved by who goes in (on or off), Bends, Lies down, Stands again in | Bent around, Settles in, Stepping in, Moved by (Every unit seen, Own and allies', Nobody), Wobbles, Leaves a trail |
| Light | Light through | Shadows fall on it, Lit as (Facing up, As each faces), Shine, Fades at the foot |
| Distance | Fewer from, Fewest from | None past, Kept further off, Kept far, Fades over |
| Ruined | Cut to, Crushed, Burnt | Paint under cut, Paint under burnt |
| Fire | Burns on the screen (on or off), Flames, Glowing edge, Bright | Smoke, Embers, Lights around, Smoky, Ash, Sound, Catching |
| Sound and leaves | Sound | Loudness, Leaves |
Every colour but Glowing edge has how much of it is seen: the number beside its hex (0 to 1), or the slider over a checkerboard in what opens. Lower the Tips' to have blades fade out towards their tips, the Tint's to have the whole style half seen (bushes too), Crushed's and Burnt's for ruined grass. It is drawn by leaving out a fixed pattern of pixels, never blended; whole again, the colour is written as it always was ([r, g, b]).
Groups for grass alone (Shape, Light, a few Colour rows) hide for models; every group hides for Nothing. Flowers (scatter) and grass from tiles (on) have no rows yet: set them in code or in cellLayers.json; the panel keeps them.
What the panel writes is said by groups (colors.tip, wind.sway); a look written the old way (tip, sway) is rewritten by groups the next time it changes.
Preview
The Preview group, under Presets, shows the look in the view for a moment: nothing of the map changes, nothing is a step of Undo, nothing is saved. It plays over the cells picked with the Patch tool, or the patch of the style (or the layer) nearest where the camera looks.
| Button | What you see |
|---|---|
| Walk across | A walker crosses the patch and back, waiting off it between: the grass bends, lies down (Lies down), leaves a trail and stands again (Stands again in). Where the style is Trampled: Crushed flat, what it crosses is shown crushed |
| Walk with the pointer | The pointer walks through the grass while this is on |
| Light it | The patch catches at its middle and burns outwards, each cell for its style's Burns for, with this look's flames, smoke, glow and ash; a few seconds later all is put back. A style with Flammable at 0 does not burn |
| Cut, Crush, Scorch | The patch cut to stubble, crushed flat or burnt black, until Restore |
| Grow back | What is ruined of the patch (all of it, where nothing is) grows back over the style's Grows back over |
| Gust | A gust blows out over the patch |
| As further off, As far off | The patch drawn as from its middle or far distance (Distance), the camera left where it is |
Restore, or a second press of what runs, puts it all back; so does folding the group away, leaving the panel, or picking another style. Fire and ruin are played out by the editor with the style's Gameplay times, as the rules would; what you see is drawn as in play.
Presets
Presets is a fold of its own, above the groups.
- Preset › Start from…: Default, Meadow, Tall grass, Dry grass, Reeds, Wheat, Snow grass, Thicket, Hedge, then your game's own. A preset keeps the look's models and styles.
- Save as preset… keeps the look among the game's presets, in
foliagePresets.json. - Copy and Paste move a look between styles, layers and maps (models and styles stay where they are).
- Randomize makes one up within what reads well, with a new seed.
Gameplay
In a style's settings, Gameplay is what the style is to the rules (foliagePack), kept where Set for says and played at once, in a game played here too.
| Row | Field |
|---|---|
| Hides units inside | conceals |
| Hides taller units | concealsTaller |
| Height | height (a unit stands twice its radius) |
| Slows by % | speed |
| Flammable | flammable, 0 to 1 |
| Burns for (s) | burns |
| Fuel | fuel |
| Grows back after (s) | regrows; empty for never |
| Grows back over (s) | grows |
| Trampled | trample: Not at all or Crushed flat |
A greyed field shows what the code or the game's data says; the dot beside a field set here gives it back. walkable has no row: set it in code or data.json.
Overlays
| View menu | Key | Shows |
|---|---|---|
| Grass styles | Shift+J | Each style in its colour |
| Grass state | Shift+U | Burning orange, burnt black, cut yellow, flattened brown, growing back light green |
| Hiding patches | Shift+H | Each patch of grass that hides, outlined in a colour of its own |
Grass state and Hiding patches show the map as edited, and, while it plays here, the game's grass as its rules have it.
Set it on fire in Play here
- Press Play here, and open the Cheats panel. In a game with the foliage pack it has Grass.
- Pick a brush: Ignite, Extinguish, Cut or Regrow, and How far round (cells). With more than one layer, pick the Layer.
- Click or drag over the game's map. Esc or a right click lets the brush go.
- Under Wind, set Strength and Towards (degrees from north): for everyone, the grass and the fire go by it.
Each stroke is a debug command (debug.foliage, debug.wind), so replays hold it. A style changed in the Terrain panel goes into the game at once. See Play here and test.
Metrics
Metrics (bottom drawer) has a list for each layer: Chunks drawn, Tufts and bushes drawn (of those laid), Last laying, A frame, Cells burning, and Hiding patches while that overlay is on. Of the game played here while it shows, else of the map. See Metrics and debug views.
Map checks
| Check | What it says |
|---|---|
unknown-foliage-style | Grass painted with a style neither the game nor the map has |
foliage-hides-nobody | A style that hides but not what is taller (concealsTaller off), shorter than every unit on the ground: it hides nobody |
foliage-no-fire | A flammable style in a game whose grass has no fire |
In code
editor.styles.selectShape('grass', { kind: 'rect', x: 20, z: 20, width: 8, depth: 6 })
editor.styles.selectPatch('grass', cell, 'add', { sameValue: true })
editor.styles.selectStyle('grass', 2)
const own = editor.styles.ownStyle('map') // { ok, value: the new style }
editor.styles.paintSelection(2, { grass: true }) // Use style; { empty: true } is Fill; 0 clears
editor.styles.rename('grass', 2, 'Tall grass', 'game')
editor.styles.recolor('grass', 2, [0.8, 0.7, 0.3], 'game')
editor.styles.merge('grass', 3, 2)
editor.styles.remove('grass', 4, 0) // its cells to no grass
editor.styles.setStyleLook('grass', 2, { height: 2 }, 'map')
editor.styles.setRule('grass', 2, 'conceals', false, 'map') // undefined gives it back
editor.styles.styleRules('grass', 2) // { conceals, flammable, burns… } as the game plays it on this map
editor.toggleOverlay('grassState') // 'hiding' for the patches
editor.grassBrush.arm({ act: 'ignite', layer: 'grass', radius: 2 })Reference
| A style's | This map | Every map |
|---|---|---|
| Name, colour, rules | GameMap.definitions.cellLayers[layer].values[n] | data.json: cellLayers[layer].values[n] |
| Look | MapEnvironment.bushes[layer].styles[n] | cellLayers.json: [layer].styles[n] |
| Cells | GameMap.cells[layer] |
For the look written to cellLayers.json to play, the game's view lays the file over its code (layFiles with CELL_LAYERS_FILE); the panel says so when it doesn't. patchCells(terrain, layer, cell, { sameValue }) gives the patch a cell is in, as the wand picks it.