Compiling


Compiling your game can mean one of two things: compiling it for testing, or compiling it to create an asset package for a specific target platform. Testing your game can be done by simply pressing the Play button at the top of the IDE, which will launch the game for testing using the specified target. You can also run the game in Debug Mode by testing using the Debug button . This will run the game, but also open up the Debug Window, where you can monitor how your game performs and debug any issues (see the section on Debugging for more information).

By default GameMaker Studio 2 will run and debug using the built in VM (virtual machine), which is more or less the same as running on the desktop OS being used. However GameMaker Studio 2 is a cross platform engine and you can test, debug and compile asset packages of your projects on a number of different target platforms (the exact platforms available will depend on the details of your licence). To change the current target platform you can click on the Targets button to open the Targets Window, which will look something like this (exact details will vary based on your licence type): Targets Window

At the top, beside the Targets button, you have the current settings which tells you the platform and the specific settings actually being used, and then the rest of the window is taken up with the details and options for all the available targets which you can select to use instead. Each section of this window is explained below:

The first column of the Target Manager is dedicated to the Remote Workers that you have available. To begin with, you will only have a single "Local" machine listed here, which is the machine that GameMaker Studio 2 is installed on, but you can also configure a Remote Worker to use. When a Remote Worker has been configured, you will then be able to select it from the list here, and have it build your projects rather than use the host machine where GameMaker Studio 2 is installed.

For more information on how to set up and use Remote Workers, please see the section below:


This section lists all the available target platforms. The contents of this list will vary depending on the licence that you have, but will always have at least the "Test" target. To select a target, simply click on it. This will then update the rest of the options windows to show different details depending on the platform selected.


Each target platform can have one or more output formats, the main ones being:

  • VM: The VM (Virtual Machine) target uses a generic runner for each platform and then interprets the code for your game. In general this option is used for testing due to its faster build times, but it does not offer the same performance boost that using the YYC option (if available) offers. You can use this to compile smaller game or games where performance is not ever going to be an issue, however.

  • YYC: The YYC (YoYo Compiler) takes the normal GameMaker Studio 2 output and compiles it into native code for the target platform, "stripping out" unneeded functions and performing a host of other optimisation techniques to create a smaller and performance enhanced executable. This can increase your games performance by at least two or three times, especially on logic-heavy games, ideal for those larger or CPU intensive games. Compile times may take longer and you should always clear the compiler cache before building any final complete asset package for a target platform. Note that the YYC target may require extra tools to be installed for the platform selected, otherwise it will not work - you can find further information about this from the YoYo Games Help Center as well as on the individual target Preferences pages detailed in this manual.

  • JavaScript: The JavaScript target will only be available for a few targets, like the HTML5 target, and sets the game to be compiled to pure JavaScript.

Certain platforms (like iOS or Android) permit you to associate one or more devices with GameMaker Studio 2 so that games can selectively compile to them. Initially, the device list will be empty and you need to click on the Pencil icon to open the Device Editor: Device Manager

Here you can add new devices as well as have GameMaker Studio 2 test for a connection to any device(s) that may be connected. The exact contents of this window will depend on the platform specifics (see the section on the Device Manager for exact details for any given platform). Once a device has been found or added, it will then be shown in this window, like in this example image for Android: Add Device

The exact procedure and requirements for setting up devices and troubleshooting issues can be found in the appropriate section of the GameMaker Studio 2 Knowledge Base.


As explained in the section on Configurations, you can store certain details for compiling your game as Configs. This section of the Targets window permits you to have GameMaker Studio 2 automatically select a specific configuration for a specific target platform.


Creating A Final Executable Package


Compiling your game project to any target platform will require that you have set up the correct build tools (see here) and also filled in the appropriate Platform Preferences. Once you have done that you can simply click the Create Executable button in the IDE to start the compiler build or select Create Executable from the Build Menu. Either option will open a file explorer window where you can give the final name that you wish to use for your game package before clicking Save to start the compile and build process. Once you have done this, the necessary files will be generated so that you can distribute it as you wish.

NOTE: Before doing a final build of your project for release, you should always clear the Asset Compiler Cache (using the "broom" icon at the top of the IDE) to ensure that all cached files are recreated and no stale files corrupt your final game.


Each target option saves to a platform specific format, listed below:

Once you have created your executable asset package you can then give the file to other people or place it on your website to download, or upload these files to the different hosting services for individual distribution or even to online stores (like Google Play, iTunes or the MS Store) for general distribution and retail.

Note that you are free to distribute the games you create with GameMaker Studio 2 in any way you like, including selling them. Of course, this assumes that the sprites, images, and sounds you used to make it can be distributed or sold as well and that you have the legal rights to all assets, and it also assumes that the game complies with the YoYo Games EULA for GameMaker Studio 2. You can find the licence agreement in the install folder for GameMaker Studio 2, typically "C:\Program Files\GameMaker Studio 2\Licence.txt".