Documentation - Editing - Geometry

A map’s geometry is cubes on a grid: select some, then extrude, carve, push, rotate, flip, move, copy and paste them. Press F2 to enter or leave edit mode, and newmap gives an empty world to try things on.

Keys here are the default bind preset’s. Where the legacy preset differs, it is noted as “legacy”; see Bind presets. Most edits act on the selection and work only while it is in view; otherwise the console says “Selection not in view”.

Selecting

Edit mode starts in cursor mode, so the editor works on whatever the mouse cursor points at; in mouse look (Tab) it works on the centre of the screen. With nothing selected, the cube under the cursor is outlined: that cube, at the current grid size, is what the keys below act on.

The selection always has one side, the face the edits push from: the side you started on, shown as Side in the selection box (see Selection and status).

The grid

Every cube is a power of two in size. The grid size is the size of cube you select and edit, from 1 unit (gridpower 0) to 4096 (gridpower 12); 16 units is one metre.

Extruding and carving

The mouse wheel, with no key held, adds or removes a layer of cubes on the selected side.

Pushing faces and corners

A cube’s faces can be pushed in, in eighths of the cube, to make slopes, ramps and wedges. These keys are held while turning the wheel; wheel up pushes in and wheel down pulls back out.

A push that would bend a cube out of shape is left out, or only the part that keeps it whole is made.

Moving

Rotating and flipping

Both turn the contents of the selection around the axis of its selected side, and turn and flip the selected entities with them.

Copy and paste

A copy fills the paste buffer, which keeps it across maps until the next copy.

Holding Ctrl, or the paste key, shows the paste preview: the copy drawn see-through at the spot it would land, with a box around it.

Selections can also be saved to file and loaded back as prefabs, with saveprefab and copyprefab, which loads one into the paste buffer.

Undo and redo

An undo step covers every change made to the same selection in a row. Each notch of extruding moves the selection, so each is its own step, but a run of pushes, rotations and flips on one selection undoes all at once. Undo selects the area it changed. How much is kept is set by Undo size in Editor settings (undomegs).

Deleting

Heightmaps

Heightmap mode shapes terrain with a brush, pushing the corners of the cubes under it rather than whole faces.

Shapes

A shape is geometry worked out from a formula, such as a sphere, a cone or terrain from a heightmap image, and built over the selection in one go. Open the Shapes Tool panel with Shift+F4, its toolbar button or Tools in the menu bar, choose a shape and its size, and press Build.

The shapes, and their commands, which take the same sizes followed by the detail, the offset and 1 to carve:

Terrain from a heightmap

Build terrain raises ground from a greyscale image (buildterrain): each pixel is the height of a corner of a column of cubes, brighter being higher, up to Height cubes for white. The terrain is one cube smaller than the image on each side, so an image of 65 by 65 pixels makes terrain 64 cubes across. Typed in the console, the image is named with its extension, such as buildterrain mymap/height.png 16.

Importing cubes

Import reads an SMC file, a list of cubes made by a marching cubes tool outside the game (importsmc). Each line is a cube, x y z size from the selection’s corner followed by the densities of its eight corners, negative inside. Solid cubes makes each listed cube solid instead. Lines that aren’t cubes inside the world are skipped and counted in the console.

Editing online

Shapes, terrain, imports and heightmap strokes reach the other players in the session. A very large one is sent a part at a time, so they may see it arrive over a few moments, and one too big to send at all is taken back, saying so in the console.

The server limits how fast each player’s edits may arrive (editcost), so the game sends large edits and many quick ones a little at a time to stay within it. An edit over a selection holding more cubes than that allows at once (1048576 at the server’s defaults, counted at the selection’s grid size) is refused online, saying so in the console: select a larger grid size, or edit it in parts. A copy too big to send, such as a large prefab, can’t be pasted online either.

Commands that change the whole map, such as shrinking it or culling texture slots, reach everyone in the order the server gets them. An edit another player made just before, still on its way, lands where the map was, so run them while nobody else is in the middle of an edit.

Two players placing new entities at the same moment can each take the same slot, and each ends up with the other’s entity in place of their own. Check entities placed together with someone else, and place again any that went missing.

Keys

Key Action
Left click Select a cube; drag to select an area
Shift + left or right click Extend the selection to the cube clicked
Right click (mouse look) Extend the selection to the cube clicked
Middle click Select corners; in heightmap mode, choose brush textures
Space Cancel the selection
Left Ctrl (hold) Select through the selection and entities; show the paste preview
Wheel Carve (up) or extrude (down) on the selected side
Shift + wheel Carve or extrude, keeping the selection over the cubes
G + wheel Grid size
Alt+G Cycle the grid drawn over surfaces
F + wheel Push the selected side, or the selected corners
Q + wheel Push the corner nearest the cursor on every selected cube
R + wheel Rotate the selection
; + wheel Step through the selection’s sides
X, Y, Z Turn the selection to that axis’s side; keep a move to that axis (legacy Shift+X, Shift+Y, Shift+Z)
Ctrl+X Flip the selection (legacy X)
C Grab: move the selection box, or the selected entities (legacy Shift+C)
Alt+C Grab, with every entity under the cursor
U (hold) Cut: move the selected cubes and entities
Ctrl+C Copy (legacy C)
Ctrl+V Paste; hold for the preview (legacy V)
Ctrl+Z Undo (legacy Z)
Ctrl+Shift+Z Redo (legacy O)
Backspace Delete the selected entities, else empty the selected cubes
H Heightmap mode
K + wheel Heightmap brush
Shift+F4 Shapes Tool panel
- Texture every face of the selected cubes, or only the selected side (allfaces)
B Fullbright
F9 Cycle the outline mode

The keys of editor actions, such as grab, flip and the wheel keys G, F, Q, R and ;, can be changed in the Editor bindings Tool panel. The others, such as the mouse buttons, Space, Backspace, H, K and -, are set in the console with editbind.