This guide is to introduce you to some of the most important features to be found in the GameMaker Studio 2 Room Editor. One of the most frequent requests from Legacy GameMaker users was for improvements in this editor, and so it's been completely rewritten and redesigned for Gamemaker Studio 2, so let's look and see what nice new features have been added...
NOTE: There is an extensive tutorial on how to use the Room Editor and it's features in the Tutorials section of the GameMaker Studio 2 Start Page.
Perhaps the most important feature of the room editor is inheritance. Inheritance means that you can create a "parent" room then from that create a "child" room which will inherit all the parent room's properties. This child room is essentially a clone of the parent, and everything in it is linked to the parent room. This means that if you change the view in the parent, or move a tile, or add instances, it will be reflected in the child room. Not only that, in the child room you can selectively switch off inheritance for specific layers, instances, assets or anything else. A room that has inherited properties will have the inherit buttons lit, as shown by the image below, and you can then uses them to toggle inheritance on or off for the given layer or resource, etc...
This can be tough to visualise at first, so let's look at an example: say you have a room with a city and a castle in the middle. The city and castle are drawn using different tile layers and you also have instances and some paths for NPCs to use to walk around. You want to have it so that in the game the castle is destroyed, but everything else in the city looks and behaves the same. You would create the initial room with everything as normal, then you'd create a child room which inherits the parent room layers. In the child room you'd switch off inheritance for the tile layer (or even individual tiles) for the castle area and them move/add/delete tiles to create the destroyed castle look. When a player enters that room, all the instances from the parent room and all the tiles etc... will remain exactly the same, except for those of the destroyed castle.
To create room inheritance, you simply select the room you want to create a child from and then right-click. This will open the room menu and there you can select Create Child to create a new child room. This will be created and "attached" to the parent visually in the resource tree:
You can also drag any room from the resource tree onto any other room in the resource tree to have it become a child of that room (or drag a child room off a parent and break the inheritance). Note that inheritance is multi-layered and you can check individual items, groups of items on a single layer, item properties, or whole rooms as inheriting, and you can also inherit from multiple rooms. If you create a base room with nothing in it except the view setup - for example - you can then create all further rooms as being its children. But you can go a step further and create another base room with the "view" room as its parent which holds the general GUI instance and the controllers required in every game room. Now you can create child rooms from this and they will inherit both the controllers and GUIs from the parent room as well as the view setup from the parent of that room!
As you can hopefully see, inheritance is very powerful and you can use it to maintain a much cleaner room structure, speed up the workflow and generally optimise the time you spend making and designing rooms.
To start with, everything that goes into the room you create is placed on a layer. Layers can be added, removed, and sorted from the Layers Editor, and come in a variety of different types, each with their own set of options and way of working. You aren't limited to the number of each type of layer, and can have multiple tile layers, or path layers, or instance layers, etc... Each type of layer has it's own properties window where you can set different things depending on the layer type. You can also toggle the layer's visibility, with layers flagged as invisible not being included in the final game.
The image above shows the layer editor, with the current layers being listed at the top, and the different buttons for creating layers at the bottom. You can rename any layer from this editor by double clicking the name (note that you cannot use anything except letters numbers and the underbar "_" character for names) and you can also switch its visibility on or off by clicking the "eye" icon. If you want to change the inheritance of any layers then you can select them and then toggle the inheritance button to switch inheritance on/off for that layer, or you can use <Shift> or <Control> and left click on multiple layers to select them all and toggle their inheritance.
You can also right-click on any layer to get the layer menu:
Here you can open the layer properties window for the selected layer, delete the layer or add a sub layer. If you choose to add a sub layer, then the current layer will receive a "folder" icon to show that there are sub-layers attached, and the new layer will be created below it, tabbed to the right. You can then choose to have the sub-layer inherit its properties from the parent layer, and also set whether it should inherit the visibility from the parent layer.
You can also drag layers up or down in the window to re-order them, and you can select and move multiple layers too. If you place the layers on top of another layer, they will be moved and set as sub-layers of the layer you dropped them on. You can also lock layers so that they cannot be edited by mistake.
NOTE: In the actual editor window where you place the different assets on their layers, you can hold down <Alt> and click anywhere to instantly select the asset and skip to the layer that it has been placed on.
Once you've made an instance layer or an asset layer, you simply have to drag the resource you want to put on it from the resource tree and place it at the right position. You can double-click on any of these items on the layer to open up the item properties. Tile layers are what you would expect, ie: a layer of images from a tile-set that are drawn to the room, but note that tiles in GameMaker Studio 2 are always snapped to the grid. Background layers can be a solid colour or can be generated from a sprite, and path layers... well let's look at those here...
Another innovation of the GameMaker Studio 2 room editor is that you can now add and edit paths directly in the room editor. You can first create your path resource in the resource tree and then in the room editor add a path layer and select it. However you can also create the path layer and in the path properties window click the "new" button which will automatically create a new path resource and let you edit it. Whatever method you choose, the path can now be edited right in the room!
As you can see from the above image, you can click to add points directly into the room editor, and you can select them and drag them around as you would in the path editor, with the same option being shown for the path layer properties as you'd expect: Smoothing, precision and open/closed. You'll notice that there is an inherit button too, since paths can also be inherited from parent rooms. Toggling this on or off for a child room will permit you to change just the path properties for an otherwise inherited room.
The Asset Layer
Finally in this list of things to note for the room editor we have the addition of the Asset Layer. This is another type of layer that you can add to your room which only holds sprites. This is not like a tile layer, since tiles in GameMaker Studio 2 are always snapped to the grid and currently can't be animated. Instead this is a layer where you can drag a sprite resource from the resource tree and drop it anywhere and it will be drawn from then on at that position.
The image above shows you the properties for a single sprite on the asset layer (you can place as many as you want per layer). You can open the properties by double-clicking on the asset on the layer and as you can see it permits you to colourise it, give it a unique name, flip/mirror it as well as set the animation speed and starting frame. So, now you have no need for those objects in your game that are only there to draw the flames of a torch or eyes in a mouse hole, etc...
We can't go into all the details about all the improvements made to the room editor in just one article, but hopefully with this overview you'll be less intimidated and find it easier to grasp the paradigm changes that have been made. For a more details of the room editor and all the different options it has, please refer to the manual (press F1 in GameMaker Studio 2).