GameMaker Studio 2 Desktop comes with three export platforms: Windows, Mac and Ubuntu (Linux). In this article we give the required steps to get the Windows platform up and running.
After installing and running GameMaker Studio 2 on your PC you should be able to create and test projects immediately using the "Test" target option. However you can specifically target Windows from the IDE using the Platform Target window, located in the top right of the main GameMaker Studio 2 workspace:
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 (when using YYC the debugger will not start). The YYC target however, gives a much greater optimisation (and corresponding performance boost) especially with logic-heavy games, but large projects can take some time to compile.
When compiling for VM (or if you are a trial user), GameMaker Studio 2 requires no further setup, as VM builds do not require Visual Studio 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 you will need to do a couple of additional steps...
YYC Requires Visual Studio
The first thing that you will be required to do if you want to use Windows YYC is to download and install Visual Studio for Windows. Currently both Visual Studio 2015 and Visual Studio 2017 so you can use either (although if you are developing for UWP, then you should be using VS2015 for now). You can get the free Visual Studio Community 2015 here (note that you may need to sign up for the free MS Dev Essentials package to access the download), and you can get the free Visual Studio Community 2017 here.
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. (We strongly suggest you install SP1 anyway, as not having this can cause issues with other parts of GMS2.)
Once downloaded, start the installation process, and what you do next will depend on the version of Visual Studio that you are using.
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 instal options shown in the image below differ from the defaults, and only show the minimum required options for GameMaker Studio 2.
Click Install to install the selected components, and then restart your PC to finalise the installation.
YYC Requires Extra Preferences To Be Set
With Visual Studio 2015 Community now installed, we need to go back to GameMaker Studio 2 and open the Preferences (File > Preferences), then browse down to the section Platform Settings and finally, Windows:
Here you should add the path to the install location of Visual Studio 2015 (you can use the button to open an explorer window and choose the path that way). 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 folders as shown below:
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 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.
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 quickly build and run. If all has gone correctly your project should now run (although compile time may be longer than for the VM so be patient) and if you use the YYC it will have gained a performance boost as well.
Note that you can also test play your game using the "Debug" option at the top of the IDE. When clicked using the VM output it will run the game and enable the Debug Module to run too (this may require some extra permissions from the OS). This module permits 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.
Compiling Your Final Executables
Once you have finished your project and tested it to make sure that it works, you may want to distribute it as an executable package. To create this package for distribution is a case of simply hitting the Create Executable button at the top of the IDE and then select from one of the two options presented (this choice will not be presented if you have changed the default value in the Preferences):
We strongly recommend that you use the "Package as Installer" option, as that ensures that all the files that your project requires are installed along with the project.
The other option, "Package as Zip" will create a compressed ZIP file which the user then has to extract to their computer to run. It is also this type you will chose if you want to publish games on Steam - if you send Steam an installer executable, then the game will fail to work for players.
Once you have selected the package type, your project will be built and packaged ready to distribute.