GameMaker Studio 2 Desktop comes with three export platforms: Windows, Mac and Ubuntu. In this article we give the required steps to get the Windows platform up and running on both the Windows and Mac IDEs.
After installing and running GameMaker Studio 2 on a PC you should be able to test projects immediately using the "Windows" target using the Targets Manager window, located in the top right of the main GMS2 workspace:
(If you previously had a free Trial license, then you will be used to seeing the "Test" target here, but this psuedo-target will no longer be listed once you have the Desktop module.)
For the Windows target platform you can see that there are two output options:
- VM - This will build your game using interpreted code.
- YYC - This will build you game using compiled native code.
The VM option will build your game and use interpreted code within a special YoYo Runner. The performance of this target is less optimised than YYC, but it is faster to compile and offers the ability to run in debug mode (if you target the YYC and try to do a debug run, GameMakerStudio 2 will notify you that the build will be completed using VM instead). The YYC target gives much greater optimisation and a corresponding performance boost, especially with logic-heavy games, but be aware projects will take more time to compile.
When compiling for VM, GameMaker Studio 2 requires no further setup, as VM builds do not require Visual Studio or any other external tools to be installed on your PC. Of course, later on, you will need to make sure that your Windows Game Options are correct before trying to build/publish your project (see the manual for more information).
If you wish to compile using YYC or you are using the Mac IDE, then you will need to do a couple of additional steps...
Setting Up A Remote Worker (Mac IDE)
To compile your project from the macOS IDE to Windows you will need to use the GameMaker Studio 2 Remote Worker app.
This requires you to have a windows PC and have it visible to your Mac over a LAN. Unfortunately, without knowing your personal Windows/macOS/LAN/Router/Firewall setup, we can't give detailed advice on this bit (and our Helpdesk are unable to help with this also).
Once you have your Mac and PC connected and are able to transfer files between them, you need to open GameMaker Studio 2 and click on the Target Manager and then click the "eye" icon to find the Remote Worker Installer folder:
This will open Finder on the folder with the Remote Worker Installer executable, as shown below. Use Finder to now copy this Windows executable file to a location on your PC.
Once you have copied the remote worker setup file over, it needs to be installed on the PC (you do not need to install GameMaker Studio 2 itself, just the Remote Worker). When finished, it will run and in doign so open your default browser to the Remote Worker Welcome Page:
IMPORTANT! Your PC may give a firewall alert when you first start the Remote Worker and also when you do your first remote build. This is normal and you must permit the connection requests.
In the screenshot above you can see that we have highlighted the IP address and port of the Remote Worker. That is because you will need this for your Mac, so that it knows which PC to communicate with (you can set up more than one Remote Worker on different PCs if you require them).
Back on your Mac, you need to go back to the Target Manager and in the Worker column click the (+) sign to add your new PC remote worker:
You will then be prompted to give your Remote Worker a common name (this is what will be shown in the Worker list in the Target Manager) and then the Host Name. The Host Name is simply the IP:Port value that was shown in your PC browser when you installed/started the Remote Worker:
Clicking the "Add" button will test the connection and if all is okay it will add the Worker into your Target Manager list and when you select it you will see that the build targets change to show the different targets that this worker is capable of building for you.
You should now be able to select the Remote Worker from the Workers section of the Target Manager, ready to test a project. You can skip down to the Testing Your Projects section if you are happy to use the VM for testing and compilation, but if you wish to use the YYC then you need to continue on with the following steps.
YYC Requires Visual Studio
Before you can build YYC versions of your projects you will be required to download and install Visual Studio for Windows (if you are using the Mac IDE then this will need to be downloaded and installed on the machine used for your Remote Worker).
Currently, both Visual Studio 2015 and Visual Studio 2017 are supported so you can use either, but we currently recommend using VS2017. You can find information on how to get both Visual Studio Community 2015 and/or Visual Studio Community 2017 here (note that you may need to sign up for the free MS Dev Essentials package to access the download).
Please note that both VS2015 and VS2017 require you to be running at least Windows 7 with SP1. If you do not have SP1 installed, Visual Studio will refuse to install. (Win 7 + SP1 is the minimum required to run GMS2 anyway, so you should already have this.)
Once downloaded, start the installation process, and then follow the steps outlined below for the version that you are installing.
Installing VS 2015
When you start the installation and have chosen an install location, you need to then then select the Custom option and click Next. This will take you to a window that shows the different components that you want to install, of which you should choose those marked in the image below. Note that these differ from the defaults, so ensure you do set these, otherwise GMS2 will fail to find your VS install in Preferences.
Click Next to see a summary of the components to install and then continue. Once the install process has finished, you can go back to GameMaker Studio 2.
When you run the installer for VS2107 you will be presented with a welcome screen where the products available for installation are listed. In this case you want to select Visual Studio Community 2017, which will then open a further window where you can select the components required and the install path for them. Note that install options shown in the image below differ from the defaults, and only show the minimum required options for GameMaker Studio 2 to build Windows YYC packages.
Click Install to install the selected components, and then restart your PC to finalise the installation.
YYC Requires Extra Preferences To Be Set (PC)
With Visual Studio 2015/2017 Community now installed, we need to go back to GameMaker Studio 2 and open File > Preferences, then browse down to the section Platform Settings and finally the Windows section:
Here you should type the path or browse to the install location of Visual Studio 2015 (as shown in the example path above).
If you are using Visual Studio 2017, then you will need to supply a path to the "vcvars32.bat" file, which should be in the VC > Auxiliary > Build sub-folder, e.g.:
You can also choose which type of package to compile the final executable to by default here. "Show message" means it will always ask you, or you can set it to always create an NSIS Installer or always create a Zip.
If your install of Visual Studio says it cannot be found, ensure that you have installed all of the correct VS components as shown in the VS setup section above.
YYC Requires Extra Preferences To Be Set (Mac IDE)
With Visual Studio 2015/2017 Community now installed on the PC, we need to point the remote worker at it so we build YYC projects. For that you need to start the Remote Worker app on your PC if it's not running already and then click the Settings button at the top:
When the Settings page opens, scroll down to the section for Windows and then give the path to the VS install. The exact path you use will depend on which version of VS you have installed, where VS 2015 requires the path to the install folder and VS2017 requires a path to the vcvars32.bat file, as shown in the images below:
You should now be able to compile your games using the YYC target through the remote worker. If you have any issues, make sure to revise your Visual Studio installation and ensure that all the required components have been installed (as outlined in the sections above).
Testing Your Projects
You are now ready to test your project. Regardless of whether you are using the VM or YYC output, you can simply click the "Play" button at the top of the IDE and the game will build and then run.
On Mac you will need to have started the Remote Worker app on your target PC and selected the appropriate worker from the Target Manager:
Note that on PC, when using VM builds, you can also test play your game using the "Debug" option at the top of the IDE (in the Mac IDE this button is disabled as you cannot currently debug remote worker builds). This will run the game and launch the debugger and connect it to the game (this may require some extra permissions from the OS, so accept any firewall prompts you get for the debugger or the game). The debugger allows you to see in detail how your game is performing as well as set breakpoints and check for issues or bugs. For more information, see the manual.
When you are finished making your game and have tested everything, you are then ready to compile a final executable. This is explained in the following article: