In this tutorial we will be introducing you to the GameMaker Studio 2 Workspace, which is essentially the area that you will be working within when you create assets, write code or design rooms.
You can watch the following video on Workspaces too:
The Initial Workspace
The first time you run GameMaker Studio 2 your initial workspace will look something like this:
As you can see, the initial workspace is on a tab at the top of the screen but you can create further workspaces for the project by clicking the icon to the side, giving you multiple possible workspaces for any single project. You can do a slow double-click on the Workspace tab to change its name and call it something more appropriate, and you can also save and load workspace layouts from the Layouts menu at the top of the IDE. GameMaker Studio 2 is highly customisable and the idea behind the workspace paradigm is that you should be able to position and use any of the tools available in the way you choose, following your own workflow, rather than be forced into a certain way of doing things by a rigid IDE.
We'll go into using the general workspace in a bit more depth later, but first let's look at the default workspace and the additional docked windows it contains.
The Resource Tree
On the right of the screen you can find the Resource Tree. Here is where you can create and edit the resources that your project uses, as well as generate and change configurations. Resources are created by right-clicking on the resource folder and selecting Create, or from the context menu at the top of the IDE which says Resources:
Selecting any one of these options will create a new, empty resource of the given type for you. The new resource created will appear either within the current workspace tab, or within its own workspace depending on the type chosen. You can also create different resource tree Views by clicking the Views icon. This will open a menu where you can select to rename the current view, create a new view, clone the view, or delete the view (you cannot delete the default view):
If you choose to create a new view or clone the current one, you can name it whatever you wish and then you can drag, add or remove elements in the resource tree to create a view of the resources appropriate to your needs. For example, your artist may want to create a view that only has those assets that pertain to creating art and designing rooms:
This is a rather powerful organisational tool as, unlike the default view, you can rename the main folders from "Sprites" (for example) to "Art Assets" and then drag tile sets, fonts or shaders into the same base folder, irrespective of their position or asset type. You can access all the different options for customising the resource tree from the right button menu:
Note that while the resource tree is docked to the IDE by default, you can take it out and into its own window by clicking and holding on the "Resources" text at the top and dragging. You can re-dock it again at any time by dragging it to the sides or bottom of the IDE (this is explained in more detail in the next section of the tutorial). If you close the resources window and wish to recover it you can use the Window Menu at the top of the IDE.
As mentioned previously, you can dock and un-dock the resource tree to the current IDE workspace, but it's worth mentioning that many of the IDE windows can be docked and un-docked at any time. If you have open the room editor workspace, for example, you can drag the different docked elements like the layer information into the workspace to create a new window, or onto any dock to change where it is positioned. This is done by clicking and holding on the top bar and then dragging it to the side of the current workspace, where you will see an area highlighted indicating that it can be docked.
If there is already a dock open with contents, then, depending on the window context, a new tab may be created for the contents, or you'll get a horizontal highlight bar to indicate where the window will be docked within the current tab:
You can also un-dock any window that has been added to the IDE in this way, by clicking and holding at the top of the dock and dragging it into the workspace. In this way you can create a personalised IDE experience that fits your workflow and way of doing things. It's worth noting that all docked windows can be hidden/unhidden by clicking the button on the edge of the docked items or by clicking the Expand/Contract button at the top of the IDE (hotkey, F12), and that the IDE will remember docked windows between sessions:
Another feature of the default workspace is that it will have various Output Windows docked at the bottom of the screen. The different outputs are shown in tabs, and these can be closed or pulled into different docks as you require (you can re-open them again from the Windows menu at the top of the IDE):
There are a number of sub tabs in this dock related to Source Control, Searching and Debugging (Breakpoints and Compile and Syntax errors), with the initial tab being for the Console/Compiler Output, which shows you what is happening when you are compiling a game for testing or when creating a final package for distribution. This will also show any debug messages that you choose to send from your project at runtime, and can be configured to show different quantities of information from the General Preferences.
At the top of the IDE you can find a number of buttons that give quick access to the most common commands that you'll be using when creating games with GameMaker Studio 2. While these are not strictly part of any given workspace we'll briefly go through them to give you an idea of what they do since they are as essential as workspaces to getting good workflow:
|This button will open the Start Page in a new workspace tab.|
|This button will prompt you to create a new project file (you will be asked if you want to save the current project before continuing).|
|This button will prompt you to open an existing project file (you will be asked if you want to save the current project before continuing).|
|This button will save the current project file. Note that by default GameMaker Studio 2 will save your project automatically (depending on the Preferences that you have set) and this button is simply so you can force a save at any time.|
|This button will create an executable file or folder for the given target platform (see below for more information on setting the target).|
|Clicking this will test-run your current project along with the debug module. Use this to test and debug your game. You can find more about the debug module from the section in the manual on the Debugger.|
|Clicking this will test-run your project on the chosen target platform.|
|This button can be used to cancel the compilation of your games to the target module, or (on certain targets only) to stop the game while it is running after it has been compiled.|
|Pressing this button will clear the current asset compiler cache. GameMaker Studio 2 stores images, sounds, scripts etc... between use in a cache so as to save time when testing your game as it will only re-compile those things that have been changed before testing. However, this cache may become corrupted or "stale" over time, or you may wish to do a full test with no caching being done previously, in which case you can clear the cache by pressing this button.
IMPORTANT: It is recommended that you always clear the cache before creating the executable for any target platform.
|Clicking this will open up the Project Options Editor.|
|Click this to open the manual (or alternatively, press ).|
|These controls can be used to zoom in/out a workspace (except the room editor and image editor workspaces). You can also zoom the workspace using / and the mouse wheel and you can click and hold the middle mouse button to pan around the area.|
|This button can be used to expand or contract the side and bottom docks.|
One final thing to mention here is about navigating the workspaces and windows available. To start with, you can hold / and to bring up the Workspace Navigation window:
This window permits you to quickly find and select any open elements from any of the currently active workspaces in the IDE, and is a very handy tool particularly if you are dealing with large projects and need to jump around between different assets. You can also click the right mouse on any empty section of the workspace to open a navigation window which permits you to create new resources without going to the resource tree as well as select any open window within the current workspace or open the Goto window:
The Goto Window is essentially a search feature that can be used to search for any resource within the workspace or IDE and then open it (you can also open this with / + T):
As mentioned at the start of this tutorial, you can create additional workspaces to suit your needs and better organise the different aspects of your project, and some resources will automatically be opened in a new workspace as well. For example, if you create a room resource, it will be given its own independent workspace tab in the IDE. Or maybe you are working on interactions between the player and several enemy objects, so you'd have the player object open in its own workspace and the enemy objects in another, and perhaps even another workspace only to show the scripts that both use.
With a workspace tab open, you can then open further resources within the workspace. In the image above, for example, we have three workspaces open - one for the general objects, one for the special effect, and one for the main game room. You can switch from workspace to workspace by clicking the tab, and within each workspace you can pan around and zoom in/out to see different areas as you work. To pan simply hold down the middle mouse button or click and hold + . Zooming is done by holding down / and moving the mouse wheel up or down.
Another important feature of workspaces is that you can click on the tab and - still holding the left mouse button down - drag it off of the main IDE window into its own individual window. This makes it very easy to organise things if you are using - for example - multiple displays. Any changes made in one secondary workspace will be reflected in all the others, and you can merge these secondary workspace windows back into the main one again by simply dragging the tab back onto the first window. Being able to pull off workspaces in this way is ideal for those people that have multiple monitors, and it also provides an extra organisational tool for you when working on your projects.
This tutorial has covered the basics of the GameMaker Studio 2
workspace and workflow, and we hope that it has given you the confidence
to dive in and start on your next big project! You should keep in mind
that GameMaker Studio 2 will "remember" the workspace setup for
any given project, so when you make changes to the IDE and then close
the project, the next time you open it the same layout will be used as
that which you had before. It's also worth noting that the IDE Preferences (from File > Preferences)
can be used to change certain behaviours relating to workspaces too -
with things like setting a background image for the workspace or setting
the default action to use when opening a new window being configurable