Skip to content

Map Editor

kobewi edited this page Feb 26, 2025 · 9 revisions

Map editor is divided into 2 main sections: map view (right) and sidebar (left).

Map view is where you interact with your map - draw cells, edit borders, symbols etc. Sidebar contains navigation options, various editing modes and, depending on the mode, some options.

The editor supports undo/redo. Ctrl+Z is undo, Ctrl+Y/Ctrl+Shift+Z is redo. Right now these shortcuts can't be changed.

Navigation

It's important to note that the map is divided into layers. Using them is optional; they can be parallel worlds, interior sub-maps or whatever use-case you come up with. The editor properly displays a single layer, that is all cells, symbols, custom elements etc. Sometimes it's desired to see another layer at the same time, to make parallel rooms and stuff. This is what "Preview Layer" option is for - it allows to display another layer. The other layer will be translucent and some elements are omitted, but you will see general shape of the layer.

You can change current layer either on the side-bar, using Q/E keys (physical). Layers can be changed via dropdown, but only named layers can be selected this way. Double click a layer to edits its name.

Note

Named layers can be accessed in code by using MetSys.get_layer_by_name().

You can pan the map view using Middle Mouse Button; the Recenter View button on the sidebar moves you to (0, 0) in case you get lost (the canvas is infinite). In the top-left corner of the map view you can see the coordinates of the hovered cell.

There is also a zoom feature. It's very basic and simply scales the map view, but it's useful if you have high display resolution and find the map too small.

You can also zoom using Ctrl+Mouse Wheel.

Room Layout Mode

This is the most basic mode and allows you to draw rooms with a rectangle tool. Use Left Mouse Button to draw a room and Right Mouse Button to erase. If you draw a rectangle that overlaps another room, they will be merged.

Note that any modifications to a room will remove its assigned scene.

You can rearrange rooms by holding Shift and drag and dropping them. You can't drop a room into a space occupied by another room. Rooms moved this way will retain their scene.

Cell Color Mode

Mode that allows overriding the default cell color. Use LMB to assign the color, RMB to clear it (so default will be used). You can pick the color using the color picker on the sidebar or by Ctrl+Clicking a colored cell. You can also color the whole room at once by holding Shift.

Cell Symbol Mode

Mode that allows drawing cell symbols. A symbol may represent a save point, teleport, treasure, anything. Symbols need to be registered in the theme first, then you can select one from the list on the sidebar or by Ctrl+Clicking a cell with a symbol. Use LMB to draw symbol, RMB to remove. A cell may have only a single symbol.

Symbols are more useful at runtime. They can be assigned dynamically and automatically.

Cell Group Mode

Mode that allows assigning groups to cells. Select group ID on the sidebar, use LMB to assign selected group and RMB to unassign. Holding Shift will add or remove group to the whole room. Cell groups are a mean to operate on multiple cells at once. The most common use case are maps items that discover a portion of the world map. A cell may belong to any number of groups.

Cell groups can be named just like layers and accessed with equivalent MetSys.get_group_by_name() method. See Groups and layers for more info and usage.

Border Type Mode

Mode that allows changing room's borders. There are 2 default border types: wall and passage. More border types can be registered in the theme. They can be doors, special barriers or narrow passages, anything. A cell's edge will be highlighted when hovering near it with the cursor. You can pick a border type from the sidebar list or by Ctrl+Clicking a border. Draw borders using LMB, remove (reset to wall) with RMB. You can hold and drag to draw multiple borders; useful when you want to draw them at both sides of an edge. Also holding Shift will set the borders for the whole room.

Border Color Mode

Border colors can be changed separately from the cell color. The process is the same - use picker or Ctrl to select color, use LMB/RMB to draw/remove color, hold Shift to set color for all borders in a room.

Scene Assign Mode

This mode allows to assign scenes to rooms on the map. The scenes are used in the editor in the Map Viewer and at runtime for room transitions. MetSys will automatically detect enclosed rooms; click one to open a file dialog that lets you choose a scene. Only scenes from the designated scene directory can be selected. Rooms with scenes assigned are highlighted and hovering them will display the assigned scene name in the top-left.

Scenes can also by assigned by simply dropping them on the rooms:

From this view you can also create new scenes, by using the "Create New Scene" button in the bottom-left corner of the file dialog:

Clicking it will open a dialog similar to Godot's own scene creation dialog:

You can configure scene name and root node name here (by default the root is called Map). The created scene is always Node2D, and a RoomInstance is added automatically.

By default the scenes are assigned by "room name", i.e. scene path relative to map root folder, but MetSys supports scene assign via UID. Using UID allows to rename and move the scene file without breaking references and it's transparent to the user for the most part. To assign UID, simply enable this checkbox:

When a scene has UID assigned, it will display differently in the tooltip:

Each scene can be assigned to a single room only. When a scene is already assigned to a room and you try to assign it to another one, the previous room assignment will be removed.

Custom Elements Mode

In this mode you can draw custom elements, like special multi-cell markers, elevators, map labels, anything. They need to be first defined in the main config. Elements in the editor are drawn as rectangles, but they occupy only their top-left cell. Use LMB to draw an element and RMB on its origin cell to erase it. You can provide a custom String data that will be passed to the draw callback of the element.

Custom element is drawn only if a part of its area is within the drawn coordinates. Make sure the content is encompassed to avoid wrong culling. If the custom element list does not match what you defined, you can use "Refresh Custom Elements" option in the Manage tab.