Map editor

The **Map editor** in Stick Veterans is the editor used to create or test maps. The maps can be saved as a file with extension .ssm (3D map) or .ssm2d (2D map), and can then be reopened in the game at any moment.

The Map editor is accessed from the menu and it's the last button shown by scrolling to the end on the right.

## Tools

### Blocks Mode

Used for adding, modifying and erasing blocks:

* Left click and drag to draw a block on the horizontal plane. Afterwards, release and move the mouse up/down to set the block height, and click again to finalize. Alternatively, scroll the mouse wheel while holding left mouse button to set the height.
* Using the same process as above while holding Control allows for erasing instead of adding blocks.

### Erase Mode

Used for erasing blocks and objects:

* Specify an area (using the same process as when drawing a block) to erase blocks and/or objects inside this area.
* Whether to erase blocks, objects, or both can be set by toggling the respective checkboxes in the Erase toolbar button's dropdown.

### Select Mode

Used for selecting, copying/pasting and deleting regions of blocks and objects, as well as performing transformations:

* Specify an area (using the same process as when drawing a block) to mark as selected.
* Whether to select blocks, objects, or both can be set by toggling the respective checkboxes in the Select toolbar button's dropdown.
* Selected region can be cut, copied or deleted using the respective dropdown buttons or `Ctrl + X`, `Ctrl + C`, `Delete` respectively.
* After copying/cutting, the selection is stored in the "clipboard" and can be pasted in any location as many times as needed.
* Various Mirror/Rotate actions can also be performed:
	+ When a selection is active, these actions will mirror/rotate the selected area.
	+ When a paste action is active (after selecting Paste but before clicking to complete it), these actions will mirror/rotate the content before it is pasted.
* Some convenience actions are also available in this mode's dropdown:
	+ "View to map center" resets the camera to the center (average) of the map.
	+ "View to selection" resets the camera to the center (average) of the current selection, if any.
	+ "Toggle rulers" enables/disables ruler lines on the cursor, useful for aligning distant areas.

### Objects Mode

Used for adding or deleting objects:

* Select the object to add from the mode's dropdown, or by using the square bracket keys [ ] to cycle objects.
* Left click to add selected object.
* Ctrl + left click an existing object to delete it.
* "Simple mode" can be toggled from the respective checkbox in the mode's dropdown:
	+ When enabled, objects are automatically placed at the appropriate height by clicking on an upward surface (recommended).
	+ When disabled, objects can be placed at any position at the selected height. Note that this can cause bots to get stuck or fall off by trying to collect hard-to-reach objects.

### Paint Mode

Used for painting blocks:

* Choose a coloring method from the "map colors" dropdown:
	+ "Off" sets all the blocks to white.
	+ "Per block" allows painting each block with its own color.
	+ "Gradient" options allow applying a color gradient across the whole map in the selected axis.

* In "per block" mode, a color circle appears next to the toolbar where you can select the current color. Clicking/dragging on blocks will paint them with this color. Also, newly added blocks will have this color. A block's color can be copied by Ctrl + clicking it ("eyedropper").
* In "gradient" mode, a ribbon appears where the gradient colors can be specified by clicking on a position on the ribbon. Added colors can be moved around by ctrl + dragging and can be removed by right clicking.
* Additionally, the sky/ground color can be changed and the sun/clouds can be toggled using the respective controls in the mode's dropdown.

## AI waypoints building

Since AI players (bots) are usually deployed in matches, they need some precomputed information (waypoints) for the current map to be able to navigate it. Building waypoints is done via the "Build AI waypoints" button in the AI dropdown (second toolbar button).

The density of the waypoints can be selected when building. More density allows bots to navigate more complex maps, but takes longer to build and may decrease the game's performance in large maps.

Whenever the map is modified (blocks added/removed), the waypoints need to be rebuilt. This is not required if only objects are added/removed or blocks are painted.

## Testing

### Solo testing

The user can spawn and navigate around the map anytime by choosing "Test play" (Alt + P) from the first toolbar dropdown. At least one spawnpoint must exist to do this.

The test play can be ended anytime by choosing "End test" in the pause menu, or by pressing Alt + P.

### Testing with bots

After building AI waypoints, the user can test the map with bots by choosing "Test with AI" (Alt + Shift + P). The number of bots and the desired gamemode can be chosen, and optionally to disable bots shooting (useful to let bots wander around and check for places where they may get stuck).

During test play, the bots can be added/removed via the scoreboard (accessed by holding Tab).

## Other functions

The following functions are available in the first toolbar dropdown ("file" dropdown):

* **New Map (2D or 3D):** clears the current map and switches to 3D/2D mode if needed. Any unsaved maps/changes are lost.
* **Open:** opens a map from a previously saved file on your computer.
* **Open/Save As:** saves (downloads) the current map as a file.
* **Upload and publish:** opens a dialog for uploading the current map for publishing when ready to play. The map will be checked by the game's developer before becoming available to play. Maps may be edited if needed, and they may be rejected if they are not deemed suitable for publishing.
* **Help:** shows reference for various functionality and keyboard shortcuts.

## Tutorial

An interactive step-by-step tutorial is accessible from the toolbar (green "Tutorial" button in the first dropdown).

An earlier video tutorial also exists (slightly outdated): https://youtu.be/B3T9Vw9U-dg